Skip to content

No option to have different app identifiers for iOS and Android and livesync working #3040

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
KristianDD opened this issue Aug 4, 2017 · 3 comments
Assignees
Labels

Comments

@KristianDD
Copy link
Contributor

KristianDD commented Aug 4, 2017

Please, provide the details below:

Tell us about the problem

Currently livesync woks with the application identifier specified inside "package.json". In order to have different application identifiers for iOS and Android currently, the user has to edit the "applicationId" key inside "app.gradle" file. This change will cause the livesync functionality to not work properly.

A solution could be to add the option for "id" key inside "package.json" to have values for iOS and Andoid. Something like:

"nativescript": {
    "id": {
        "ios": "{{appID1}}" ,
        "android": "{{appID2}}"
    }
  }

Which platform(s) does your issue occur on?

iOS/Android/Both

Please provide the following version numbers that your issue occurs with:

  • CLI: 3.0.1
  • Runtime(s): 3.0.0
  • Plugin(s): 3.0.0

Please tell us how to recreate the issue in as much detail as possible.

Change the application Id in /App_Resources/android/app.gradle

android {
defaultConfig {
generatedDensities = []
applicationId = "{{appID1}}"

Change the application Id in package.json to something different.

"nativescript": {
"id": "{{appID2}}",

Solution

  1. Set in package.json
"nativescript": {
    "id": {
        "ios": "{{appID1}}" ,
        "android": "{{appID2}}"
    }
  }
  1. If you are using old project, remove the applicationId key from {AppResources}/Android/app.gradle
  2. If you have opened the the project in NS Sidekick remove the {AppResources}/Android/settings.json file
  3. Run the build
@KristianDD KristianDD self-assigned this Aug 4, 2017
@KristianDD
Copy link
Contributor Author

Related to #2825

@fpaaske
Copy link

fpaaske commented May 2, 2018

Is it possible to also make this available during a build step? I have a case where the same app will be built and deployed for multiple customers on their Apple and Google accounts, so they all need a unique app id. If we change this in the files (package.json for iOS and app.gradle + shortcuts.xml for Android) as part of the build process, the release build will have uncommitted changes and be "dirty".

For example tns ... --appId=com.company.AppName

@Gamadril
Copy link

Gamadril commented Dec 7, 2018

"nativescript": {
    "id": {
        "ios": "{{appID1}}" ,
        "android": "{{appID2}}"
    }
  }

This really useful feature should be documented in https://docs.nativescript.org/core-concepts/project-structure
It really helps if you must have "-" in your iOS app ID, but are not allowed to use it in android app ID...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants