Skip to content

How to setup Windows app so that RX.Linking.deepLinkRequestEvent will fire upon a new URI activation, while the app is already running? #1076

Open
@gabeljz

Description

@gabeljz

I have followed the docs on RX.Linking.deepLinkRequestEvent and example on Microsoft/SubscribableEvent, to arrive at this code:

const event = RX.Linking.deepLinkRequestEvent;
event.subscribe((newUri: string) => {
  console.log('new deeplink', newUri);
  /* more code to handle the newUri */
});

The handler function subscribed to the event can be executed with event.fire(...).

After setting up the Android and iOS apps according to React Native's docs on Linking, the handler function can be executed successfully upon activating a new URI while the respective app is already running.

I can't find any exact information on setting up Windows app to listen to incoming app links during the app's execution. The closest informations that I found are:

Using the TodoList app as an example, my current setting in the Package.appxmanifest is:

// TodoList/windows/TodoList/Package.appxmanifest
<Extensions>
  <uap:Extension Category="windows.protocol">
    <uap:Protocol Name="todo" />
  </uap:Extension>
</Extensions>

With this setting, the app can handle URI "todo://todos?selected=new", but only at initial launch and that the app must not be already running. Even then, the URI is retrieved from RX.Linking.getInitialUrl(), the handler function subscribed to RX.Linking.deepLinkRequestEvent is simply never executed.

So how can I setup Windows app to listen to incoming app links while the app is already running?

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationplat: windowsPrimarily affects react-native-windowsquestionstaleThis ticket may be old, or may no longer be valid, and will be closed if no further activity occurs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions