Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

URL types with multiple bundle identifiers for iOS apps

I'd like my iOS project to handle multiple URL types and multiple bundle identifier, so I can install 2 versions of the app on the same device.

I have 2 different bundle IDs: com.mycompany.myapp and com.mycompany.myapp-test

I'm registering 2 URL types for both bundle identifiers in the Info.plist file

enter image description here

I generate 2 builds with the 2 bundle identifiers and installing both apps on the same device. Then I'm trying to reach my apps using 2 urls: myapp://feed to open myapp and myapp-test://feed to open myapp-test.

However for some reason, I cannot open myapp-test and it always opens myapp when I click on both links.

There is certainly something wrong in the way I handle this so I'm wondering how I can manage multiple bundle ID with multiple URL scheme within the same Xcode project?

Thanks

like image 605
alexmngn Avatar asked Mar 05 '26 22:03

alexmngn


1 Answers

You need to have two different info.plist files, one for each target, with the specific URL scheme that you want for the specific app.

You then add the appropriate info.plist the relevant target in Xcode.

iOS does not use the identifier to determine which urlscheme applies to the app. Where multiple apps declare support for the same URL scheme, which one will be launched is not defined.

like image 146
Paulw11 Avatar answered Mar 07 '26 11:03

Paulw11