Repository navigation
Regression handling deep links with the app closed in iOS #170665
Description
Activity
- addedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Jun 17, 2025 @js2702 Thanks for the report. I tried a sample deeplinks app from this issue and ran it in latest stable 3.32.4 with which I didn't observe the reported behavior. Upon running the command
xcrun simctl openurl booted 'sampleiosdeeplinks:///details'after killing the app from recent screen, it opened the app properly.Can you provide us the same sample demo that we can use to verify this further ?
- addedwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
on Jun 17, 2025 @darshankawar I updated the issue description with a sample. After further testing we found the issue only happens with https links and it's because we return null in the onGenerateRoute, because we handle the link later in the initial app start flow. It does not seem to trigger with custom url schemes. Our theory is because only the app would handle the link, with https also the browser can handle the link.
One thing that we found months ago when doing this deep link handling is that on Android the deep link from a closed app comes through the function
onGenerateInitialRouteswhereas on iOS it comes through onGenerateRoute. Maybe this difference could be related?- removedwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
on Jun 17, 2025 Android the deep link from a closed app comes through the function
onGenerateInitialRouteswhereas on iOS it comes through onGenerateRoute. Maybe this difference could be related?I believe this is WAI. Please see #161867.
re: the issue reported, I used the provided code sample by you in same deeplinks sample I used earlier and after killing the app from recent apps screen, ran
xcrun simctl openurl booted 'sampleiosdeeplinks:///details'which took me to the details screen correctly.
Did I use the deeplink url correctly ? If not, please provide the link to append to the command, or you may try the same by using the code you provided in the issue I linked earlier and run the above provided command.- addedwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
on Jun 18, 2025 @darshankawar I understand if that difference works as intended. I was just trying to find some explanation to the regression from the commit linked in the description.
The other issue you mentioned with an example is not valid. The problem only occurs when handling https urls. And for that there needs to be a registered domain. Maybe the Flutter team has a package id to use that can be used in debug to test https deep links.
The command is the same, just changing the url to a https one.Our dart code example can be used in conjunction with the https configuration for iOS to associate a domain with the app.
https://docs.flutter.dev/cookbook/navigation/set-up-universal-links#associate-your-app-with-your-web-domain- removedwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
on Jun 19, 2025 Thanks for the update.
The problem only occurs when handling https urls. And for that there needs to be a registered domain. Maybe the Flutter team has a package id to use that can be used in debug to test https deep links. The command is the same, just changing the url to a https one.
Our dart code example can be used in conjunction with the https configuration for iOS to associate a domain with the app. https://docs.flutter.dev/cookbook/navigation/set-up-universal-links#associate-your-app-with-your-web-domain
I'll try to set this up and verify if I can replicate / validate this or not. Meantime, I'll keep the issue open for team's tracking on behavior reported.
- addedplatform-iosiOS applications specificallyiOS applications specificallyteam-iosOwned by iOS platform teamOwned by iOS platform teamc: regressionIt was better in the past than it is nowIt was better in the past than it is nowand removedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Jun 20, 2025 - addedP1High-priority issues at the top of the work listHigh-priority issues at the top of the work list
on Jun 20, 2025 40 remaining items
- added⏳Bot is counting down the days until it unassigns the issueBot is counting down the days until it unassigns the issue
on Apr 13, 2026 This issue is assigned to @okorohelijah but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!
Here is my friction log/ observation:
I completely closed the app from recent apps, it opened on safari with the content {'error': 'Not found: /details'} but then there is a notification to open the app at the top of the website which i can confirm opens. I don't think this should be the expected behavior?? @hellohuanlin @vashworth
I tried using the custom url in debug mode cold start but i got error: "in Ios 14 debug mode Flutter apps can only be lunched from flutter tooling, ides with flutter plugins, or form xcode. Alternatively build in profile or release mode"
So it seems like on physical devices, custom shemes and https can only be cold started when in profile or release modes and the cold start works on the simulator in debug mode but https links doesnt seem to work on simulators because of the AASA maybe? and release/profile modes cant be run on simulators so if you want to test an https, it has to be on physical devices?
NB: You also have to make sure you're using the right bundle identifier that has the
Associaited Domains CapabilityAnalysis by Gemini which seems to make sense:
The throwBack parameter is YES when the link comes from continueUserActivity (universal links). This is by design for the case where the app genuinely can't handle a link. But it doesn't account for apps that want to defer handling until initialization is complete.as seen in
flutter/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterSceneLifeCycle.mm
Lines 467 to 475 in 7428429
[engine sendDeepLinkToFramework:url completionHandler:^(BOOL success) { if (!success && throwBack) { // throw it back to iOS [FlutterSharedApplication.application openURL:url options:@{} completionHandler:nil]; } }]; flutter/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm
Lines 170 to 176 in 7428429
[flutterViewController.engine sendDeepLinkToFramework:url completionHandler:^(BOOL success) { if (!success && throwBack) { // throw it back to iOS [flutterApplication openURL:url options:@{} completionHandler:nil]; I don't think this should be the expected behavior??
No that's not the expected behavior. It should open the app directly
@okorohelijah Were you able to recreate the issue with profile/release mode?
@vashworth yes, I was able to recreate the issue in profile mode
@okorohelijah does this issue turn out to be a regression from #164247?
- removed⏳Bot is counting down the days until it unassigns the issueBot is counting down the days until it unassigns the issue
on Apr 28, 2026 @js2702 If you want, I add a comment in #185430 (comment) explaining the cause
- added a commit that references this issue
on Aug 11, 2026 This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on Aug 25, 2026
Steps to reproduce
It looks like in 3.32.x there has been a regression with deep links handling with the app closed in iOS. We did some git bisect and it looks to be related to this commit #164247 @hellohuanlin .
Steps:
Our app takes a couple seconds to load and deep links can only be handled after that. So what we do when onGenerateRoute is called and the app didn't load yet we save the link for later handling.
In the example we do a mock of this behavior that can trigger the error. This only seems to happen with https links because they are handled by the phone browser. After some debugging it looks like it has this behavior because we return null in generateRoute when the app didn't load. This didn't happen before the linked commit.
Expected results
Link is handled in app.
Actual results
Link is opened in Safari.
Code sample
Screenshots or Video
No response
Logs
Since the app needs to be closed when opening through the deep link we don't have logs.
Flutter Doctor output
Doctor output