Milad-Akarie / auto_route_library

Flutter route generator
MIT License
1.57k stars 395 forks source link

When an app is terminated. DeepLink (Universe Link IOS) only navigate to the '/' root without a specific route is used #1784

Open mtiendat opened 10 months ago

mtiendat commented 10 months ago

Issue: I have configured an universe link to go special route /m/auth/login. I tested in IOS testlight and saw deepLink (Universe Link IOS) only navigate to the '/m/auth' root when app is terminated. It only correctly navigate to route when app is foreground or background

I am using auto_route version latest What is my problem?

Screenshot 2023-11-04 at 21 29 57 Screenshot 2023-11-04 at 21 30 11
Uvais-Mohammad commented 6 months ago

@mtiendat I am also facing same issue. Did you find any solutions? Thanks in advance

batya3000 commented 4 months ago

any updates?

josencv commented 1 month ago

I'm having the same issue.

This is speculation on my part, but It most likely has to do with how Flutter handles iOS deep links when the app has not been launched yet. Flutter Deep Linking docs:

Screenshot 2024-08-07 at 6 00 21 PM

But I'm not sure if it's a problem of auto_router, Flutter or iOS.

Here is a related issue in the flutter repo

josencv commented 1 month ago

UPDATE: In my case, the problem was that I was not initializing the MaterialApp widget immediately. I had a "country resolution" process through a Bloc which conditionally built the MaterialApp. The initial frame built a "loading" widget, then, after fetching the current country, the MaterialApp was built. I had to restructure my app initialization logic so the MaterialApp was no longer built conditionally, and then everything worked.

By the way, auto_route receives the deep links by implementing Flutter's RouterDelegate class, which is the way to do it. So any deep link issue will most likely not be this lib problem.