Reputation: 108
I have an app for iOS and Android that I am upgrading from PhoneGap 2.x to Cordova 4.0.
As the iOS and Android apps were created using PhoneGap 2.x I have two separate projects (i.e. a project for iOS and a project for Android). These projects have a shared www directory (using symbolic links) for the HTML/CSS/JavaScript assets. When I upgrade to Cordova 4.0 I can have a single Cordova project and use the Cordova CLI to create projects for each platform in the platforms directory.
The package name that is used to for each platform in Cordova is set in shared a config.xml file though. The Cordova CLI uses the package name set in the config.xml for the perpare, build and add platform commands.
Unfortunately the package names that were used for the PhoneGap 2.x apps are not the same (i.e. the package name for the Android app is different to the package name of the iOS app).
For example: the Android app has a package name like com.example.applongname but the iOS app has a package name like com.example.AppShortName. The beginning of the package name (i.e. reverse company domain name) is the same for each app but the application names differ. The iOS application name also contains capital letters.
I need to keep the package names that were used for the initial PhoneGap 2.x builds so that the apps can be updated (i.e the end users can receive an update that will replace their existing install of my app).
How I can set the package name per platform without creating two separate projects?
Upvotes: 6
Views: 2469
Reputation: 8301
Write widget this way:
<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">
see my other answer for more details.
Upvotes: 9