Change Widget ID or Package Name for android/iOS platform on phonegap?

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?

Answers


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.


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.


Need Your Help

Android Place Picker closes immediately after launch

android google-places-api

I am developing an android application as part of a project, and am using Google places API to display places of interest based on location. I am using the PlacePicker Inentbuilder to accomplish th...

Installed Java 7 on Mac OS X but Terminal is still using version 6

java macos java-7

I've installed JDK 7u7 downloaded from oracle's website. But after installation, the terminal is still showing java version 6