ios - Universal Link opens wrong bundle ID -


background:

  • our app uses different bundle ids development builds vs beta builds vs production (app store) builds
  • i implementing universal links in our development builds
  • our production build in app store not support universal links

i experiencing crazy issue not universal links not opening development version of app, launching production version instead, despite production version not having proper entitlements.

my apple-app-site-association file has been validated using both https://branch.io/resources/universal-links/ , https://search.developer.apple.com/appsearch-validation-tool/ , looks so:

{   "applinks": {     "apps": [],     "details": [       {         "appid": "dy74r9xxxx.com.myapp.consumer.debug",         "paths": [ "/profiles/*", "/messages/*"]       },       {         "appid": "dy74r9xxxx.com.myapp.consumer",         "paths": [ "/profiles/*", "/messages/*"]       }     ]   } } 

according https://developer.apple.com/library/ios/documentation/general/conceptual/appsearch/universallinks.html details array should evaluated in order , stop after finding match.

the order of dictionaries in array determines order system follows when looking match, can specify app handle particular part of website.

the intention same universal link load in development version on team, , in production version end-users don't have .debug package on phone.

not not work, mentioned, universal links load production version, though production version lacks applinks:dev.myserver.com entitlement points me apple-app-site-association file. seems crazy imply can launch arbitrary packages didn't publish , entitlements file isn't enforced.

furthermore, if remove second entry details array , leave dictionary debug version, universal links fail work, , open safari instead. switching order of array has no effect either. have experienced behavior on iphone 6s on both 9.3 , 9.3.1. advice on these 2 isses (launching wrong package, , not launching debug package when it's entry) appreciated!

this wasn't caching issue - updated resolution below

original answer:

after changing bundle id different @ third level, per alex bauer's suggestion, able links work. changed bundle id com.myapp.consumer.debug , continued work. may have been weird caching related bug swcd service. however, if move dy74r9xxxx.com.myapp.consumer entry first spot in array, continue launch consumer version though lacks entitlements. seems potentially separate or additional bug related 4 level bundle ids , incorrect matching.

updated/correct solution

changing bundle id , changing fixed issue because modified info.plist , project.pbxproj files. when viewed diff true issue became apparent. setting our bundle id via value in info.plist:

<key>cfbundleidentifier</key> <string>$(product_bundle_identifier)${bundle_id_suffix}</string> 

with static product_bundle_identifier in our project.pbxproj. based on published common practices multiple env builds. however, in xcode 7 apple has recommend upgrading settings info.plist contains:

<key>cfbundleidentifier</key> <string>$(product_bundle_identifier)</string> 

this never issue before far building , submitting itunes proper package name. however, clear features require exact setting, noted here: use bundle identifier instead of product bundle identifier xcode 7

i set product bundle id each build type via xcode seen here , works expected.

tl;dr - universal links target product_bundle_identifier, not cfbundleidentifier. if product_bundle_identifier not match final bundle id of package, universal links not work correctly.


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -