3

How do I register the different Bundle Identifier for iOS(different than identifier specified in id attribute) in config.xml in Cordova 6.3 powered with MobileFirst V8.0.

I have my config.xml defined as below:

<widget android-versionCode="10" id="com.example.androidpackage" ios-CFBundleIdentifier="com.example.iospackage" ios-CFBundleVersion="1.5" version="3.7" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:mfp="http://www.ibm.com/mobilefirst/cordova-plugin-mfp">

If I add the platform using the widget above, i am getting the iOS project with bundle identifier as "com.example.iospackage" but when I am registering the app after doing cordova prepare using mfpdev app register command, then it is getting registered with "com.example.androidpackage" for both Android and iOS platform. How do I do it in MobileFirst Platform V8.0?

Prerak Tiwari
  • 3,436
  • 4
  • 34
  • 64

2 Answers2

11

You can update the config.xml file with a unique identifier per required platform, as mentioned here: In Cordova, how can I specify different package names for ios and android?

For example:

<widget
    android-packageName="com.example.android"
    ios-CFBundleIdentifier="com.example.ios">
Community
  • 1
  • 1
Idan Adar
  • 44,156
  • 13
  • 50
  • 89
  • I already have my app live on Google play and Apple app store and I am in process of migrating my apps from MFP 7.1 to 8.0...Earlier version of MFP have supported this through application-description.xml file...In my case I won't be able to keep it same. – Prerak Tiwari Aug 30 '16 at 03:49
  • Yes yes...I have tried that too..but when I register the app on the MFP console it is getting registered with the identifier specified in the id attribute. – Prerak Tiwari Aug 30 '16 at 04:06
  • Also..if I don't specify the id attribute and tries to register the app then mfp asks me to enter the value of id. – Prerak Tiwari Aug 30 '16 at 04:07
  • The apps will be grouped. What is the problem with that in the console? In the app stores they are still separate entities. – Idan Adar Aug 30 '16 at 04:11
  • The problem is that if I change the identifier then I won't be able to publish the app on the app store. – Prerak Tiwari Aug 30 '16 at 04:15
  • Then create two distinct Cordova apps. One for iOS and another for Android, instead of adding the two platforms to the same Cordova app. – Idan Adar Aug 30 '16 at 04:35
  • 1
    That doesn't seems like a solution to me. Plus it does not make any sense to create 2 apps with same web resource. I think it's the product bug since this was supported by MFP till last release and it is also supported by Cordova. Its the MFP that is restricting users to do so. – Prerak Tiwari Aug 30 '16 at 04:46
  • 1
    PMR 79746 442 000 has been logged for this. L3 guys are looking into it. As per them fix will be delivered soon. – Prerak Tiwari Sep 08 '16 at 19:46
0

This has been fixed in the updated CLI. Details can be found here

Changelog:

  • Fix to allow a different application identifier per platform in a Cordova project
Prerak Tiwari
  • 3,436
  • 4
  • 34
  • 64