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

[Bug]: LaunchUrl click behavior is inconsistent between Android and iOS with GoRouter #911

Open
3 tasks done
zvikarp opened this issue Jun 26, 2024 · 0 comments
Open
3 tasks done

Comments

@zvikarp
Copy link
Contributor

zvikarp commented Jun 26, 2024

What happened?

When clicking on a notification, if the app is using GoRouter (it handles deep links out of the box), on Android the app redirects to the launch URL, as if the user clicked on a deep link. But on iOS the launch Url is not provided to the app navigator and we need to use OneSignal.Notifications.addClickListener to detect the clicks on the notification. This is the case if the app is in the foreground, background, or terminated.

Steps to reproduce?

1. Create a flutter app.
2. Add GoRouter.
3. Add a Redirect to GoRouter that just prints the url.
3. Initialize OneSignal etc.
4. Send a notification with a LaunchUrl to the app, the URL could be anything, a valid URL or not.
5. Run on Android and iOS and see the prints only in Android.
6. Add `OneSignal.Notifications.addClickListener`.
7. Send notifications again and see it trigger on Both Platforms.
8. Test and see the same results when the app is in the foreground, background or terminated.

What did you expect to happen?

OneSignal notifications launchUrl should be consistent across platforms, either open the URL as if it is a deep link or don't. And if it is not, that should be properly documented.

OneSignal Flutter SDK version

onesignal_flutter: ^5.2.0

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jkasten2 jkasten2 changed the title [Bug]: [Bug]: LaunchUrl click behavior is inconsistent between Android and iOS with GoRouter Jul 12, 2024
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