Skip to content

Commit

Permalink
chore: Cleanup mobile app guides (#418)
Browse files Browse the repository at this point in the history
Co-authored-by: Vishnu Narayanan <vishnu@chatwoot.com>
  • Loading branch information
muhsin-k and vishnu-narayanan committed Jun 15, 2023
1 parent 65f9b66 commit 117eac7
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 84 deletions.
40 changes: 13 additions & 27 deletions docs/contributing-guide/mobile-app/custom-release-guide.md
Expand Up @@ -3,12 +3,19 @@ sidebar_label: "Custom Release Guide"
title: "Custom release guide for mobile app"
---

## Deep linking
### Setup Firebase for push notification

### Android
- Create a new project in [firebase console](https://console.firebase.google.com/).
- Generate [android credentials](https://rnfirebase.io/#generating-android-credentials) from firebase console. Then download the `google-services.json` file and place it inside of your project at the following location: `android/app/`.
- Generate [iOS credentials](https://rnfirebase.io/#generating-ios-credentials) from firebase console. Then download the `GoogleService-Info.plist` file . Then add this file to project using `Xcode`. More details can be found [here](https://rnfirebase.io/#3-ios-setup).

Open `AndroidManifest.xml` file under `android/app/src/main/` folder.
- Add the `FCM_SERVER_KEY` in the chatwoot environment variables. You can find your FCM_SERVER_KEY in your firebase settings (Project Settings > Cloud Messaging > Project Credentials > Server Key).

### Deep linking

#### Android

Open `AndroidManifest.xml` file under `android/app/src/main/` folder.

Replace `android:host` with your installation url

Expand All @@ -31,35 +38,14 @@ adb shell am start -W -a android.intent.action.VIEW -d "https://app.chatwoot.com
```

### iOS
#### iOS

Set `IOS_APP_ID` in chatwoot server

Open `Chatwoot.entitlements` file under `ios/` folder.

Replace `*.chatwoot.com` with your installation url

## Deployment

Detailed guide for [Publishing a React Native App to the App Store](https://www.reactnativeschool.com/publishing-react-native-app/)

### Android

In order to distribute your Android application via Google Play store it needs to be signed with a release key that then needs to be used for all future updates. More details can be found [here](https://reactnative.dev/docs/signed-apk-android)

Update `gradle.properties` file under `android/app` folder with following contents

```
android.useAndroidX=true
android.enableJetifier=true
FLIPPER_VERSION=0.33.1
org.gradle.jvmargs=-Xmx4608m
RELEASE_STORE_FILE=<RELEASE_STORE_FILE>
RELEASE_KEY_ALIAS=<RELEASE_KEY_ALIAS>
RELEASE_STORE_PASSWORD=<RELEASE_STORE_PASSWORD>
RELEASE_KEY_PASSWORD=<RELEASE_KEY_PASSWORD>
```

For releasing the android follow the [guide](https://reactnative.dev/docs/signed-apk-android)
### Deployment

- Important - We are using [Fastlane](https://docs.fastlane.tools/getting-started/cross-platform/react-native/) for deploying chatwoot official mobile app.
In order to successfully upload your app to the [Playstore](https://reactnative.dev/docs/signed-apk-android) and [Appstore](https://reactnative.dev/docs/publishing-to-app-store), it is important to follow the official guide closely. You must ensure that you have completed all the necessary steps, including creating a signed APK for Android and publishing to the App Store for iOS. It is also important to make sure that your app meets all the requirements and guidelines set forth by the app stores, such as having appropriate content and adhering to their policies and regulations.
76 changes: 19 additions & 57 deletions docs/contributing-guide/mobile-app/setup-guide.md
Expand Up @@ -7,10 +7,10 @@ title: "Setup guide for mobile app"
- [Prerequisites](#prerequisites)
- [Environment Variables](#environment-variables)
- [Setup firebase for push notification](#setup-firebase-for-push-notification)
- [Setup Sentry for error reporting](#setup-sentry-for-error-reporting)
- [Setup Sentry for error reporting](#setup-sentry-for-error-reporting)
- [Running](#running)
- [iOS](#ios) - **Mac is required if you wish to develop for iOS.**
- [Android](#android)
- [iOS](#ios) - **Mac is required if you wish to develop for iOS.**
- [Android](#android)
- [Configure and run tests](#configure-and-run-tests)

## Installation and setup
Expand All @@ -20,36 +20,38 @@ title: "Setup guide for mobile app"
- [Node.js](https://nodejs.org/en/download/)
- [Watchman](https://facebook.github.io/watchman/docs/install.html)
- [Yarn](https://yarnpkg.com/en/docs/install)
- React Native CLI - Use `$ yarn global add react-native-cli` to install the CLI.

More information on getting started can be found [here](https://reactnative.dev/docs/environment-setup)
To learn more about the most up-to-date instructions, please refer to the guide available [here](https://reactnative.dev/docs/environment-setup?guide=native).

Clone the repository
#### Clone the repository

`$ git clone git@github.com:chatwoot/chatwoot-mobile-app.git`

And install dependencies
#### Install dependencies

`$ yarn`

### Environment Variables

Create `.env` file under root folder


```
SENTRY_DSN=
CHATWOOT_WEBSITE_TOKEN=
CHATWOOT_BASE_URL=
POSTHOG_API_KEY=
POSTHOG_API_HOST=
MINIMUM_CHATWOOT_VERSION=1.15.0
CHATWOOT_BASE_URL=https://app.chatwoot.com
JUNE_SDK_KEY=
MINIMUM_CHATWOOT_VERSION=2.16.0
```
### Setup firebase for push notification

- Create a new project in [firebase console](https://console.firebase.google.com/).
- Generate [android credentials](https://rnfirebase.io/#generating-android-credentials) from firebase console. Then download the `google-services.json` file and place it inside of your project at the following location: `android/app/`.
- Generate [iOS credentials](https://rnfirebase.io/#generating-ios-credentials) from firebase console. Then download the `GoogleService-Info.plist` file . Then add this file to project using `Xcode`. More details can be found [here](https://rnfirebase.io/#3-ios-setup).
- CHATWOOT_WEBSITE_TOKEN: Web widget token. Add this token only if you want to add in app support.
- CHATWOOT_BASE_URL: Replace with your self-hosted installation url.
- SENTRY_DSN: Sentry DSN URL.
- JUNE_SDK_KEY: June SDK key. We use June for analytics.
- MINIMUM_CHATWOOT_VERSION: Minimum supported Chatwoot version.

### Push notification

If you are using the community edition of Chatwoot, you would now be able use the [Official mobile app](https://www.chatwoot.com/mobile-apps) with push notifications without any additional configuration.

### Setup Sentry for error reporting

Expand All @@ -64,8 +66,6 @@ yarn sentry-wizard -i reactNative -p ios android
cd ios && pod install
```



## Running

### iOS
Expand All @@ -80,45 +80,7 @@ Open `Chatwoot.xcworkspace` file under `ios` folder. Choose your target device a

### Android

- Create `gradle.properties` file with following contents under `android/` folder

```
android.useAndroidX=true
android.enableJetifier=true
FLIPPER_VERSION=0.54.0
org.gradle.jvmargs=-Xmx4608m
```

- `yarn android`

## Configure and run tests

Add a new brew formula

```
brew tap wix/brew
```

Install simulators

```
brew install wix/applesimutils
```

Build application:

```
detox build --configuration ios
```

Run tests:

```
detox test --configuration ios --loglevel trace
```

Manage simulators:

```
/usr/bin/xcrun simctl list
```
If you face any issues while setting up, please post on our [GitHub](https://github.com/chatwoot/chatwoot) or on our developer forum at [Discord](https://discord.gg/cJXdrwS). Someone from the team will definitely help you.

0 comments on commit 117eac7

Please sign in to comment.