2
votes

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

2

2 Answers

2
votes

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.

0
votes

You can select project> build setting press '+' and add a new User-Define Setting. we named it some_var for this example. you can simply change the value of that for your different build configurations.

enter image description here

you can put the some_var value anywhere in info.plist file as ${some_var}

enter image description here