The app I am working on (Android, iOS) uses go_router 12 for navigation and deep linking, but the latter seems to work only on Android devices. To be more precise, clicking on a link correctly redirects the user to the app in both cases, but on iOS only the screen that gets loaded is always the home page and not the page pointed to by the link.
I have correctly setup both Universal Links and a custom url scheme, proved by the fact that the links open the app, they just not redirect to the correct screen. I have checked go_router docs and other examples of deep linking with it and it seems it should supposedly work out of the box, with required setup basically only related to ios entitlements and AndroidManifest.
Does anybody know what could be the cause and help me troubleshoot? Thank you in advance
UPDATE 2024-02-01
Initially, using uni_links
solved part of the problem with iOS, but deep links still didn't work as intended on iOS push notifications.
It turns out that it was indeed a problem with the latter, which were handled via OneSignal and their flutter package one_signal_flutter. The issue is fixed by using the additionalData
way of sending deep links via push notifications (see mobile push notifications | OneSignal docs) and after updating the OneSignal package to either:
- 5.1.0, which has just been released
- 5.0.4 and manually applying the fix discussed in this previous issue with Android
Thank you everybody for trying to help
If you have installed uni_links package previously, you may try to remove uni_links package, then flutter clean and flutter pub get again.