7

On iOS, when I click on a url, it opens my Flutter app but stays on the main screen. It does not go to the given page.

For example, if the link is https://my-app.com/page1, the app will just go to /

Here's the AASA:

.well-known/apple-app-site-association

{
  "applinks": {
    "apps": [],
    "details": [
      {
        "appID": "com.my-app",
        "paths": ["*"]
      }
    ]
  }
}

ios/Runner/Runner.entitlements

<?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>aps-environment</key>
    <string>development</string>
    <key>com.apple.developer.associated-domains</key>
    <array>
        <string>applinks:my-app.com</string>
        <string>applinks:my-app-staging.com</string>
    </array>
</dict>
</plist>

Everything passes if I check for the url in https://search.developer.apple.com/appsearch-validation-tool.

My app uses go_router 5.0.1

MaterialApp.router(
  routerConfig: GoRouter(
    routes: [...],
    redirect: (context, state) { ... }
  ),
)

I tried putting a break point in redirect but it never gets executed.
I tried opening the logs of the iOS emulator (Debug > Open System Logs...) but there's no trace when I run this in a terminal:

~ ❯ xcrun simctl openurl booted https://my-app.com/page1
~ ❯ xcrun simctl openurl booted my-app.com://my-app.com/page1

How can I troubleshoot this further?

Edit: the app opens on the right page on Android when I use adb shell am start ... so it must be a config issue on iOS.

Gpack
  • 1,878
  • 3
  • 18
  • 45
  • 1
    In your AASA `"appID": "com.my-app"` doesn't have team ID in the appID. But you might already know this and this is just a typo of the curated example. – Guangtong Shen Jan 11 '23 at 20:20

1 Answers1

2

Try to remove the uni_links package if it is installed. The library seems to conflicts with this mechanism.