wiiwilleat
wiiwilleat

Reputation: 209

Separate package names for iOS and Android

I currently have a native app published to the App Store and Google Play and both have different package names. I was wanting to know if there is there a way to tell NativeScript to use a one package name for iOS and a different one for Android? Thank you.

Upvotes: 2

Views: 701

Answers (2)

Macarthurval
Macarthurval

Reputation: 178

For those looking for a solution in 2021, there is an easy way to set it up.

Open your nativescript.config.ts and add different id properties inside android and ios:

import { NativeScriptConfig } from '@nativescript/core';

export default {
  appPath: 'src',
  appResourcesPath: 'App_Resources',
  android: {
    v8Flags: '--expose_gc',
    markingMode: 'none',
    id: 'com.yourapp.android'
  },
  ios: {
    id: 'com.yourapp.ios'
  }
} as NativeScriptConfig;

Upvotes: 1

TJ VanToll
TJ VanToll

Reputation: 12704

Yep, you can absolutely do that. For iOS, include a CFBundleIdentifier flag in your app/App_Resources/iOS/Info.plist file.

<key>CFBundleIdentifier</key>
<string>com.mycompany.myapp</string>

And for Android, update the android.defaultConfig.applicationId in your app/App_Resources/Android/app.gradle file. See https://github.com/NativeScript/template-hello-world/blob/90b81bcb772ab21a06f06bd502be2043e6afc9ee/App_Resources/Android/app.gradle#L11.

Upvotes: 4

Related Questions