Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UniversalLink is not working on iOS 14 devices, but works well on simulator

The following solution can support universalLink on simulator.

I have an app that support the UniversalLink. User click the supported links in the website, will be navigated to the features in the application.

But It failed to work on the iOS 14 beta 4. Instead of open the the app, it opens a webpage instread.

After research, as I can see from the document here https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_associated-domains enter image description here

Need to update the Service.entitlements to support both iOS 13 and iOS 14

<Key>com.apple.developer.associated-domains</key>
  <array>
    <string>applinks:hosturl</string>
    <string>applinks:hosturl?mode=developer</string>
 </array>

It is working well on the simulator. But I am unable to make it working on the devices. Anyone can help this.

like image 504
Jin Avatar asked Aug 20 '20 08:08

Jin


People also ask

Can we test universal link in iOS Simulator?

TEST THE UNIVERSAL LINKSRun the application on the simulator once to make sure the application is installed and running fine. 2. Keep the same simulator launched and running. Go to your simulator browser and open type the ngrok domain address i.e., https://1bd39880fbad.ngrok.io in my case.

How do I deep link in iOS?

Create an app and enable deep linking Create a basic app in XCode consisting of a main ViewController pushed on a UINavigation ViewController . Also create some additional ViewController s to be used later. To confirm that your URL scheme has been registered, check Info. plist for an entry named 'URL Types'.

Why is there no App Store in iOS Simulator?

The Simulator does not run ARM code, ONLY x86 code. Unless you have the raw source code from Apple, you won't see the App Store on the Simulator. So you can only run apps you're working on and compiling yourself, and the few that are preinstalled on the Simulator.

How do I enable associated domains?

Enable Associated Domains in Your Apple Developer AccountLog into your Apple developer account and go to the app's ID page. Enable the Associated Domains app service. Take note of your Prefix (bundle ID) and your ID (team ID) - you will need them later.


2 Answers

If you want to open the application in a development environment you must:

Step 1: Specify the associated domains

service:fully qualified_domain?mode=alternate mode

ex: applinks:YOUR_DOMAIN?mode=developer

Step 2: Enable Associated Domain Development on device

On the test device, you need to activate the Associated Domain Development setting which is in : Setup -> Developer

Settings

Developer

like image 100
Alex Avatar answered Oct 01 '22 18:10

Alex


The format also changed for iOS14 devices. This means that apple-app-site-association should be on both the root folder of you website (for pre iOS9.3 devices if supported) plus on the .well-known folder.

<YOUR_URL>/apple-app-site-association
<YOUR_URL>/.well-known/apple-app-site-association

The new format is this in order to support pre iOS14 and iOS14 devices.

{
  "applinks": {
    "apps": [],
    "details": [
      {
        "appID": "<YOUR_APP_ID>",
        "components": [ // iOS14
          {
            "/": "<URL_PATH>",
            "comment": "Matches any URL whose path starts with URL_PATH and instructs the system not to open it as a universal link"
          }
        ],
        "paths": [ // pre iOS14
          "NOT \/api\/*",
          "NOT \/",
          "<URL_PATH>"
        ]
      }
    ]
  }
}

more information on: https://developer.apple.com/documentation/safariservices/supporting_associated_domains

like image 22
Daniel S. Avatar answered Oct 01 '22 20:10

Daniel S.