avioli / uni_links

Flutter plugin for accepting incoming links.
BSD 2-Clause "Simplified" License
563 stars 303 forks source link

Has anybody gotten universal links working on iOS 13 ? #76

Closed dprophete closed 3 years ago

dprophete commented 4 years ago

I swear everything was working fine a few months ago. And then I picked up developing my app again lately and now I can't get universal links working on ios. Android is fine, but no luck on ios. Not sure if it's the latest flutter, the latest uni_links or the latest ios. But I just can't get it working properly on ios.

Yes, I updated the my apple-app-site-association to include the new recommended format (and keep the old one there are well), like:

{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "Z1239YU75.com.mycomp.mysubdomain",
                "paths": [ "/mysubdomain.mycomp.com/*" ],
                "appIDs": ["Z1239YU75.com.mycomp.mysubdomain"],
                "components": [
                    {
                        "/": "/mysubdomain.mycomp.com/*"
                    }
                ]
            }
        ]
    }
}

(and I can curl my subdomain and the file is serverd properly, no redirect)

MyRunner.entitlements looks correct:

<?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: mysubdomain.mycomp.com </string>
    </array>
</dict>
</plist>

I just can't get it to work. I tried on the simu, on the phone, with testflight... nothing works on ios, it keeps opening in safari (and android works properly...)

In case you asked, here is flutter doctor:

>> flutter doctor -v
[✓] Flutter (Channel stable, 1.20.3, on Mac OS X 10.15.6 19G2021, locale es-ES)
    • Flutter version 1.20.3 at /Users/didier/tmp/flutter
    • Framework revision 216dee60c0 (hace 2 semanas), 2020-09-01 12:24:47 -0700
    • Engine revision d1bc06f032
    • Dart version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/didier/Library/Android/sdk
    • Platform android-30, build-tools 29.0.2
    • ANDROID_HOME = /Users/didier/Library/Android/sdk
    • ANDROID_SDK_ROOT = /Users/didier/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.7)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.7, Build version 11E801a
    • CocoaPods version 1.9.1

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 42.1.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] IntelliJ IDEA Ultimate Edition (version 2020.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 49.0.4
    • Dart plugin version 202.7206

[✓] VS Code (version 1.39.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.4.1

[✓] Connected device (1 available)
    • iPhone 11 (mobile) • CF71C2E0-11E3-44D2-A1B0-45CCBDF9B84C • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-7 (simulator)

• No issues found!
LeoHub-dev commented 4 years ago

Sadly same problem for me. the getLinksStream doesnt returns anything when is a app/universal links. Custom scheme links still works.

bulenthacioglu commented 3 years ago

Same problem happening with me

snaeji commented 3 years ago

I can confirm that it works with universal links on iOS 14

juampiq6 commented 3 years ago

Same problem here, already serving the aasa file and added applinks to entitlements file through xcode

developeranshul1986 commented 3 years ago

Anyone solve this issue, as I am facing the same issue when I am integrating the instagram in the ios on the redirect url it not allowed to redirect to the app after the authorization. Please help if anyone has solved this. I have done all the settings for the aasa file and the entitlements.

macav commented 3 years ago

I was able to get it running with iOS 14. I made a mistake by just adding the entitlements file manually, this wasn't enough. I had to add the entitlement like this: image

Then it was working. For testing of the HTTPS links, I'm using ngrok.com

pmartelletti commented 3 years ago

@macav thanks! I spent +3 hours on the same error as you.

avioli commented 3 years ago

This is outlined in the README:

For Universal Links you need to add or create a com.apple.developer.associated-domains entitlement - either through Xcode or by editing (or creating and adding to Xcode) ios/Runner/Runner.entitlements file.

I guess I'll have to add the steps involved to add the file or create it via Xcode to the README.

avioli commented 3 years ago

Done.