Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot get Universal Links to work

I know it's been asked before, and I've tried everything I can find here and in the Apple forums and in various how-to websites, but I still missing something, and I'm at my wit's end. I hope someone can spot a mistake somewhere.

I’m working with XCode 7.3.1 and iOS 9.3.2 on the iPhone 6S.

Member Center App IDs ID: com.hotelplanner.hotelplanner

App ID has Assoc. Domains enabled

Development Provisioning Profile with Assoc. Domains enabled iOS Team Provisioning Profile: com.hotelplanner.hotelplanner

My selected Debug Provisioning Profile in XCode Build Settings matches the one with App Domains enabled in the member center.

Xcode Capabilities Associated Domains Applinks:www.hotelplanner.com

Xcode 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>com.apple.developer.associated-domains</key>
    <array>
        <string>applinks:www.hotelplanner.com</string>
    </array>
</dict>
</plist>

Curl download of apple-app-site-association Titan:app nancysmithwp$ curl -v https://www.hotelplanner.com/.well-known/apple-app-site-association * Trying 69.56.156.14... * Connected to www.hotelplanner.com (69.56.156.14) port 443 (#0) * TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 * Server certificate: *.hotelplanner.com * Server certificate: Symantec Class 3 Secure Server CA - G4 * Server certificate: VeriSign Class 3 Public Primary Certification Authority - G5

> GET /.well-known/apple-app-site-association HTTP/1.1
> Host: www.hotelplanner.com
> User-Agent: curl/7.43.0
> Accept: *
> 
< HTTP/1.1 200 OK
< Content-Type: application/json
< Last-Modified: Wed, 29 Jun 2016 14:05:46 GMT
< Accept-Ranges: bytes
< ETag: "f35d6255fd2d11:0"
< Vary: Accept-Encoding,User-Agent
< Server: HOTELPLANNER.COM
< P3P: CP="NOI DSP COR LAW NID CUR ADMa OUR DELa IND PHY ONL UNI PUR COM NAV STA"
< Date: Wed, 29 Jun 2016 17:24:51 GMT
< Content-Length: 169
< 
{
  "applinks": {
    "apps": [],
    "details": [
      {
        "appID": "M57RZA2QX5.com.hotelplanner.hotelplanner",
        "paths":[ "/Hotels" ]
     }
    ]
  }
}

I’ve set my iOS Deployment Target to 9.0 so should not need it signed.

The validation tool at https://search.developer.apple.com/appsearch-validation-tool, given the url www.hotelplanner.com/Hotels/2446-in-Nassau-Bahamas.html says app site association file passed. Deep link failed with ‘Could not extract required information for deep links.’

The same link in notes always opens in Safari. A long press on the link gives me no options.

myAppDelegate has application:continueUserActivity:restorationHandler implemented.

-(BOOL) application:(UIApplication*) application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray * _Nullable))restorationHandler{

    if (userActivity.activityType == NSUserActivityTypeBrowsingWeb){ 
        NSLog(@"continueUserActivity");
    }
    return NO;
}

There are no errors in the console when I launch the app on my device.

Edited to add:
I implemented webcredentials to see if I could get any more insight, and I get an error in the callback that www.hotelplanner.com isn't in my entitlements, but it is there, and the target checkbox for it is set. Also, if I leave the first parameter NULL, so that it uses the domain from my entitlement file, I get the error 'No domain provided.'

entitlements

like image 889
Nancy Avatar asked Jun 29 '16 19:06

Nancy


People also ask

How do I enable universal links in iOS?

How do I set up Universal Links for my app? Log 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.

How do I test universal link?

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 open Universal link app?

If you click on a universal link from any of the “BLACK LISTED” apps, it will not open the app. Go to this link to know more. As in step one, for the first time you will have to manually pull down the website and click “open” to open the link using the respective app.

Do universal links work on Android?

Simply put, Universal Links and App Links are similar mechanisms (one for iOS, one for Android) that can be applied to any campaign link in order to send users directly to an app. These will only work for opening apps that are already installed.


1 Answers

I finally filed my first technical support assistance request with Apple and was able to get this resolved. Under Code Signing, the entries under Any SDK were empty. I deleted these entries and everything works like a charm.

Bad Code Signing Entitlements Section

like image 197
Nancy Avatar answered Nov 04 '22 02:11

Nancy