Cordoba: How to install different package names on the platform using cordova-cli?

I have an app for iOS and Android that I upgrade from PhoneGap 2.x to Cordova 4.0.

Since the iOS and Android applications were created using PhoneGap 2.x, I have two separate projects (i.e. a project for iOS and a project for Android). These projects share a www directory (using symbolic links) for HTML / CSS / JavaScript assets. When I upgrade to Cordova 4.0, I can have one Cordova project and use the Cordova CLI to create projects for each platform in the platforms directory.

The package name that is used for each platform in Cordoba is set in the common config.xml file. The Cordova CLI uses the package name set in the config.xml file for the perpare, build and add platform commands.

Unfortunately, the package names that were used for PhoneGap 2.x applications do not match (for example, the package name for the Android application is different from the name of the iOS application package).

For example: an Android application has a package name, for example com.example.applongname, but an iOS application has a package name, for example com.example.AppShortName. The start of the package name (i.e. the domain name of the return company) is the same for each application, but the application names are different. The iOS app name also contains uppercase letters.

I need to save the package names that were used for the initial build of PhoneGap 2.x so that the applications can be updated (that is, end users can receive an update that will replace their existing installation of my application).

How can I install a package name on a platform without creating two separate projects?

+5
source share
1 answer

Write the widget like 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"> 

see my other answer for more details.

+8
source

Source: https://habr.com/ru/post/1207793/


All Articles