11

I have an app in Google Play with package com.example001.androidand one app in the iOS store with the name com.example001.ios.

However, I am now using the phonegap build, have removed a lot of the bootstrap code, leaving only the www folder, I am using the widget id from config.xml, so now I only have 1 config.xml.

If I set the widget id to com.example001.ios I can't publish this app in android. If I leave the widget id to com.example001.android I can't publish this app in apple store.

If I change the widget ID to a generic one, say com.example001.mobile, then I won't be able to upload the app to Google Play because the package name changes.

How do I set the package name/ID for each target platform?

filype
  • 8,034
  • 10
  • 40
  • 66

2 Answers2

27

Try this:

<widget id="com.company.app" android-packageName="com.company.androidapp" ios-CFBundleIdentifier="com.company.iosapp" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

P.S. android-packageName & ios-CFBundleIdentifier property are not properly documented but its works tested on latest(4.1.2) cordova.

Aks
  • 8,181
  • 5
  • 37
  • 38
  • 1
    Thanks Aks! I have been looking all over for those properties but they are not found in the cordova docs. – Charles Jan 01 '15 at 19:44
  • 1
    @Charles have you tested it on pgbuild? i use cli 5.x with pgbuild and if i search in apk and ipa there is only the package com.company.app in the manifest files, no com.company.ios or com.company.android what is set in the widget tag. phonegap by itself says that they do not support different id's for differend os – mtizziani Feb 13 '17 at 16:19
0

I would create two projects and have them share a www folder.

Here is an example for local CLI builds:

/MyProject_base
  /iOS
    /www -> /MyProject_base/www
  /Android
    /www -> /MyProject_base/www
  /www

The iOS and Android folders will each have a separate full project in them with the www as a symlink to the base www.

This way you can customize each project in regards to settings and keep one www folder between the two.

Here is an example for PGBuild:

/MyProject_base
  /iOS
     /www -> /MyProject_base/www
     /config.xml
  /Android
     /www -> /MyProject_base/www
     /config.xml
  /www

Create two separate config.xml use one www folder. You will have to upload each version separate and it will be two separate apps in PGBuild, but this will allow sharing one www with two different app namespaces.

Dawson Loudon
  • 6,029
  • 2
  • 27
  • 31