Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Uri works, but listening to changes doesn't #165

Open
igorcafe opened this issue Jan 10, 2023 · 1 comment
Open

Initial Uri works, but listening to changes doesn't #165

igorcafe opened this issue Jan 10, 2023 · 1 comment

Comments

@igorcafe
Copy link

I'm using custom scheme and am testing on my Android Emulator, which is running Android 9.

The getInitialUri is working as expected, but with uriLinkStream.listen nothing happens (no uri nor error).
Which is strange because clicking on a link like that moves me to my app:

issue-unilinks.mp4

AndroidManifest.xml:

<intent-filter>
  <action android:name="android.intent.action.VIEW" />
  <category android:name="android.intent.category.DEFAULT" />
  <category android:name="android.intent.category.BROWSABLE" />
  <!-- Accepts URIs that begin with abc://app.blabla.com -->
  <data
    android:scheme="[abc]"
    android:host="[app.blabla.com]" />
</intent-filter>

My initialization:

StreamSubscription? linkSubscription;
...
Future initUniLinks() async {  
  try {
    final uri = await getInitialUri();
    print("uri: $uri");
  
    linkSubscription = uriLinkStream.listen((Uri? uri) {
      print("uri: $uri");
    }, onError: (err) {
      print(err);
    });
  } on PlatformException {
    print("error!");
  }
}
@igorcafe
Copy link
Author

Probably related to #162

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant