Christopher Johnson
Christopher Johnson

Reputation: 695

Can my phonegap 3 app use a different package name in android vs IOS?

I would like my Phonegap application to use a common codebase but get deployed to the Google play store and the itunes store with different package names. Let's say I want my android app to have a different package name than the default configuration. I could make changes in the /platform/android folder but they will get squashed every time I run 'cordova prepare android'.

Do the Phonegap tools support this in a way I can't find in the docs or do I need to find a different way to solve this problem?

Upvotes: 1

Views: 425

Answers (2)

Dawson Loudon
Dawson Loudon

Reputation: 6029

You could create two different cordova projects, adding one platform to each and then have a common www folder that each is linked to. Maybe put the the www folder into a Git (or svn) repo and check it out in both of your projects.

That way you have a common core but separate projects with separate namespaces.

Upvotes: 1

QuickFix
QuickFix

Reputation: 11721

I don't think there are settings for that but you should be able do it but with a little gymnastic...

  • create the project with the namespace you want for ios
  • add ios platform
  • modify the namespace in the config.xml file
  • add the android platform

And then you will have to modify config.xml with the matching namespace before you run any cli command for a given platform.

Or maybe there is a way with cordova hooks to automate this?

Upvotes: 0

Related Questions