# App Delivery

{% hint style="info" %}
Below section is tutorial for the Pro version, the release the stand alone app for Expo version is quite simple, please refer to the document from Expo ([Android](https://docs.expo.io/versions/latest/sdk/google#deploying-to-a-standalone-app-on-android) and [iOS](https://docs.expo.io/versions/latest/sdk/google#deploying-to-a-standalone-app-on-ios))
{% endhint %}

## 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.&#x20;

#### 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.&#x20;

{% hint style="info" %}
For more details, take a look at APP [Distribution Guide from Apple](https://help.apple.com/xcode/mac/current/#/dev91fe7130a).

And: <https://facebook.github.io/react-native/docs/running-on-device.html#building-your-app-for-production>
{% endhint %}

## Change Android package name&#x20;

{% hint style="warning" %}
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.
{% endhint %}

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.beonews` to you own package.

```
android_build_config(
...
package = 'com.beonews',
)
android_resource(
...
package = 'com.beonews',
)
```

2\. Open `android/app/src/main/java/com/beonews/MainActivity.java` and change `com.beonews` to your own package.

3\. Open `android/app/src/main/AndroidManifest.xml` change `com.beonews` to your own package

4\. Open `android/app/build.gradle` change `com.beonews` to your own package

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

{% hint style="danger" %}
Remember to delete previous empty folder.
{% endhint %}

## 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.

{% hint style="danger" %}
Remember to keep your keystore file private and never commit it to version control.
{% endhint %}

### 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)

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

{% hint style="info" %}
For more details, take a look at [Generating Signed APK](https://facebook.github.io/react-native/docs/signed-apk-android#docsNav) from React Native.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://inspireui.gitbook.io/beonews/advance-customize/app-delivery.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
