Delivery app

Last updated 5 months ago

This section is related to the customize package name and delivery your app

Change iOS bundle ID

For iOS apps, ensure that every bundle ID is unique within your app bundle. For example, if your app bundle includes a helper app, ensure that its bundle ID is different from your app’s bundle ID.

Follow these steps to change the bundle ID prefix in the General pane in the project editor.

To set the bundle ID prefix

In the project navigator, select the project and your target to display the project editor. Click General and, if necessary, click the disclosure triangle next to Identity to reveal the settings. Enter the bundle ID prefix in the “Bundle Identifier” field.

To set the bundle ID

In the project navigator, select the project and your target to display the project editor. Click Info. Enter the bundle ID in the Value column of the “Bundle identifier” row.

Change Android package name

The application might not function properly until all services are re-config according to new project package name. Making a new branch is strongly recommend.

Change package name for Android require you to edit old package name to new one in various place, then manually make a new folder structure according to your new package name and move data into the new folder.

  1. Open /android/app/BUCK change com.inspireui.mstore to you own package.

android_build_config(
...
package = 'com.inspireui.mstore',
)
android_resource(
...
package = 'com.inspireui.mstore',
)

2. Open android/app/src/main/java/com/inspireui/mstore/MainActivity.java and change com.inspireui.mstore to your own package.

3. Open android/app/src/main/AndroidManifest.xml change com.inspireui.mstore to your own package

4. Open android/app/build.gradle change com.inspireui.mstore to your own package

5. Move all file inside older folder android/app/src/main/java/com/inspireui/mstore to the new one, example: android/app/src/main/java/com/your-package/app-name

Remember to delete previous empty folder.

Change Android project keystore

Generating a signing key

You can generate a private signing key using keytool. On Windows keytool must be run from C:\Program Files\Java\jdkx.x.x_x\bin

$ keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000

This command prompts you for passwords for the keystore and key, and to provide the Distinguished Name fields for your key. It then generates the keystore as a file called my-release-key.keystore.

The keystore contains a single key, valid for 10000 days. The alias is a name that you will use later when signing your app, so remember to take note of the alias.

Remember to keep your keystore file private and never commit it to version control.

Setting up gradle variables

Place the my-release-key.keystore file under the /android/app directory in your project folder.

Edit the file /android/gradle.properties and add the following (replace * with the correct keystore password, alias and key password)

MYAPP_RELEASE_STORE_FILE=my-release-key.keystore
MYAPP_RELEASE_KEY_ALIAS=my-key-alias
MYAPP_RELEASE_STORE_PASSWORD=*****
MYAPP_RELEASE_KEY_PASSWORD=*****

For more details, take a look at Generating Signed APK from React Native.