My deep links on iOS aren't working correctly (I followed the official Flutter guide on how to implement deep links). On Android, everything works perfectly fine, but on iOS (when the app is killed), the app just launches from the link but stays at the home page (doesn't navigate to the correct route).
I use auto_route for routing.
This is my routerDelegate
in MaterialApp.router
:
routerDelegate: _appRouter.delegate(
deepLinkBuilder: (deepLink) {
if (RegExp(r'\/oferta\/[^\/]+\/[^\/]+.*$')
.hasMatch(deepLink.path)) {
return deepLink;
} else {
return DeepLink.defaultPath;
}
},
),
// Edit:
I’ve tried to implement routing with go_router instead of auto_route hoping the problem would solve and was occurring due to using auto_route. Also go_router doesn’t use routerDelegate
or deepLinkBuilder
, because it displays the configured screen based on the URL path. Unfortunatelly it did not solve my problem. When the app is killed, deeplinks open the app at homePage, they don't navigate to the desired screen on iOS. Android still works perfectly fine.