auto_route_library icon indicating copy to clipboard operation
auto_route_library copied to clipboard

DeepLinking not working for iOS

Open maxmitz opened this issue 1 year ago • 14 comments

auto_route version: 7.4.0

My problem is that deep links do work fine for Android but the "deepLinkBuilder" function does not get triggered (I tried it with break points) when I open the app with a link or the command line (xcrun simctl openurl booted https:///details) with iOS. I followed the setup steps from the Flutter documentation and from auto_route.

The app does open but the Deeplink is not triggered. I want to refer to a special screen in my app. With VSC I do not get a console print. In xCode I get "[Firebase/Analytics][I-ACS023000] Deep Link Web URL query is empty". Could this have something to do with it?

It is not possible for me to post a reproducible example because you need to upload the AASA file to your website.

Does somebody have the same issue, does have a workaround, or do see another issue that it could be?

Tell me if you have ideas for further information that I could provide.

Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.7.12, on macOS 13.3.1 22E772610a darwin-arm64, locale de-DE) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 14.3) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.3) [✓] VS Code (version 1.78.1) [✓] Connected device (5 available) [✓] HTTP Host Availability

maxmitz avatar Jun 07 '23 09:06 maxmitz

@maxmitz I believe your issue is with the scheme https. I can remember that I had to changed it to something else in order to get it to work for iOS by configuring CFBundleURLSchemes. For consistency reasons I would recommend to change it for Android as well by configuring android:scheme.

sjoulbak avatar Jun 16 '23 06:06 sjoulbak

@sjoulbak Do you have any more information besides changing the URL scheme to something else? That's a little vague.

jfacoustic avatar Jul 24 '23 18:07 jfacoustic

I'm having a similar problem. I'm using Firebase dynamic links to generate the deep link, and it is working correctly on Android but not iOS.

I can manually listen to the link opening the app from the Firebase package, but deepLinkBuilder is never being invoked. As far as I can tell, I have Info.plist/build configurations set up correctly.

jfacoustic avatar Jul 24 '23 18:07 jfacoustic

@jfacoustic I can give you an example configuration:

# ios/Runner/Info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
	<dict>
		<key>FlutterDeepLinkingEnabled</key>
		<true/>
		<key>CFBundleURLTypes</key>
		<array>
			<dict>
				<key>CFBundleTypeRole</key>
				<string>Editor</string>
				<key>CFBundleURLName</key>
				<string>whooff.nl</string>
				<key>CFBundleURLSchemes</key>
				<array>
					<string>whooff</string>
				</array>
			</dict>
		</array>
	</dict>
</plist>

With above configuration you can deeplink to: whooff://whooff.nl/home/dashboard

sjoulbak avatar Jul 25 '23 09:07 sjoulbak

Hi, I'm currently experiencing the same issue with deepLinkBuilder not working for iOS. Unfortunately the above workaround is not suitable. For now I am forced to use uni_links to work around the issue.

Is the underlying issue for this problem known?

kane-knowby avatar Aug 21 '23 10:08 kane-knowby

I recommend to check if your Universal Links stuff is correctly configured on the Apple site. Especially the hosting of the "apple-app-site-association" file. For this use the AASA Validator from Branch.io to verify if your Associated Domains are correctly configured. If this check fails, then the problem is not auto_route. Here is a guide for what you have to do to configure universal links for your iOS app: https://www.branch.io/resources/blog/how-to-setup-universal-links-to-deep-link-on-apple-ios/

Hint: If the AASA Validator tells you that the "content-type" header is wrong, then upload your "apple-app-site-association" file again with the file suffix .json.

KarinBerg avatar Aug 25 '23 15:08 KarinBerg

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

github-actions[bot] avatar Oct 06 '23 08:10 github-actions[bot]

Same issue here. Like @kane-knowby, my only solution is to use uni_links, and it's pretty annoying, even more when deepLinkBuilder works as expected on Android.

fabienbranchel avatar Oct 27 '23 13:10 fabienbranchel

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

github-actions[bot] avatar Nov 27 '23 08:11 github-actions[bot]

Anyone made any progress here? Our associated domains are setup correctly so I'm quite sure it's not that. We were able to work around the issue with uni_links but shouldn't have to

k-ane avatar Nov 27 '23 23:11 k-ane

@k-ane Which auto_route version do you use and have you tried to use the latest one? Also which flutter and Xcode version do you use?

KBEMobisys avatar Nov 28 '23 10:11 KBEMobisys

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

github-actions[bot] avatar Dec 29 '23 08:12 github-actions[bot]

I finally found out what the issue was here! It relates to this: https://github.com/flutter/flutter/issues/123813

Even though I wasn't using uni_links at all, just depending on the package caused the issue. I removed the dependency, flutter clean and flutter pub get, then all worked as expected!

kane-knowby avatar Feb 09 '24 06:02 kane-knowby

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

github-actions[bot] avatar Mar 10 '24 08:03 github-actions[bot]