snapshot of https://github.com/mattermost/mattermost.git (master, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Server CI / Postgres (shard 0) (push) Has been skipped
Server CI / Postgres (shard 3) (push) Has been skipped
BuildEnv Docker Image / build-image (push) Failing after 4s
BuildEnv Docker Image / build-image-fips (push) Failing after 4s
Migration Review & Release Notes / Generate migration review & release notes (push) Failing after 3s
Server CI / Build Environment (push) Failing after 3s
Server CI / Postgres (shard 1) (push) Has been skipped
Tools CI / check-style (mattermost-govet) (push) Failing after 4s
Server CI / Postgres (shard 2) (push) Has been skipped
Tools CI / check-style (mmgotool) (push) Failing after 3s
Server CI / Elasticsearch v8 Compatibility (push) Has been skipped
Server CI / OpenSearch v2 Compatibility (push) Has been skipped
Server CI / Postgres FIPS (shard 0) (push) Has been skipped
Tools CI / Test (mattermost-govet) (push) Failing after 3s
Server CI / Postgres FIPS (shard 1) (push) Has been skipped
Server CI / Postgres FIPS (shard 2) (push) Has been skipped
Tools CI / Test (mmgotool) (push) Failing after 3s
Server CI / Postgres FIPS (shard 3) (push) Has been skipped
Server CI / Run mmctl tests (push) Has been skipped
Server CI / Run mmctl tests (FIPS) (push) Has been skipped
Server CI / Merge Postgres Test Results (push) Has been skipped
Server CI / Merge Postgres FIPS Test Results (push) Has been skipped
Server CI / Check backport migrations (push) Has been skipped
Server CI / Check generated files (push) Has been skipped
Server CI / check-style (push) Has been skipped
Server CI / Vet API (push) Has been skipped
Server CI / Build mattermost server app (push) Has been skipped
Server CI / Server CI Complete (push) Failing after 2s
Server CI / Server CI Artifacts (push) Has been skipped
Server CI / Sentry Upload (push) Has been skipped
Server CI / Server CI Report (push) Failing after 5m1s
Server CI Nightly Race / Race Detector (push) Has been skipped
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Webapp CI Cache Warm / Warm Webapp node_modules Cache (push) Has been cancelled
E2E CI Cache Warm / Warm E2E npm Registry Cache (push) Has been cancelled
API / build (push) Has been cancelled
Web App CI / check-types (push) Has been cancelled
Web App CI / check-lint (push) Has been cancelled
Web App CI / check-i18n (push) Has been cancelled
Web App CI / check-external-links (push) Has been cancelled
Web App CI / test (platform) (push) Has been cancelled
Web App CI / test (mattermost-redux) (push) Has been cancelled
Web App CI / test (channels shard 1/4) (push) Has been cancelled
Web App CI / test (channels shard 2/4) (push) Has been cancelled
Web App CI / test (channels shard 3/4) (push) Has been cancelled
Web App CI / test (channels shard 4/4) (push) Has been cancelled
Web App CI / upload-coverage (push) Has been cancelled
Web App CI / build (push) Has been cancelled
YAML Lint / yamllint (push) Has been cancelled
Push mirrored docker images / cd/Push mirrored docker images (push) Has been cancelled
docs-cd / Build and deploy docs (push) Has been cancelled
Docs CI / build (push) Has been cancelled
E2E Cache Warm: Cypress deps / Warm Cypress deps cache (push) Has been cancelled
Scorecards supply-chain security / Scorecard analysis (push) Has been cancelled
Server CI Weekly / Postgres FIPS (push) Has been skipped
Server CI Weekly / Run mmctl tests (FIPS) (push) Has been skipped
Server CI Weekly / Postgres with binary parameters (push) Has been skipped
Server CI Weekly / Build Environment (push) Failing after 1s
Server CI Cache Warm / Warm Go Module and Build Cache (push) Failing after 2s
Server CI Nightly Race / Build Environment (push) Failing after 1s
Some checks failed
Server CI / Postgres (shard 0) (push) Has been skipped
Server CI / Postgres (shard 3) (push) Has been skipped
BuildEnv Docker Image / build-image (push) Failing after 4s
BuildEnv Docker Image / build-image-fips (push) Failing after 4s
Migration Review & Release Notes / Generate migration review & release notes (push) Failing after 3s
Server CI / Build Environment (push) Failing after 3s
Server CI / Postgres (shard 1) (push) Has been skipped
Tools CI / check-style (mattermost-govet) (push) Failing after 4s
Server CI / Postgres (shard 2) (push) Has been skipped
Tools CI / check-style (mmgotool) (push) Failing after 3s
Server CI / Elasticsearch v8 Compatibility (push) Has been skipped
Server CI / OpenSearch v2 Compatibility (push) Has been skipped
Server CI / Postgres FIPS (shard 0) (push) Has been skipped
Tools CI / Test (mattermost-govet) (push) Failing after 3s
Server CI / Postgres FIPS (shard 1) (push) Has been skipped
Server CI / Postgres FIPS (shard 2) (push) Has been skipped
Tools CI / Test (mmgotool) (push) Failing after 3s
Server CI / Postgres FIPS (shard 3) (push) Has been skipped
Server CI / Run mmctl tests (push) Has been skipped
Server CI / Run mmctl tests (FIPS) (push) Has been skipped
Server CI / Merge Postgres Test Results (push) Has been skipped
Server CI / Merge Postgres FIPS Test Results (push) Has been skipped
Server CI / Check backport migrations (push) Has been skipped
Server CI / Check generated files (push) Has been skipped
Server CI / check-style (push) Has been skipped
Server CI / Vet API (push) Has been skipped
Server CI / Build mattermost server app (push) Has been skipped
Server CI / Server CI Complete (push) Failing after 2s
Server CI / Server CI Artifacts (push) Has been skipped
Server CI / Sentry Upload (push) Has been skipped
Server CI / Server CI Report (push) Failing after 5m1s
Server CI Nightly Race / Race Detector (push) Has been skipped
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Webapp CI Cache Warm / Warm Webapp node_modules Cache (push) Has been cancelled
E2E CI Cache Warm / Warm E2E npm Registry Cache (push) Has been cancelled
API / build (push) Has been cancelled
Web App CI / check-types (push) Has been cancelled
Web App CI / check-lint (push) Has been cancelled
Web App CI / check-i18n (push) Has been cancelled
Web App CI / check-external-links (push) Has been cancelled
Web App CI / test (platform) (push) Has been cancelled
Web App CI / test (mattermost-redux) (push) Has been cancelled
Web App CI / test (channels shard 1/4) (push) Has been cancelled
Web App CI / test (channels shard 2/4) (push) Has been cancelled
Web App CI / test (channels shard 3/4) (push) Has been cancelled
Web App CI / test (channels shard 4/4) (push) Has been cancelled
Web App CI / upload-coverage (push) Has been cancelled
Web App CI / build (push) Has been cancelled
YAML Lint / yamllint (push) Has been cancelled
Push mirrored docker images / cd/Push mirrored docker images (push) Has been cancelled
docs-cd / Build and deploy docs (push) Has been cancelled
Docs CI / build (push) Has been cancelled
E2E Cache Warm: Cypress deps / Warm Cypress deps cache (push) Has been cancelled
Scorecards supply-chain security / Scorecard analysis (push) Has been cancelled
Server CI Weekly / Postgres FIPS (push) Has been skipped
Server CI Weekly / Run mmctl tests (FIPS) (push) Has been skipped
Server CI Weekly / Postgres with binary parameters (push) Has been skipped
Server CI Weekly / Build Environment (push) Failing after 1s
Server CI Cache Warm / Warm Go Module and Build Cache (push) Failing after 2s
Server CI Nightly Race / Build Environment (push) Failing after 1s
This commit is contained in:
@@ -0,0 +1,136 @@
|
||||
---
|
||||
title: "Build the Android mobile app"
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
At times, you may want to build your own Mattermost mobile app. The most common use cases are:
|
||||
|
||||
* To white label the Mattermost mobile app.
|
||||
* To use your own deployment of the Mattermost Push Notification Service (always required if you are building your own version of the mobile app).
|
||||
|
||||
# Build preparations
|
||||
|
||||
### 1. Package name and source files
|
||||
|
||||
* Ensure the package ID of the mobile app remains the same as the one in the original [mattermost-mobile GitHub repository](https://github.com/mattermost/mattermost-mobile) in `com.mattermost.rnbeta`.
|
||||
* Source files for the main package remain under the `android/app/src/main/java/com/mattermost/rnbeta` folder.
|
||||
|
||||
### 2. Generate a signing key
|
||||
|
||||
As Android requires all apps to be digitally signed with a certificate before they can be installed building the Android app for distribution requires the release APK to be signed.
|
||||
|
||||
To generate the signed key, use **keytool** which comes with the JDK required to develop the Android app. (see [Developer Setup](/developers/contribute/more-info/mobile/developer-setup#additional-setup-for-android)).
|
||||
|
||||
```sh
|
||||
$ keytool -genkey -v -keystore <my-release-key>.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000
|
||||
```
|
||||
|
||||
The above command prompts you for passwords for the keystore and key (make sure you use the same password for both), and asks you 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 a note of the alias.
|
||||
|
||||
---
|
||||
|
||||
<Note title="Note">
|
||||
* Replace `<my-release-key>` with the filename you want to specify.
|
||||
* Remember to keep your keystore file private and never commit it to version control.
|
||||
</Note>
|
||||
|
||||
|
||||
---
|
||||
|
||||
### 3. Create a new app in Google Play
|
||||
|
||||
Create a new application using the [Google Play console](https://play.google.com/console/developers). If you already have an app registered in the Google Play console you can skip this step.
|
||||
|
||||
### 4. Set up Gradle variables
|
||||
Now that we have created the keystore file we can tell the build process to use that file:
|
||||
|
||||
- Copy or move the `my-release-key.keystore` file under a directory that you can access. It can be in your home directory or anywhere in the file system.
|
||||
- Edit the `gradle.properties` file in your `$HOME` directory (e.g. `$HOME/.gradle/gradle.properties`), or create it if one does not exist, and add the following:
|
||||
|
||||
```sh
|
||||
MATTERMOST_RELEASE_STORE_FILE=/full/path/to/directory/containing/my-release-key.keystore
|
||||
MATTERMOST_RELEASE_KEY_ALIAS=my-key-alias
|
||||
MATTERMOST_RELEASE_PASSWORD=*****
|
||||
```
|
||||
---
|
||||
|
||||
<Note title="Note">
|
||||
* Replace `/full/path/to/directory/containing/my-release-key.keystore` with the full path to the actual keystore file and `********` with the actual keystore password.
|
||||
* Back up your keystore and don't forget the password.
|
||||
</Note>
|
||||
|
||||
|
||||
---
|
||||
---
|
||||
**Important:**
|
||||
|
||||
Once you publish the app on the Play Store, the app needs to be signed with the same key every time you want to distribute a new build. If you lose this key, you will need to republish your app under a different package id (losing all downloads and ratings).
|
||||
|
||||
---
|
||||
|
||||
### 5. Configure environment variables
|
||||
|
||||
To make it easier to customize your build, we've defined a few environment variables that are going to be used by Fastlane during the build process.
|
||||
|
||||
| Variable | Description | Default | Required |
|
||||
|----------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------|----------|
|
||||
| `COMMIT_CHANGES_TO_GIT` | Should the Fastlane script ensure that there are no changes to Git before building the app and that every change made during the build is committed back to Git. <br/><br/>Valid values are: `true`, `false` | `false` | No |
|
||||
| `BRANCH_TO_BUILD` | Defines the Git branch that is going to be used for generating the build. <br/><br/>**Make sure that, if this value is set, the branch it is set to exists**. | `$GIT_BRANCH` | No |
|
||||
| `GIT_LOCAL_BRANCH` | Defines the local branch to be created from `BRANCH_TO_BUILD` to ensure the base branch does not get any new commits on it. <br/><br/>**Make sure a branch with this name does not yet exist in your local Git repository**. | build | No |
|
||||
| `RESET_GIT_BRANCH` | Defines if, once the build is done, the branch should be reset to the initial state before building and whether to also delete the branch created to build the app. <br/><br/>Valid values are: `true`, `false` | `false` | No |
|
||||
| `VERSION_NUMBER ` | Set the version of the app at build time to a specific value, rather than using the one set in the project. | | No |
|
||||
| `INCREMENT_VERSION_NUMBER_MESSAGE` | Set the commit message when changing the app version number. | Bump app version number to | No |
|
||||
| `INCREMENT_BUILD_NUMBER` | Defines if the app build number should be incremented. <br/><br/>Valid values are: `true`, `false` | `false` | No |
|
||||
| `BUILD_NUMBER` | Set the build number of the app at build time to a specific value, rather than incrementing the last build number. | | No |
|
||||
| `INCREMENT_BUILD_NUMBER_MESSAGE` | Set the commit message when changing the app build number. | Bump app build number to | No |
|
||||
| `ANDROID_BUILD_TASK` | The build tasks for Android. This is a comma-separated list of tasks that can have two values: 'assemble' and 'bundle'. <br/><br/>`assemble` is used for building `APK` file and `bundle` is used for building `AAB` file. | assemble | No |
|
||||
| `APP_NAME` | The name of the app as it is going to be shown on the device home screen. | Mattermost Beta | Yes |
|
||||
| `APP_SCHEME` | The URL naming scheme for the app as used in direct deep links to app content from outside the app. | mattermost | No |
|
||||
| `REPLACE_ASSETS` | Override the assets as described in [White Labeling](/developers/contribute/more-info/mobile/build-your-own/white-label). <br/><br/>Valid values are: `true`, `false` | `false` | No |
|
||||
| `MAIN_APP_IDENTIFIER` | The package identifier for the app. | | Yes |
|
||||
| `BUILD_FOR_RELEASE` | Defines if the app should be built in release mode. <br/><br/>Valid values are: `true`, `false` <br/><br/>**Make sure you set this value to true if you plan to submit this app Google Play or distribute it in any other way**. | `false` | Yes |
|
||||
| `SEPARATE_APKS` | Build one APK per achitecture (armeabi-v7a, x86, arm64-v8a and x86_64) as well as a universal APK. The advantage is the size of the APK is reduced by about 4MB. <br/><br/>People will download the correct APK from the Play Store based on the CPU architecture of their device. | `false` | Yes |
|
||||
| `SUBMIT_ANDROID_TO_GOOGLE_PLAY` | Should the app be submitted to the Play Store once it finishes building, use along with `SUPPLY_TRACK`.<br/><br/>Valid values are: `true`, `false` | `false` | Yes |
|
||||
| `SUPPLY_TRACK` | The track of the application to use when submitting the app to Google Play Store. Valid values are: `alpha`, `beta`, `production` <br/><br/>**RIt is not recommended to submit the app to production. First try any of the other tracks and then promote your app using the Google Play console**. | `alpha` | Yes |
|
||||
| `SUPPLY_PACKAGE_NAME` | The package Id of your application, make sure it matches `MAIN_APP_IDENTIFIER`. | | Yes |
|
||||
| `SUPPLY_JSON_KEY` | The path to the service account `json` file used to authenticate with Google.<br/><br/>See the [Supply documentation]( https://docs.fastlane.tools/actions/supply/#setup) to learn more. | | Yes |
|
||||
|
||||
---
|
||||
|
||||
<Note title="Note">
|
||||
To configure your variables create the file `./mattermost-mobile/fastlane/.env` where `.env` is the filename. You can find the sample file `env_vars_example` [here](https://github.com/mattermost/mattermost-mobile/blob/master/fastlane/env_vars_example).
|
||||
</Note>
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
### 6. Google services
|
||||
|
||||
Replace the `google-services.json` file as instructed in the [Android Push Notification Guide](/developers/contribute/more-info/mobile/push-notifications/android) before you build the app.
|
||||
|
||||
## Build the mobile app
|
||||
|
||||
Once all the previous steps are done, execute the following command from within the project's directory:
|
||||
|
||||
```sh
|
||||
$ npm run build:android
|
||||
```
|
||||
|
||||
This will start the build process following the environment variables you've set. Once it finishes, it will create the `.apk` file(s) with the `APP_NAME` as the filename in the project's root directory. If you have not set Fastlane to submit the app to the Play Store, you can use this file to manually publish and distribute the app.
|
||||
|
||||
## Frequently Asked Questions
|
||||
### How do I update the lock file?
|
||||
We use lockfiles to lock dependencies and make sure the builds are reproductible. If we want to update the lockfile to update all dependencies to the latest, we can run these commands:
|
||||
```
|
||||
cd android
|
||||
./gradlew app:dependencies --update-locks "*:*"
|
||||
```
|
||||
|
||||
In case we want to regenerate the lockfile from the scratch, we can delete the `android/buildscript-gradle.lockfile` and then run the following commands:
|
||||
```
|
||||
cd android
|
||||
./gradlew app:dependencies --write-locks
|
||||
```
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
title: "Build your own mobile app"
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
You can build the app from source and distribute it within your team or company either using the App Stores, Enterprise App Stores or EMM providers, or another way of your choosing.
|
||||
|
||||
At Mattermost, we build and deploy the Apps using a CI pipeline. The pipeline has different jobs and steps that run on specific contexts based on what we want to accomplish. You can check it out [here](https://github.com/mattermost/mattermost-mobile/blob/main/.github/workflows).
|
||||
|
||||
As an alternative we've also created a set of **scripts** to help automate build tasks. Learn more about the scripts by reviewing the [package.json](https://github.com/mattermost/mattermost-mobile/blob/master/package.json) file.
|
||||
|
||||
|
||||
<Note title="Note">
|
||||
By using the **scripts**, [Fastlane](https://docs.fastlane.tools/#choose-your-installation-method) and other dependencies will be installed in your system.
|
||||
</Note>
|
||||
|
||||
|
||||
|
||||
|
||||
- [Build the Android app](/developers/contribute/more-info/mobile/build-your-own/android)
|
||||
- [Build the iOS app](/developers/contribute/more-info/mobile/build-your-own/ios)
|
||||
|
||||
### Push notifications with your own mobile app
|
||||
|
||||
When building your own Mattermost mobile app, you will also need to host the [Mattermost Push Notification Service](https://github.com/mattermost/mattermost-push-proxy) in order to receive push notifications.
|
||||
|
||||
See [Setup Push Notifications](/developers/contribute/more-info/mobile/push-notifications) for more details.
|
||||
@@ -0,0 +1,91 @@
|
||||
---
|
||||
title: "Build the iOS mobile app"
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
At times, you may want to build your own Mattermost mobile app. The most common use cases are:
|
||||
|
||||
* To white label the Mattermost mobile app.
|
||||
* To use your own deployment of the Mattermost Push Notification Service (always required if you are building your own version of the mobile app).
|
||||
|
||||
# Build preparations
|
||||
|
||||
### 1. Prerequisites
|
||||
|
||||
The Mattermost mobile app for iOS needs to be built on a macOS computer with Xcode and the Xcode command line tools installed.
|
||||
|
||||
```sh
|
||||
$ xcode-select --install
|
||||
```
|
||||
|
||||
### 2. Bundle ID and entitlements
|
||||
|
||||
* Follow the steps 1, 2, and 3 for [Run on iOS Devices](/developers/contribute/more-info/mobile/developer-setup/run#run-on-ios-devices) in the Developer Setup.
|
||||
* After configuring the app in the previous step, **ensure** the bundle ID for each target of the mobile app remains the same as the one in the original [mattermost-mobile GitHub repository](https://github.com/mattermost/mattermost-mobile) (`com.mattermost.rnbeta`, `com.mattermost.rnbeta.MattermostShare`, and `com.mattermost.rnbeta.NotificationService`).
|
||||
|
||||
### 3. Code sign
|
||||
|
||||
Apple requires all apps to be digitally signed with a certificate before they can be installed.
|
||||
|
||||
The build script will make use of [Match](https://docs.fastlane.tools/actions/match/) to sync your provisioning profiles (the profiles will be created for you if needed). The provisioning profiles will be created based on the environment variables.
|
||||
|
||||
### 4. Configure environment variables
|
||||
|
||||
To make it easier to customize your build, we've defined a few environment variables that are going to be used by Fastlane during the build process.
|
||||
|
||||
| Variable | Description | Default | Required |
|
||||
|-----------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|----------|
|
||||
| `COMMIT_CHANGES_TO_GIT` | Should the fastlane script ensure that there are no changes to Git before building the app and that every change made during the build is committed back to Git.<br/><br/>Valid values are: `true`, `false` | `false` | No |
|
||||
| `BRANCH_TO_BUILD` | Defines the Git branch that is going to be used for generating the build. <br/><br/>**Make sure that, if this value is set, the branch it is set to exists**. | `$GIT_BRANCH` | No |
|
||||
| `GIT_LOCAL_BRANCH` | Defines the local branch to be created from BRANCH\_TO\_BUILD to ensure the base branch does not get any new commits on it.<br/><br/>**Make sure a branch with this name does not yet exist in your local git**. | build | No |
|
||||
| `RESET_GIT_BRANCH` | Defines if, once the build is done, the branch should be reset to the initial state before building and whether to also delete the branch created to build the app. <br/><br/>Valid values are: `true`, `false` | `false` | No |
|
||||
| `VERSION_NUMBER` | Set the version of the app at build time to a specific value, rather than using the one set in the project. | | No |
|
||||
| `INCREMENT_VERSION_NUMBER_MESSAGE` | Set the commit message when changing the app version number. | Bump app version number to | No |
|
||||
| `INCREMENT_BUILD_NUMBER` | Defines if the app build number should be incremented.<br/><br/>Valid values are: `true`, `false` | `false` | No |
|
||||
| `BUILD_NUMBER` | Set the build number of the app at build time to a specific value, rather than incrementing the last build number. | | No |
|
||||
| `INCREMENT_BUILD_NUMBER_MESSAGE` | Set the commit message when changing the app build number. | Bump app build number to | No |
|
||||
| `APP_NAME` | The name of the app as it is going to be shown in the device home screen. | Mattermost Beta | Yes |
|
||||
| `APP_SCHEME` | The URL naming scheme for the app as used in direct deep links to app content from outside the app. | mattermost | No |
|
||||
| `REPLACE_ASSETS` | Override the assets as described in [White Labeling](/developers/contribute/more-info/mobile/build-your-own/white-label).<br/><br/>Valid values are: `true`, `false` | `false` | No |
|
||||
| `MAIN_APP_IDENTIFIER` | The bundle identifier for the app. | | Yes |
|
||||
| `BUILD_FOR_RELEASE` | Defines if the app should be built in release mode. <br/><br/>Valid values are: `true`, `false` <br/><br/>**Make sure you set this value to true if you plan to submit this app to TestFlight, the Apple App Store or distribute it in any other way**. | `false` | Yes |
|
||||
| `NOTIFICATION_SERVICE_IDENTIFIER` | The bundle identifier for the notification service extension. | | Yes |
|
||||
| `EXTENSION_APP_IDENTIFIER` | The bundle identifier for the share extension. | | Yes |
|
||||
| `FASTLANE_TEAM_ID` | The ID of your Apple Developer Portal Team. | | Yes |
|
||||
| `IOS_ICLOUD_CONTAINER` | The iOS iCloud container identifier used to support iCloud storage. | | Yes |
|
||||
| `IOS_APP_GROUP` | The iOS App Group identifier used to share data between the app and the share extension. | | Yes |
|
||||
| `SYNC_PROVISIONING_PROFILES` | Should we run **match** to sync the provisioning profiles. **Note**: Not syncing the provisioning profiles, will cause the singing to fail. Valid values are: `true`, `false` | `false` | Yes |
|
||||
| `MATCH_USERNAME` | Your Apple ID Username. | | Yes |
|
||||
| `MATCH_PASSWORD` | Your Apple ID Password. | | Yes |
|
||||
| `MATCH_KEYCHAIN_PASSWORD` | Your Mac user password used to install the certificates in the build computer KeyChain. | | No |
|
||||
| `MATCH_GIT_URL` | URL to the Git repo containing all the certificates. <br/><br/> **Make sure this Git repo is set to private. Remember this repo will be used to sync the provisioning profiles and other certificates**. | | Yes |
|
||||
| `MATCH_APP_IDENTIFIER` | The Bundle Identifiers for the app (comma-separated).<br/><br/>**List the identifiers for each target of the app**. | for example:<br/>`com.mattermost.rnbeta`, <br/>`com.mattermost.rnbeta.MattermostShare`, <br/>`com.mattermost.rnbeta.NotificationService` | Yes |
|
||||
| `MATCH_TYPE` | Define the provisioning profile type to sync. Valid values are: `appstore`, `adhoc`, `development`, `enterprise` <br/><br/>**Make sure you set this value to the same type as the `IOS_BUILD_EXPORT_METHOD` as you want to have the same provisioning profiles installed in the machine so they are found when signing the app**. | `adhoc` | Yes |
|
||||
| `SUBMIT_IOS_TO_TESTFLIGHT` | Submit the app to TestFlight once the build finishes. Valid values are: `true`, `false` | `false` | No |
|
||||
| `PILOT_USERNAME` | Your Apple ID Username used to deploy the app to TestFlight. | | No |
|
||||
| `PILOT_SKIP_WAITING_FOR_BUILD_PROCESSING` | Do not wait until TestFlight finishes processing the app.<br/><br/>Valid values are: `true`, `false` | `true` | No |
|
||||
|
||||
---
|
||||
|
||||
<Note title="Note">
|
||||
To configure your variables create the file `./mattermost-mobile/fastlane/.env` where `.env` is the filename. You can find the sample file `env_vars_example` [here](https://github.com/mattermost/mattermost-mobile/blob/master/fastlane/env_vars_example).
|
||||
</Note>
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Build the mobile app
|
||||
|
||||
Once all the previous steps are complete, execute the following command from within the project's directory:
|
||||
|
||||
```sh
|
||||
$ npm run build:ios
|
||||
```
|
||||
|
||||
This will start the build process following the environment variables you've set. Once it finishes, it will create an `.ipa` file with the `APP_NAME` as the filename in the project's root directory. If you have not set Fastlane to submit the app to TestFlight, you can use this file to manually publish and distribute the app.
|
||||
|
||||
# Troubleshooting
|
||||
|
||||
## I keep receiving `Invalid username and password combination.` but the user and password are correct
|
||||
|
||||
Apple IDs must be lowercase. A username like "Example@icloud.com" may not work properly, while "example@icloud.com" will. Also ensure you have recently changed your Apple ID password. "Old" passwords may be blocked by Apple when not connecting through a browser, so Apple may block Fastlane. Resetting your password may solve this issue.
|
||||
@@ -0,0 +1,57 @@
|
||||
---
|
||||
title: "Enable SSL Pinning certificates"
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
##### What is SSL Pinning?
|
||||
|
||||
SSL (Secure Sockets Layer) pinning is a technique used in mobile app development to ensure that the app communicates only with a server that has a specific certificate. This is done by embedding the server’s certificate in the app itself and then validating the server’s certificate against this embedded certificate during communication. If the server's certificate does not match the pinned certificate, the connection is rejected.
|
||||
|
||||
##### Advantages of SSL Pinning
|
||||
|
||||
1. **Increased Security**: Protects against man-in-the-middle (MITM) attacks by ensuring that the app only communicates with trusted servers.
|
||||
2. **Trustworthiness**: Guarantees that the data sent and received is from the expected server.
|
||||
3. **Prevention of Certificate Spoofing**: Ensures that the server’s certificate is exactly what is expected, preventing spoofing attempts.
|
||||
|
||||
##### Disadvantages of SSL Pinning
|
||||
|
||||
1. **Certificate Management**: Requires regular updates to the app when the server’s certificate is renewed or changed.
|
||||
2. **Deployment Complexity**: Coordination between development and deployment teams is necessary to avoid disruptions during certificate rotations.
|
||||
3. **Maintenance Overhead**: Adds additional steps and complexity to the app’s maintenance process.
|
||||
|
||||
|
||||
<Note title="Important Note">
|
||||
SSL pinning requires that both development and deployment teams understand and follow best practices for cryptographic key management, certificate rotation, and incident response.
|
||||
- Coordinating the timing of certificate updates and app updates is crucial to minimize impact on end-users. When the server's SSL certificate is renewed or rotated, the hardcoded public key in the app no longer matches the server's new certificate, leading to connection failures until the app is updated with the new key.
|
||||
- Both development and deployment teams need to align on a deployment window that considers factors like user downtime, mobile app store review timelines, and peak usage times, as well as a coordinated rollback plan.
|
||||
</Note>
|
||||
|
||||
|
||||
### Steps to Enable SSL Pinning in Your Mobile App
|
||||
|
||||
#### 1. Obtain the Certificate from the Server
|
||||
|
||||
Use `openssl` to retrieve the certificate from your server and save it to a file. This can be done with the following command:
|
||||
|
||||
```sh
|
||||
openssl s_client -connect yourserver.com:443 -showcerts < /dev/null | openssl x509 -outform DER -out yourserver.cer
|
||||
```
|
||||
|
||||
Alternatively, to save it in PEM format:
|
||||
|
||||
```sh
|
||||
openssl s_client -connect yourserver.com:443 -showcerts < /dev/null | openssl x509 -outform PEM -out yourserver.crt
|
||||
```
|
||||
|
||||
#### 2. Naming the Certificate Files
|
||||
|
||||
Name the certificate files using the domain name as the filename with either `.cer` or `.crt` as the extension. For example, if your server’s domain is `example.com`, your files should be named `example.com.cer` and/or `example.com.crt`.
|
||||
|
||||
Optionally you can have both file types (`.cer` and `.crt`) to match the server trust and to ensure continued app functionality during certificate rotations. **Coordinate certificate rotations with the deployment teams** to avoid disruptions between the app and the server.
|
||||
|
||||
#### 3. Copy the Certificate Files to the Assets Folder
|
||||
|
||||
Place the certificate files in the `assets/certs` folder of your project. This is necessary for the app to access and use the certificates during runtime.
|
||||
|
||||
#### 4. Build Your App
|
||||
Follow the instructions in the [Build the iOS app](/developers/contribute/more-info/mobile/build-your-own/ios) or [Build the Android app](/developers/contribute/more-info/mobile/build-your-own/android) sections to build your app with SSL pinning enabled.
|
||||
@@ -0,0 +1,69 @@
|
||||
---
|
||||
title: "White label"
|
||||
sidebar_position: 3
|
||||
---
|
||||
|
||||
We've made it easy to white label the mobile app and to replace and override the assets used, however, you have to [Build Your Own App](/developers/contribute/more-info/mobile/build-your-own) from source.
|
||||
|
||||
If you look at the [Project Folder Structure](/developers/contribute/more-info/mobile/developer-setup/structure), you'll see that there is an assets folder containing a base folder with assets provided by Mattermost. These include localization files and images as well as a release folder that optionally contains the icons and the splash screen of the app when building in release mode.
|
||||
|
||||
To replace these with your own assets, create a sub-directory called `override` in the `assets` folder. The assets that you add using the same directory structure and file names as in the `base` directory, will be used instead of the original ones.
|
||||
|
||||
### Localization strings
|
||||
|
||||
To replace these with your own assets, create a sub-directory called `override` in the `assets` folder. Using the same directory structure and file names as in the `base` directory, you can add assets to the override folder to be used instead.
|
||||
|
||||
For example, to override `assets/base/images/logo.png` you would replace your own `logo.png` file in `assets/override/images/logo.png`.
|
||||
|
||||
### Images
|
||||
|
||||
To replace an image, copy the image to `assets/override/images/` with the same location and file name as in the `base` folder.
|
||||
|
||||
---
|
||||
|
||||
<Note title="Note">
|
||||
Make sure the images have the same height, width, and DPI as the images that you are overriding.
|
||||
</Note>
|
||||
|
||||
|
||||
---
|
||||
|
||||
### App splash screen and launch icons
|
||||
|
||||
In the `assets` directory you will find a folder named `assets/base/release` which contains an `icons` folder and a `splash_screen` folder under each platform directory.
|
||||
|
||||
Copy the full `release` directory under `assets/override/release` and then replace each image with the same name. Make sure you replace all the icon images for the platform you are building the app - the same applies to the splash screen.
|
||||
|
||||
The splash screen's background color is white by default and the image is centered. If you need to change the color or the layout to improve the experience of your new splash screen make sure that you also override the file `launch_screen.xml` for Android and `LaunchScreen.storyboard` for iOS. Both can be found under `assets/base/release/splash_screen/<platform>/`.
|
||||
|
||||
Splash screen and launch icons assets are replaced at build time when the environment variable `REPLACE_ASSETS` is set to true (default is false).
|
||||
|
||||
---
|
||||
|
||||
<Note title="Note">
|
||||
Make sure the images have the same height, width, and DPI as the images that you are overriding.
|
||||
</Note>
|
||||
|
||||
|
||||
---
|
||||
|
||||
### Configuration
|
||||
|
||||
The `config.json` file handles custom configuration for the app for settings that cannot be controlled by the Mattermost server. Like with localization strings, create a `config.json` file under `assets/override` and just include the keys and values that you wish to change that are present in `assets/base/config.json`.
|
||||
|
||||
For example, if you want the app to automatically provide a server URL and skip the screen to input it, you would add the following to `assets/override/config.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"DefaultServerUrl": "http://192.168.0.13:8065",
|
||||
"AutoSelectServerUrl": true
|
||||
}
|
||||
```
|
||||
---
|
||||
|
||||
<Note title="Note">
|
||||
The above key/value pairs are taken from the original `config.json` file. Since we don’t need to change anything else, we only included these two settings.
|
||||
</Note>
|
||||
|
||||
|
||||
---
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
title: "Add new dependencies"
|
||||
sidebar_position: 4
|
||||
---
|
||||
|
||||
If you need to add a new dependency to the project, it is important to add them in the right way. Instructions for adding different types of dependencies are described below.
|
||||
|
||||
#### JavaScript only
|
||||
|
||||
If you need to add a new JavaScript dependency that is not related to React Native, **use npm, not yarn**. Be sure to save the exact version number to avoid conflicts in the future.
|
||||
|
||||
```sh
|
||||
$ npm i --save-exact <package-name>
|
||||
```
|
||||
|
||||
If the dependency is only for development
|
||||
```sh
|
||||
$ npm i --save-exact --save-dev <package-name>
|
||||
```
|
||||
|
||||
#### React Native
|
||||
|
||||
As with [JavaScript only](#javascript-only), **use npm** to add your dependency and include an exact version.
|
||||
|
||||
If the library contains iOS native code, make sure to run:
|
||||
|
||||
```sh
|
||||
$ npm run pod-install
|
||||
```
|
||||
|
||||
Most of the time linking the library to React Native is done automatically, but at times some libraries need to be manually linked. In this case follow the library's documentation.
|
||||
@@ -0,0 +1,278 @@
|
||||
---
|
||||
title: "Developer setup for Mattermost mobile apps"
|
||||
description: "Set up a development environment for the React Native Mattermost mobile apps for iOS and Android."
|
||||
sidebar_label: "Developer setup"
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
The following instructions apply to the mobile apps for iOS and Android built in React Native.
|
||||
Download the iOS version [here](https://apps.apple.com/us/app/mattermost/id1257222717) and the Android version [here](https://play.google.com/store/apps/details?id=com.mattermost.rn).
|
||||
Source code can be found at the [GitHub Mattermost Mobile app repository](https://github.com/mattermost/mattermost-mobile).
|
||||
|
||||
If you run into any issues getting your environment set up, check the [Troubleshooting](https://docs.mattermost.com/deploy/mobile-troubleshoot.html) section of the product docs for common solutions.
|
||||
|
||||
|
||||
<Note title="iOS mobile app">
|
||||
A macOS computer is required to build the Mattermost iOS mobile app.
|
||||
</Note>
|
||||
|
||||
|
||||
|
||||
<Note title="Android mobile app">
|
||||
Version 17 of the Java SE Development Kit (JDK) is required to develop the Mattermost Android mobile app. You can download the latest OpenJDK release of Java from Oracle, for free, under an open source license.
|
||||
</Note>
|
||||
|
||||
|
||||
## Environment setup
|
||||
|
||||
The following instructions apply to both iOS and Android mobile apps.
|
||||
On macOS, we recommend using [Homebrew](https://brew.sh) as a package manager.
|
||||
|
||||
### Install NodeJS and NPM
|
||||
|
||||
We recommend using NodeJS v22 and npm v10. Many of our team use [nvm](https://github.com/nvm-sh/nvm) to manage npm and NodeJS versions.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="node-npm-mac" label="macOS">
|
||||
To install [NVM](https://github.com/nvm-sh/nvm), follow [these instructions](https://github.com/nvm-sh/nvm#installing-and-updating).
|
||||
|
||||
After installing, follow the post-install steps shown by the installer to add the necessary lines to your shell profile (for example `~/.zshrc` or `~/.bash_profile`). Then open a new terminal and run:
|
||||
|
||||
```sh
|
||||
nvm install --lts
|
||||
```
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="node-npm-linux" label="Linux">
|
||||
There are three available options for installing NodeJS on Linux:
|
||||
|
||||
- Using NVM by following the instructions [here](https://github.com/nvm-sh/nvm#install-script).
|
||||
- Install using your distribution's package manager.
|
||||
- Download and install the package from the [NodeJS website](https://nodejs.org/en).
|
||||
|
||||
<Note>
|
||||
The version of NodeJS that your distribution's package manager supports may not be the recommended version to build Mattermost mobile apps.
|
||||
Please make sure that NodeJS installed by the package manager is at the recommended version.
|
||||
</Note>
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
### Install Watchman
|
||||
|
||||
[Watchman](https://facebook.github.io/watchman) is a file watching program.
|
||||
When a file changes, Watchman triggers an action, such as re-running a build command if a source file has changed.
|
||||
|
||||
The minimum required version of Watchman is 4.9.0.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="watchman-mac" label="macOS">
|
||||
To install Watchman using Homebrew, open a terminal and execute:
|
||||
|
||||
```sh
|
||||
brew install watchman
|
||||
```
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="watchman-linux" label="Linux">
|
||||
Download the latest package from [here](https://github.com/facebook/watchman/releases).
|
||||
|
||||
<Note title="Inotify limits">
|
||||
Note that you need to increase your `inotify` limits for Watchman to work properly.
|
||||
</Note>
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
### Install `react-native-cli` tools
|
||||
|
||||
```sh
|
||||
npm -g install react-native-cli
|
||||
```
|
||||
|
||||
### Install Git
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="git-mac" label="macOS">
|
||||
To install Git using Homebrew, open a terminal and execute:
|
||||
|
||||
```sh
|
||||
brew install git
|
||||
```
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="git-linux" label="Linux">
|
||||
Some distributions come with Git preinstalled but you'll most likely have to install it yourself. For most distributions the package is simply called `git`.
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Additional setup for iOS (macOS)
|
||||
|
||||
### Install XCode
|
||||
|
||||
Install [Xcode](https://apps.apple.com/us/app/xcode/id497799835?ls=1&mt=12) to build and run the app on iOS. The minimum required version is 11.0.
|
||||
|
||||
### Install Ruby
|
||||
|
||||
A version of Ruby is automatically installed on macOS, but Mattermost React Native app development requires the Ruby version pinned in the repository's `.ruby-version` file (currently 3.2.11). You can check the current version of Ruby by running the following command.
|
||||
```sh
|
||||
ruby --version
|
||||
```
|
||||
|
||||
If it isn't, we recommend using [Ruby Version Manager](https://rvm.io) or your preferred package manager to install the required version. The steps below are for using RVM.
|
||||
|
||||
1. Install the GPG keys for RVM using the command found [here](https://rvm.io/rvm/install#install-gpg-keys).
|
||||
1. If you don't have the `gpg` command, you can install it using Homebrew by running.
|
||||
```sh
|
||||
brew install gnupg
|
||||
```
|
||||
2. Install the stable version of RVM using the following command.
|
||||
```sh
|
||||
\curl -sSL https://get.rvm.io | bash -s stable --ruby
|
||||
```
|
||||
3. To load RVM, either open a new terminal or run the following command.
|
||||
```sh
|
||||
source ~/.rvm/scripts/rvm
|
||||
```
|
||||
4. Install the required version of Ruby
|
||||
```sh
|
||||
rvm install 3.2.11
|
||||
```
|
||||
5. (Optional) If you don't need to use a different version of Ruby for anything else, you'll want to change the default version of Ruby. Without this, you'll need to run `rvm use 3.2.11` any time you want to work on the mobile app.
|
||||
```sh
|
||||
rvm alias create default 3.2.11
|
||||
```
|
||||
|
||||
:::note[Apple Silicon]
|
||||
On recent Apple Silicon Macs, installing Ruby through RVM can fail with repeated OpenSSL errors. If you hit those, [`rv`](https://github.com/spinel-coop/rv) (a Ruby version manager) is a reliable alternative:
|
||||
|
||||
```sh
|
||||
brew install rv
|
||||
rv ruby install 3.2.11
|
||||
```
|
||||
|
||||
To have `rv` switch Ruby versions automatically, install its shell integration once. For example, for `zsh`:
|
||||
|
||||
```sh
|
||||
echo 'eval "$(rv shell init zsh)"' >> ~/.zshrc
|
||||
```
|
||||
|
||||
Run `rv shell <your-shell>` (`bash`, `fish`, etc.) to see the equivalent for your shell, then open a new terminal. After that, `rv` reads the repository's `.ruby-version` file and selects the pinned version automatically when you `cd` into the project.
|
||||
:::
|
||||
|
||||
## Additional setup for Android
|
||||
|
||||
### Download and install Android Studio or Android SDK CLI tools
|
||||
|
||||
Download and install the [Android Studio app or the Android SDK command line tools](https://developer.android.com/studio/index.html#downloads)
|
||||
|
||||
|
||||
<Note title="Default paths">
|
||||
This documentation assumes you chose the default path for your Android SDK installation. If you chose a different path, adjust the environment variables below accordingly.
|
||||
</Note>
|
||||
|
||||
|
||||
#### Environment variables
|
||||
|
||||
Make sure you have the following environment variables configured for your platform:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="droid-common" label="All platforms">
|
||||
- Set `ANDROID_HOME` to where Android SDK is located (likely `/Users/<username>/Library/Android/sdk` or `/home/<username>/Android/Sdk`)
|
||||
- Make sure your `PATH` includes `ANDROID_HOME/tools` and `ANDROID_HOME/platform-tools`
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="droid-mac" label="macOS">
|
||||
On Mac, this usually requires adding the following lines to your `~/.bash_profile` file:
|
||||
|
||||
```sh
|
||||
export ANDROID_HOME=$HOME/Library/Android/sdk
|
||||
export PATH=$ANDROID_HOME/emulator:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$PATH
|
||||
```
|
||||
|
||||
Then reload your bash configuration:
|
||||
|
||||
```sh
|
||||
source ~/.bash_profile
|
||||
```
|
||||
|
||||
|
||||
<Note>
|
||||
Depending on the shell you're using, this might need to be put into a different file such as `~/.zshrc`. Adjust this accordingly.
|
||||
</Note>
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="droid-linux" label="Linux">
|
||||
On Linux the home folder is located under `/home/<username>` which results in a slightly different path:
|
||||
|
||||
```sh
|
||||
export ANDROID_HOME=/home/<username>/Android/Sdk
|
||||
export PATH=$ANDROID_HOME/platform-tools:$PATH
|
||||
export PATH=$ANDROID_HOME/tools:$PATH
|
||||
```
|
||||
|
||||
Then reload your configuration
|
||||
|
||||
```sh
|
||||
source ~/.bash_profile
|
||||
```
|
||||
|
||||
|
||||
<Note>
|
||||
Depending on the shell you're using, this might need to be put into a different file such as `~/.zshrc`. Adjust this accordingly.
|
||||
</Note>
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
### Install the SDKs and SDK tools
|
||||
|
||||
In the SDK Manager using Android Studio or the [Android SDK command line tool](https://developer.android.com/studio/command-line/sdkmanager.html), ensure the following are installed:
|
||||
|
||||
- SDK Tools (you may have to select **Show Package Details** to expand packages):
|
||||
- Android SDK Build-Tools 31
|
||||
- Android Emulator
|
||||
- Android SDK Platform-Tools
|
||||
- Android SDK Tools
|
||||
- Google Play services
|
||||
- Intel x86 Emulator Accelerator (HAXM installer)
|
||||
- Support Repository
|
||||
- Android Support Repository
|
||||
- Google Repository
|
||||
|
||||

|
||||
|
||||
- SDK Platforms (you may have to select **Show Package Details** to expand packages)
|
||||
- Android 12 or above
|
||||
- Google APIs
|
||||
- SDK Platform
|
||||
- Android SDK Platform 31 or above
|
||||
- Intel or Google Play Intel x86 Atom\_64 System Image
|
||||
- Any other API version that you want to test
|
||||
|
||||

|
||||
|
||||
## Obtain the source code
|
||||
|
||||
In order to develop and build the Mattermost mobile apps, you'll need to get a copy of the source code. Forking the `mattermost-mobile` repository will also make it easy to contribute your work back to the project in the future.
|
||||
|
||||
1. Fork the [mattermost-mobile](https://github.com/mattermost/mattermost-mobile) repository on GitHub.
|
||||
|
||||
2. Clone your fork locally:
|
||||
|
||||
a. Open a terminal
|
||||
|
||||
b. Change to a directory you want to hold your local copy
|
||||
|
||||
c. Run `git clone https://github.com/<username>/mattermost-mobile.git` if you want to use HTTPS, or `git clone git@github.com:<username>/mattermost-mobile.git` if you want to use SSH
|
||||
|
||||
|
||||
<Note>
|
||||
`<username>` refers to the username or organization in GitHub that forked the repository
|
||||
</Note>
|
||||
|
||||
|
||||
3. Change the directory to `mattermost-mobile`.
|
||||
|
||||
```sh
|
||||
cd mattermost-mobile
|
||||
```
|
||||
|
||||
4. Install the project dependencies with `npm install`
|
||||
@@ -0,0 +1,123 @@
|
||||
---
|
||||
title: "Run the mobile app"
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
We provide a set of scripts to help you run the app for the different platforms that are executed with `npm`:
|
||||
|
||||
* **npm start**: Start the React Native packager. The packager has to be running in order to build the JavaScript code that powers the app.
|
||||
* **npm run android**: Compile and run the mobile app on Android.
|
||||
* **npm run ios**: Compile and run the mobile app on iOS.
|
||||
|
||||
|
||||
<Note>
|
||||
To speed up development, only compile and run the apps in the following cases:
|
||||
- You have not deployed the app to a device or simulator with the `npm run <platform>` command.
|
||||
- There have been changes in the native code.
|
||||
- A new library has been added or updated that has native code.
|
||||
|
||||
If none of the above cases apply, you could just simply start the React Native packager with `npm start` and launch the app you have already deployed to the device or simulator.
|
||||
</Note>
|
||||
|
||||
|
||||
The above commands are shortcuts for the `react-native` CLI. You can append `-- --help` to the above commands to see available options, for example:
|
||||
|
||||
```sh
|
||||
npm run android -- --help
|
||||
```
|
||||
|
||||
Make sure you are adding `--` before the options you want to include or run the `react-native` CLI directly:
|
||||
|
||||
```sh
|
||||
npx react-native run-android --help
|
||||
```
|
||||
|
||||
## Run on a device
|
||||
|
||||
By default, running the app will launch an Android emulator (if you created one) or an iOS simulator.
|
||||
|
||||
If you want to test the performance of the app or if you want to make a contribution it is always a good idea to run the app on an actual device.
|
||||
This will let you ensure that the app is working correctly and in a performant way before submitting a pull request.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="mobile-android" label="Android">
|
||||
To be able to run the app on an Android device you'll need to follow these steps:
|
||||
|
||||
1. **Enable debugging over USB**
|
||||
|
||||
Most Android devices can only install and run apps downloaded from Google Play by default. In order to be able to install the Mattermost Mobile app in the device during development you will need to enable USB Debugging on your device in the **Developer options** menu by going to **Settings > About phone** and then tap the Build number row at the bottom seven times, then go back to **Settings > Developer options** and enable **USB debugging**.
|
||||
|
||||
2. **Plug in your device via USB**
|
||||
|
||||
Plug in your Android device in any available USB port in your development machine (try to avoid hubs and plug it directly into your computer) and check that your device is properly connecting to ADB (Android Debug Bridge) by running `adb devices`.
|
||||
|
||||
```
|
||||
$ adb devices
|
||||
List of devices attached
|
||||
42006fb3e4fb25b8 device
|
||||
```
|
||||
|
||||
If you see **device** in the right column that means that the device is connected. You can have multiple devices attached and the app will be deployed to **all of them**.
|
||||
|
||||
3. **Compile and run**
|
||||
|
||||
With your device connected to the USB port execute the following in your command prompt to install and launch the app on the device:
|
||||
|
||||
```sh
|
||||
npm run android
|
||||
```
|
||||
|
||||
|
||||
<Note title="Note">
|
||||
If you don't see a bar at the top loading the JavaScript code then it's possible that the device is not connected to the development server. See [Using adb reverse](http://reactnative.dev/docs/running-on-device.html#method-1-using-adb-reverse-recommended).
|
||||
</Note>
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="mobile-ios" label="iOS">
|
||||
To be able to run the app on an iOS device you'll need to have [Xcode](https://developer.apple.com/xcode/) installed on a Mac computer and follow this steps:
|
||||
|
||||
1. **Get an Apple Developer account**
|
||||
|
||||
The apps that run on an iOS device must be signed. To sign it, you'll need a set of provisioning profiles. If you already have an Apple Developer account enrolled in the Apple Developer program you can skip this step. If you don't have an account yet you'll need to [create one](https://appleid.apple.com/account?appId=632&returnUrl=https%3A%2F%2Fdeveloper.apple.com%2Faccount%2F#!&page=create) and enroll in the [Apple Developer Program](https://developer.apple.com/programs/).
|
||||
|
||||
2. **Open the project in Xcode**
|
||||
|
||||
Navigate to the `ios` folder in your `mattermost-mobile` project, then open the file `Mattermost.xcworkspace` in Xcode.
|
||||
|
||||
3. **Configure code signing and capabilities**
|
||||
|
||||
Select the **Mattermost** project in the Xcode Project Navigator, then select the **Mattermost** target. Look for the **Signing & Capabilities** tab.
|
||||
|
||||
- Go to the **Signing** section and make sure your Apple developer account or team is selected under the Team dropdown and change the [Bundle Identifier](https://developer.apple.com/documentation/appstoreconnectapi/bundle_ids).
|
||||
Xcode will register your provisioning profiles in your account for the Bundle Identifier you've entered if it doesn't exist.
|
||||
- Go to the **App Groups** section and change the [App Groups](https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_application-groups?language=objc).
|
||||
Xcode will register your AppGroupId and update the provision profile.
|
||||
- Go to the **iCloud** section and change the [Containers](https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_icloud-container-identifiers?language=objc).
|
||||
Xcode will register your iCloud container and update the provision profile.
|
||||
- Go to the **Keychain Sharing** section and change the [Keychain Groups](https://developer.apple.com/documentation/bundleresources/entitlements/keychain-access-groups?language=objc).
|
||||
Xcode will register your Keychain access groups and update the provision profile.
|
||||
|
||||
|
||||
<Note title="Important">
|
||||
Repeat the steps for the `MattermostShare` and `NotificationService` targets. Each target must use a **different** *Bundle Identifier*.
|
||||
</Note>
|
||||
|
||||
|
||||
4. **Compile and run**
|
||||
|
||||
Plug in your iOS device in any available USB port in your development computer.
|
||||
|
||||
If everything is set up correctly, your device will be listed as the build target in the Xcode toolbar, and it will also appear in the Devices Pane (<kbd><kbd>⇧</kbd><kbd>⌘</kbd><kbd>2</kbd></kbd>). You can press the **Build and run** button (<kbd><kbd>⌘</kbd><kbd>R</kbd></kbd>) or select **Run** from the Product menu to run the app.
|
||||
|
||||

|
||||
|
||||
As an alternative you can select the targeted device by opening the **Product** menu in Xcode menu bar, then go to **Destination** and look for your device to select from the list.
|
||||
|
||||
|
||||
<Note>
|
||||
If you run into any issues, please take a look at Apple's [Launching Your App on a Device](https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/LaunchingYourApponDevices/LaunchingYourApponDevices.html#//apple_ref/doc/uid/TP40012582-CH27-SW4) documentation.
|
||||
If the app fails to build, go to the **Product** menu and select **Clean Build Folder** before trying to build the app again.
|
||||
Also, be sure that your iOS device is trusted so app deployments can proceed.
|
||||
</Note>
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
@@ -0,0 +1,56 @@
|
||||
---
|
||||
title: "Folder structure"
|
||||
sidebar_position: 1
|
||||
---
|
||||
The following is an overview of the Mobile app repository file structure:
|
||||
|
||||
```goat
|
||||
|
|
||||
+-- .circleci # Circle CI workflow to build the apps
|
||||
+-- .github # GitHub actions
|
||||
+-- .husky
|
||||
+-- android # Android specific code
|
||||
+-- app # React Native code
|
||||
| |
|
||||
| +-- actions
|
||||
| +-- client
|
||||
| +-- components
|
||||
| +-- constants
|
||||
| +-- context
|
||||
| +-- database
|
||||
| +-- helpers
|
||||
| +-- hooks
|
||||
| +-- i18n
|
||||
| +-- init
|
||||
| +-- managers
|
||||
| +-- notifications
|
||||
| +-- products
|
||||
| +-- queries
|
||||
| +-- screens
|
||||
| +-- store
|
||||
| +-- utils
|
||||
|
|
||||
+-- assets
|
||||
| |
|
||||
| +-- base
|
||||
| | |
|
||||
| | +-- i18n
|
||||
| | +-- images
|
||||
| | +-- release
|
||||
| +-- fonts
|
||||
|
|
||||
+-- build
|
||||
| |
|
||||
| +-- notice-file
|
||||
|
|
||||
+-- detox
|
||||
+-- docs
|
||||
+-- eslint
|
||||
+-- fastlane # Fastlane scripts to build the app
|
||||
+-- ios # iOS specific code
|
||||
+-- patches # Patches for various dependencies
|
||||
+-- scripts
|
||||
+-- share_extension # Android's share extension app
|
||||
+-- test
|
||||
+-- types
|
||||
```
|
||||
148
docs/develop/contribute/more-info/mobile/e2e.md
Normal file
148
docs/develop/contribute/more-info/mobile/e2e.md
Normal file
@@ -0,0 +1,148 @@
|
||||
---
|
||||
title: "Mobile End-to-End (E2E) Tests"
|
||||
sidebar_position: 5
|
||||
---
|
||||
|
||||
This page describes how to write and run End-to-End (E2E) testing for Mobile Apps for both iOS and Android. Mobile products use [Detox](https://github.com/wix/Detox), which is a "gray box end-to-end testing and automation library for mobile apps." See its [documentation](https://github.com/wix/Detox/tree/master/docs) to learn more.
|
||||
|
||||
### File Structure
|
||||
|
||||
The folder structure is as follows:
|
||||
```
|
||||
|-- detox
|
||||
|-- e2e
|
||||
|-- support
|
||||
|-- test
|
||||
|-- config.json
|
||||
|-- environment.js
|
||||
|-- init.js
|
||||
|-- .babelrc
|
||||
|-- .detoxrc.json
|
||||
|-- package-lock.json
|
||||
|-- package.json
|
||||
```
|
||||
|
||||
* `/detox/e2e/support` is the support folder, which is a place to put reusable behavior such as Server API and UI commands, or global overrides that should be available to all test files.
|
||||
* `/detox/e2e/test`: To start writing tests, create a new file (e.g. `login.e2e.js`) in the `/detox/e2e/test` folder.
|
||||
- The subfolder naming convention depends on the test grouping, which is usually based on the general functional area (e.g. `/detox/e2e/test/messaging/` for "Messaging").
|
||||
- Test cases that require an Enterprise license should fall under `/detox/e2e/test/enterprise/`. This is to easily identify license requirements, both during local development and production testing for Enterprise features.
|
||||
* `/detox/.detoxrc.json`: for Detox configuration.
|
||||
* `/detox/package.json` : for all dependencies related to Detox end-to-end testing.
|
||||
|
||||
### Writing an E2E Test
|
||||
This process has many similarities to [writing an E2E test for the mattermost-webapp project](/developers/contribute/more-info/webapp/e2e-testing).
|
||||
Before writing a script, ensure that it has a corresponding test case in Zephyr. All test cases may be found in this [link](https://mattermost.atlassian.net/projects/MM?selectedItem=com.atlassian.plugins.atlassian-connect-plugin%3Acom.kanoah.test-manager__main-project-page#!/design?projectId=10302). If test case is not available, feel free to prompt the QA team who will either search from an existing Zephyr entry or if it's a new one, it will be created for you.
|
||||
|
||||
1. Create a test file based on the file structure aforementioned above.
|
||||
2. Include Zephyr identification (ID) and title in the test description, following the format of `it('[Zephyr_id] [title]')` or `it('[Zephyr_id]_[step] [title]')` if the test case has multiple steps. For test case "[MM-T109 RN apps: User can't send the same message repeatedly](https://mattermost.atlassian.net/projects/MM?selectedItem=com.atlassian.plugins.atlassian-connect-plugin%3Acom.kanoah.test-manager__main-project-page#!/testCase/MM-T109)", it should be:
|
||||
```javascript
|
||||
describe('Messaging', () => {
|
||||
it('MM-T109 User can\'t send the same message repeatedly', () => {
|
||||
// Test steps and assertion here
|
||||
}
|
||||
}
|
||||
```
|
||||
4. Target an element using available matchers. For best results, it is recommended to match elements by unique identifiers using `testID`. The identifier should follow the following format to avoid duplication, `<location>.<modifier>.<element>.<identifier>`, where:
|
||||
|
||||
<Note title="NOTE">
|
||||
Not all fields are required. When assigning a `testID`, carefully inspect the actual render structure and pick up the minimum fields combination to create a unique value. Some examples include: `send.button` and `post.<post-id>`.
|
||||
</Note>
|
||||
|
||||
|
||||
```text
|
||||
* `location` - can be a parent component, a main section, or a UI screen.
|
||||
* `modifier` - adds meaning to the `element`.
|
||||
* `element` - common terms like `button`, `text_input`, `image`, and the like.
|
||||
* `identifier` - could be unique ID of a post, channel, team or user, or a number to represent order.
|
||||
```
|
||||
|
||||
5. Prefix each comment line with appropriate indicator. Each line in a multi-line comment should be prefixed accordingly. Separate and group test step comments and assertion comments for better readability.
|
||||
- `#` indicates a test step (e.g. `// # Go to a screen`)
|
||||
- `*` indicates an assertion (e.g. `// * Check the title`)
|
||||
6. Simulate user interaction using available actions, and verify user interface (UI) expectations using `expect`. When using `action`, `match`, or another API specific to a particular platform, verify that the equivalent logic is applied so that the API does not impact other platforms. Always run tests in applicable platforms.
|
||||
|
||||
### Running E2E Tests
|
||||
#### Testing Android Locally
|
||||
##### Local setup
|
||||
|
||||
1. Install the latest Android SDK:
|
||||
|
||||
```
|
||||
sdkmanager "system-images;android-30;google_apis;x86"
|
||||
sdkmanager --licenses
|
||||
```
|
||||
2. Create the emulator using `npm run e2e:android-create-emulator` from the `/detox` folder. Android testing requires an emulator named `detox_pixel_4_xl_api_30` and the script helps to create it automatically.
|
||||
|
||||
##### Complete a test run in debug mode
|
||||
This is the typical flow for local development and test writing:
|
||||
|
||||
1. Open a terminal window and run react-native packager by `npm install && npm start` from the root folder.
|
||||
2. Open a second terminal window and:
|
||||
* Change directory to `/detox` folder.
|
||||
* Install npm packages by `npm install`.
|
||||
* Build the app together with the android test using `npm run e2e:android-build`.
|
||||
* Run the test using `npm run e2e:android-test`.
|
||||
* For running a single test, follow this example command: `npm run e2e:android-test -- connect_to_server.e2e.ts`.
|
||||
|
||||
##### Complete a test run in release mode
|
||||
This is the typical flow for CI test run:
|
||||
|
||||
1. Build a release app by running `npm install && npm run e2e:android-build-release` from the `/detox` folder.
|
||||
2. Run a test using `npm run e2e:android-test-release` from the `/detox` folder.
|
||||
|
||||
#### Testing iOS Locally
|
||||
##### Local setup
|
||||
|
||||
1. Install [applesimutils](https://github.com/wix/AppleSimulatorUtils):
|
||||
```
|
||||
brew tap wix/brew
|
||||
brew install applesimutils
|
||||
```
|
||||
2. Set XCode's build location so that the built app, especially debug, is expected at the project's location instead of the Library's folder which is unique/hashed.
|
||||
3. Open XCode, then go to **XCode > Settings > Locations**.
|
||||
4. Under **Derived Data**, click **Advanced...**.
|
||||
5. Select **Custom > Relative to Workspace**, then set **Products** as **Build/Products**.
|
||||
6. Click **Done** to save the changes.
|
||||
|
||||
##### Complete a test run in debug mode
|
||||
|
||||
1. In one terminal window, from the root folder run `npm run start` and on another `npm run ios` from the root folder.
|
||||
2. Once the build is complete and installed, there will be a message informing of the path where the app is installed. Copy that path. Sample output:
|
||||
```log
|
||||
info Building (using "xcodebuild -workspace Mattermost.xcworkspace -configuration Debug -scheme Mattermost -destination id=00008110-00040CA10263801E")
|
||||
info Installing "/Users/myuser/Proyectos/mattermost-mobile/ios/Build/Products/Debug-iphonesimulator/Mattermost.app
|
||||
info Launching "com.mattermost.rnbeta"
|
||||
success Successfully launched the app
|
||||
```
|
||||
3. Edit `/detox/.detoxrc` and
|
||||
- In **apps > ios.debug**, substitute `binaryPath` by that value.
|
||||
- In **devices > ios.simulator > device**, substitute `type` and `os` with the values corresponding to the ones being used by the simulator. If unsure wich ones, either open the simulator or go to Xcode to see where it is being built.
|
||||
4. Export the values for `ADMIN_USERNAME` and `ADMIN_PASSWORD` with the appropiate values for your test server. Check the Environment Variables section below to learn more about default values and other variables available.
|
||||
```sh
|
||||
export SITE_1_URL="http://localhost:8065"
|
||||
export ADMIN_USERNAME="sysadmin"
|
||||
export ADMIN_PASSWORD="Sys@dmin-sample1"
|
||||
```
|
||||
5. In another terminal window, run `npm i` then `npm run e2e:ios-test` from the `/detox` folder.
|
||||
* For running a single test, follow this example command: `npm run e2e:ios-test -- connect_to_server.e2e.ts`.
|
||||
```sh
|
||||
cd detox
|
||||
npm i
|
||||
npm run e2e:ios-test
|
||||
```
|
||||
|
||||
##### Complete a test run in release mode
|
||||
|
||||
1. Build the release app by running `npm run build:ios-sim` from the root folder or `npm run e2e:ios-build-release` from within the `/detox` folder.
|
||||
2. Run the test using `npm run e2e:ios-test-release` from the `/detox` folder.
|
||||
|
||||
#### Environment variables
|
||||
Test configurations are [defined at test_config.js](https://github.com/mattermost/mattermost-mobile/blob/master/detox/e2e/support/test_config.js) and environment variables are used to override default values. In most cases you don't need to change the values, because it makes use of the default local developer setup. If you do need to make changes, you may override by exporting, e.g. `export SITE_URL=<site_url>`.
|
||||
|
||||
| Variable | Description |
|
||||
|----------------|---------------------------------------------------------------------------------------------------------------------|
|
||||
| SITE_URL | Host of test server.<br/><br/>*Default*: `http://localhost:8065` for iOS or `http://10.0.2.2:8065` for Android. |
|
||||
| ADMIN_USERNAME | Admin's username for the test server.<br/><br/>*Default*: `sysadmin` when server is seeded by `make test-data`. |
|
||||
| ADMIN_PASSWORD | Admin's password for the test server.<br/><br/>*Default*: `Sys@dmin-sample1` when server is seeded by `make test-data`. |
|
||||
| LDAP_SERVER | Host of LDAP server.<br/><br/>*Default*: `localhost` |
|
||||
| LDAP_PORT | Port of LDAP server.<br/><br/>*Default*: `389` |
|
||||
25
docs/develop/contribute/more-info/mobile/index.md
Normal file
25
docs/develop/contribute/more-info/mobile/index.md
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
title: "Mobile apps"
|
||||
sidebar_position: 4
|
||||
---
|
||||
|
||||
The Mattermost mobile apps are written in [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) using [React Native](https://facebook.github.io/react-native/).
|
||||
|
||||
## Repository
|
||||
Further explanation of the file structure can be found in [the Developer Setup](/developers/contribute/more-info/mobile/developer-setup/structure). For more information about E2E testing on the Android and iOS apps, check out [Mobile End-to-End (E2E) tests](/developers/contribute/more-info/mobile/e2e)
|
||||
|
||||
## Mobile app contributor resources
|
||||
- [GitHub Repository](https://github.com/mattermost/mattermost-mobile) - Get the code, report issues, or submit PRs.
|
||||
- [Running the app](/developers/contribute/more-info/mobile/developer-setup/run) - Compile recommendations.
|
||||
- [Channel](https://community.mattermost.com/core/channels/native-mobile-apps) - Use the channel to interact with other Mattermost Mobile developers.
|
||||
- [Help Wanted](https://mattermost.com/pl/help-wanted-mattermost-mobile) - Find help wanted tickets here.
|
||||
|
||||
### Android specific documentation
|
||||
- [Build guide](/developers/contribute/more-info/mobile/build-your-own/android)
|
||||
- [Push Notifications](/developers/contribute/more-info/mobile/push-notifications/android)
|
||||
- [Sign Unsigned Builds](/developers/contribute/more-info/mobile/unsigned/android)
|
||||
|
||||
### iOS specific documentation
|
||||
- [Build guide](/developers/contribute/more-info/mobile/build-your-own/ios)
|
||||
- [Push Notifications](/developers/contribute/more-info/mobile/push-notifications/ios)
|
||||
- [Sign Unsigned Builds](/developers/contribute/more-info/mobile/unsigned/ios)
|
||||
@@ -0,0 +1,42 @@
|
||||
---
|
||||
title: "Android push notifications"
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
Push notifications on Android are managed and dispatched using [Firebase Cloud Messaging (FCM)](http://firebase.google.com/docs/cloud-messaging/)
|
||||
|
||||
- Create a Firebase project within the [Firebase Console](https://console.firebase.google.com).
|
||||
|
||||
- Click **Add Project**
|
||||

|
||||
|
||||
- Enter the project name, project ID and Country
|
||||
|
||||
- Click **CREATE PROJECT**
|
||||
|
||||

|
||||
|
||||
Once the project is created you'll be redirected to the Firebase project
|
||||
dashboard
|
||||
|
||||

|
||||
|
||||
- Click **Add Firebase to your Android App**
|
||||
- Enter the package ID of your custom Mattermost app as the **Android package name**.
|
||||
- Enter an **App nickname** so you can identify it with ease
|
||||
- Click **REGISTER APP**
|
||||
- Once the app has been registered, download the **google-services.json** file which will be used later
|
||||
|
||||
- Click **CONTINUE** and then **FINISH**
|
||||

|
||||

|
||||

|
||||
|
||||
Now that you have created the Firebase project and the app and
|
||||
downloaded the *google-services.json* file, you need to make some
|
||||
changes in the project.
|
||||
|
||||
- Replace `android/app/google-services.json` with the one you downloaded earlier
|
||||
|
||||
At this point, you can build the Mattermost app for Android and setup the [Mattermost Push Notification Service](/developers/contribute/more-info/mobile/push-notifications/service).
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
title: "Corporate proxy"
|
||||
sidebar_position: 4
|
||||
---
|
||||
|
||||
When your IT policy requires a corporate proxy to scan and audit all outbound traffic the following options are available:
|
||||
|
||||
###### 1. Deploy Mattermost with connection restricted post-proxy relay in DMZ or a trusted cloud environment
|
||||
|
||||
Some legacy corporate proxy configurations may be incompatible with the requirements of modern mobile architectures, such as the requirement of HTTP/2 requests from Apple to send push notifications to iOS devices.
|
||||
|
||||
In this case, a **post-proxy relay** (which accepts network traffic from a corporate proxy such as NGINX, and transmits it to the final destination) can be deployed to take messages from the Mattermost server passing through your corporate IT proxy in the incompatible format, e.g. HTTP/1.1, transform it to HTTP/2 and relay it to its final destination, either to the [Apple Push Notification Service (APNS)](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/APNSOverview.html#//apple_ref/doc/uid/TP40008194-CH8-SW1) and [Google Fire Cloud Messaging (FCM)](https://firebase.google.com/docs/cloud-messaging) services.
|
||||
|
||||
The **post-proxy relay** [can be configured using the Mattermost Push Proxy installation guide](/developers/contribute/more-info/mobile/push-notifications/service) with connection restrictions to meet your custom security and compliance requirements.
|
||||
|
||||
You can also host in a trusted cloud environment such as AWS or Azure in place of a DMZ (this option may depend on your organization's internal policies).
|
||||
|
||||

|
||||
|
||||
###### 2. Whitelist Mattermost push notification proxy to bypass your corporate proxy server
|
||||
|
||||
Depending on your internal IT policy and approved waivers/exceptions, you may choose to deploy the [Mattermost Push Proxy](/developers/contribute/more-info/mobile/push-notifications/service) to connect directly to [Apple Push Notification Service (APNS)](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/APNSOverview.html#//apple_ref/doc/uid/TP40008194-CH8-SW1) without your corporate proxy.
|
||||
|
||||
You will need to [whitelist one subdomain and one port from Apple](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html#//apple_ref/doc/uid/TP40008194-CH11-SW1) for this option:
|
||||
|
||||
- Development server: `api.development.push.apple.com:443`
|
||||
- Production server: `api.push.apple.com:443`
|
||||
|
||||
###### 3. Run App Store versions of the Mattermost mobile apps
|
||||
|
||||
You can use the mobile applications hosted by Mattermost in the [Apple App Store](https://apps.apple.com/ca/app/mattermost/id1257222717) or [Google Play Store](https://play.google.com/store/apps/details?id=com.mattermost.rn) and connect with [Mattermost Hosted Push Notification Service (HPNS)](https://docs.mattermost.com/deploy/mobile-hpns.html) through your corporate proxy.
|
||||
|
||||
The use of hosted applications by Mattermost [can be deployed with Enterprise Mobility Management solutions via AppConfig](https://docs.mattermost.com/deploy/mobile-appconfig.html). Wrapping is not supported with this option.
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
title: "Set up push notifications"
|
||||
sidebar_position: 3
|
||||
---
|
||||
|
||||
When building a custom version of the Mattermost mobile app, you will also need to host your own [Mattermost Push Notification Service](https://github.com/mattermost/mattermost-push-proxy/releases) and make a few modifications to your Mattermost mobile app to be able to get push notifications.
|
||||
|
||||
1. Setup the custom mobile apps to receive push notifications
|
||||
- [Android](/developers/contribute/more-info/mobile/push-notifications/android)
|
||||
- [iOS](/developers/contribute/more-info/mobile/push-notifications/ios)
|
||||
2. [Setup the Mattermost push notification service](/developers/contribute/more-info/mobile/push-notifications/service)
|
||||
|
||||
If the use of a proxy server is required by your IT policy, see the [corporate proxy](/corporate-proxy) page.
|
||||
@@ -0,0 +1,50 @@
|
||||
---
|
||||
title: "iOS push notifications"
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
## Generate APNs Auth Key
|
||||
|
||||
To deliver push notifications on iOS, you need to authenticate with **Apple Push Notification service (APNs)**.
|
||||
Mattermost recommends using **token-based authentication** with an APNs Auth Key (`.p8`) instead of certificates.
|
||||
|
||||
---
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Apple Developer Program account
|
||||
- Registered iOS app Bundle ID with **Push Notifications** capability enabled
|
||||
|
||||
---
|
||||
|
||||
### 1. Create an APNs Auth Key
|
||||
|
||||
1. Sign in to [Apple Developer: Keys](https://developer.apple.com/account/resources/authkeys/list).
|
||||
2. Click **+** to register a new key.
|
||||

|
||||
3. **Enter a Key Name** to easily identify it later (e.g., *Mattermost Push Proxy*).
|
||||

|
||||
4. **Enable APNs** by checking the **Apple Push Notifications service (APNs)** box and click **Configure** to configure the key.
|
||||

|
||||
5. On the **Configure Key** screen:
|
||||
- Select an **Environment**: *Sandbox*, *Production*, or *Sandbox & Production*.
|
||||
- Choose a **Key Restriction**: *Team Scoped (All Topics)* or *Topic Specific*.
|
||||

|
||||
- If you select *Topic Specific*, add the topics (App IDs) you want to associate.
|
||||

|
||||
6. Click **Save**, then **Continue**.
|
||||
7. Review the Key details and click **Register**.
|
||||
8. Download the generated file `AuthKey_XXXXXXXXXX.p8` and store it securely.
|
||||
> You can only download the file once.
|
||||
9. Note the following values:
|
||||
- **Key ID** (from the Keys list)
|
||||
- **Team ID** (from your Apple Developer Membership)
|
||||
- **Bundle ID** (your app identifier, used as the APNs topic)
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
### 2. Next Steps
|
||||
|
||||
Once you’ve generated your APNs Auth Key and collected the Key ID, Team ID, and Bundle ID, continue to the [Push Notification Service setup](/developers/contribute/more-info/mobile/push-notifications/service) page to configure the Mattermost Push Notification Service (MPNS).
|
||||
@@ -0,0 +1,174 @@
|
||||
---
|
||||
title: "Push notification service"
|
||||
sidebar_position: 3
|
||||
---
|
||||
|
||||
Now that the app can receive push notifications, we need to make sure that the Mattermost Push Notification Service is able to send the notification to the device. This guide will focus on installing and configuring the push notification service.
|
||||
|
||||
### Requirements
|
||||
|
||||
- A Linux or FreeBSD box server with at least 1GB of memory.
|
||||
- A copy of the [Mattermost Push Notification Service](https://github.com/mattermost/mattermost-push-proxy/releases).
|
||||
- [Custom Android and/or iOS](/developers/contribute/more-info/mobile/build-your-own) Mattermost mobile apps.
|
||||
- An APNs Auth Key (`.p8`) obtained by following the [iOS Push Notifications guide](/developers/contribute/more-info/mobile/push-notifications/ios).
|
||||
- A Firebase Cloud Messaging Server key obtained by following the [Android Push Notifications guide](/developers/contribute/more-info/mobile/push-notifications/android).
|
||||
|
||||
## Install and upgrade
|
||||
|
||||
For the sake of making this guide simple we located the files at `/home/ubuntu/mattermost-push-proxy`. We've also elected to run the Push Notification Service as the `ubuntu` account for simplicity. We **recommend** setting up and running the service under a `mattermost-push-proxy` user account with limited permissions.
|
||||
|
||||
1. Download the latest Mattermost Push Notification Service:
|
||||
|
||||
`wget https://github.com/mattermost/mattermost-push-proxy/releases/download/vX.X.X/mattermost-push-proxy-linux-amd64.tar.gz`
|
||||
or
|
||||
`wget https://github.com/mattermost/mattermost-push-proxy/releases/download/vX.X.X/mattermost-push-proxy-freebsd-amd64.tar.gz`
|
||||
|
||||
```text
|
||||
In this command, `vX.X.X` refers to the release version you want to download. See [Mattermost Push Notification Service releases](https://github.com/mattermost/mattermost-push-proxy/releases).
|
||||
```
|
||||
|
||||
2. If you're upgrading a previous version of the Mattermost Push Notification Service make sure to back up your `mattermost-push-proxy.json` file before continuing.
|
||||
|
||||
3. Unzip the downloaded Mattermost Push Notification Service using:
|
||||
`tar -xvzf mattermost-push-proxy-linux-amd64.tar.gz`
|
||||
or
|
||||
`tar -xvzf mattermost-push-proxy-freebsd-amd64.tar.gz`
|
||||
|
||||
4. Configure the Mattermost Push Notification service by editing the `mattermost-push-proxy.json` file at `/home/ubuntu/mattermost-push-proxy/config`. Follow the steps in the [Android](#set-up-mattermost-push-notification-service-to-send-android-push-notifications)
|
||||
and [iOS](#set-up-mattermost-push-notification-service-to-send-ios-push-notifications) sections to replace the values in the config file.
|
||||
|
||||
5. Create a systemd unit file to manage the Mattermost Push Notification Services with systemd and log all output of the service to `/var/log/syslog` by running this command as root.
|
||||
```bash
|
||||
echo "[Unit]
|
||||
Description=Mattermost Push Notification Service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/sh -c '/home/ubuntu/mattermost-push-proxy/bin/mattermost-push-proxy | logger'
|
||||
WorkingDirectory=/home/ubuntu/mattermost-push-proxy
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target" >> /etc/systemd/system/mattermost-push-proxy.service
|
||||
```
|
||||
|
||||
To route the traffic through a separate proxy server, add `Environment="HTTP_PROXY=<http://server>"` under the `[Service]` section of the file. If you have an HTTPS server, then use `HTTPS_PROXY`. If you set both then `HTTPS_PROXY` will take higher priority than `HTTP_PROXY`.
|
||||
|
||||
6. Start the service with `sudo systemctl start mattermost-push-proxy` or restart with `sudo systemctl restart mattermost-push-proxy`. Use `sudo systemctl enable mattermost-push-proxy` to have systemd start the service on boot.
|
||||
|
||||
### Set up Mattermost push notification service to send Android push notifications
|
||||
|
||||
- Go to the [Firebase Console](https://console.firebase.google.com) and select the project you've created. Once in the dashboard, go to the project settings and select **Service Accounts**.
|
||||

|
||||

|
||||
|
||||
- Click on **Generate new private key** and store the downloaded file.
|
||||

|
||||
|
||||
- Open the **mattermost-push-proxy.json** file in the `mattermost-push-proxy/config` directory and look for the "ServiceFileLocation" entry under "AndroidPushSettings". Paste the location of the file as its value.
|
||||
```
|
||||
"ServiceFileLocation": "/path/to/downloaded_file"
|
||||
```
|
||||
|
||||
### Set up Mattermost push notification service to send iOS push notifications
|
||||
|
||||
Instead of certificates, we now recommend using an **APNs Auth Key (`.p8`)** to authenticate with Apple Push Notification service (APNs).
|
||||
If you haven’t generated your key yet, see [Generate an APNs Auth Key](/developers/contribute/more-info/mobile/push-notifications/ios).
|
||||
|
||||
- Open the **mattermost-push-proxy.json** file under the `mattermost-push-proxy/config` directory and configure it with your key details:
|
||||
|
||||
```json
|
||||
"ApplePushSettings":[
|
||||
{
|
||||
"Type":"apple_rn",
|
||||
"ApplePushUseDevelopment":true,
|
||||
"ApplePushTopic":"your.bundle.id",
|
||||
"AppleAuthKeyFile":"./config/beta/YourAuthKeyFile.p8",
|
||||
"AppleAuthKeyID":"YourAuthKeyID",
|
||||
"AppleTeamID":"YourAppleTeamID"
|
||||
}
|
||||
],
|
||||
```
|
||||
- **ApplePushTopic**: Your app’s bundle ID (APNs topic).
|
||||
- **AppleAuthKeyFile**: Path to the `.p8` file.
|
||||
- **AppleAuthKeyID**: Key ID from Apple Developer portal.
|
||||
- **AppleTeamID**: Team ID from Apple Developer Membership.
|
||||
- **ApplePushUseDevelopment**: `true` for sandbox APNs, `false` for production.
|
||||
|
||||
|
||||
<Note>
|
||||
If you are migrating from certificate-based authentication, you can remove the `ApplePushCertPrivate` field and replace it with the new `AppleAuthKeyFile`, `AppleAuthKeyID`, and `AppleTeamID` values.
|
||||
</Note>
|
||||
|
||||
|
||||
### Configure the Mattermost Server to use the Mattermost push notification service
|
||||
|
||||
- In your Mattermost instance, enable mobile push notifications.
|
||||
* Go to **System Console > Notifications > Mobile Push**.
|
||||
* Under **Send Push Notifications**, select **Manually enter Push Notification Service location**.
|
||||
* Enter the location of your Mattermost Push Notification Service in the **Push Notification Server** field.
|
||||
|
||||

|
||||
|
||||
- (Optional) Customize mobile push notification contents.
|
||||
* Go to **System Console > Notifications > Mobile Push**.
|
||||
* Select an option for **Push Notification Contents** to specify what type of information to include in the push notifications.
|
||||
* Most deployments choose to include the full message snippet in push notifications unless they have policies against it to protect confidential information.
|
||||
|
||||

|
||||
|
||||
- Finally, start your Mattermost Push Notification Service, and your app should start receiving push notifications.
|
||||
|
||||
### Test the Mattermost push notification service
|
||||
|
||||
* Verify that the server is functioning normally and test the push notification using curl:
|
||||
`curl http://127.0.0.1:8066/api/v1/send_push -X POST -H "Content-Type: application/json" -d '{"type": "message", "message": "test", "badge": 1, "platform": "PLATFORM", "server_id": "MATTERMOST_DIAG_ID", "device_id": "DEVICE_ID", "channel_id": "CHANNEL_ID"}'`
|
||||
|
||||
* Replace `MATTERMOST_DIAG_ID` with the value found by running the SQL query:
|
||||
```sql
|
||||
SELECT * FROM Systems WHERE Name = 'DiagnosticId';
|
||||
```
|
||||
* Replace `DEVICE_ID` with your device ID, which can be found using (where `your_email@example.com` is the email address of the user you are logged in as):
|
||||
```sql
|
||||
SELECT
|
||||
Email, DeviceId
|
||||
FROM
|
||||
Sessions,
|
||||
Users
|
||||
WHERE
|
||||
Sessions.UserId = Users.Id
|
||||
AND DeviceId != ''
|
||||
AND Email = 'your_email@example.com';
|
||||
```
|
||||
* Replace `CHANNEL_ID` with the Town Square channel ID, which can be found using:
|
||||
```sql
|
||||
SELECT Id FROM Channels WHERE DisplayName = 'Town Square';
|
||||
```
|
||||
|
||||
<Note title="Migration">
|
||||
Remove the `apple:`, `apple_rn`, `android:` or `android_rn:` prefix from your device ID before replacing `DEVICE_ID`. Use that prefix as the `PLATFORM` (make sure to remove the ":").
|
||||
</Note>
|
||||
|
||||
* You can also verify push notifications are working by opening your Mattermost site and mentioning a user who has push notifications enabled in **Settings > Notifications > Mobile Push Notifications**.
|
||||
|
||||
To view the log file, use:
|
||||
|
||||
```bash
|
||||
$ sudo tail -n 1000 /var/log/upstart/mattermost-push-proxy.log
|
||||
```
|
||||
|
||||
<Note title="Note">
|
||||
Note that device IDs can change somewhat frequently, as they are tied to a device session. If you're having trouble, double-check the latest device IDs by re-running the above queries.
|
||||
</Note>
|
||||
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
##### DeviceTokenNotForTopic
|
||||
|
||||
**For iOS / Apple Push Notifications**: If the logs are reflecting DeviceTokenNotForTopic (error 400) this may be because you're using an older / previous Device ID. Re-run the queries you need to get device IDs and test.
|
||||
|
||||
This could also be because you generated a key for the wrong bundle ID. The bundle ID used in `mattermost-push-proxy.json` should be the same one as the app, and should be for the same app it was generated for.
|
||||
|
||||
### Reporting issues
|
||||
|
||||
For issues with repro steps, please report to https://github.com/mattermost/mattermost/issues
|
||||
19
docs/develop/contribute/more-info/mobile/storybook.md
Normal file
19
docs/develop/contribute/more-info/mobile/storybook.md
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
title: "Storybook"
|
||||
sidebar_position: 6
|
||||
---
|
||||
|
||||
Storybook has been added to the `mobile` repository to help prototype components. To use Storybook:
|
||||
|
||||
1. In the root of the repository, run `npm run storybook`. This step automatically scans and loads all stories, then opens a new browser tab with the Storybook interface.
|
||||
|
||||
**Note**: When using a real device, you may need to configure the Storybook *Host URL* by updating the `.env` file in the root of the repository. When running in an emulator, the code tries to use the default network values.
|
||||
|
||||
2. Run the usual `npm run android` (or `npm run ios`) and `npm start` commands.
|
||||
3. Storybook has been integrated into the react-native dev menu.
|
||||
- On Mac OS, press CMD+D to open the dev menu when your app is running in an iOS Simulator, or press CMD+M when running in an Android emulator.
|
||||
- On Windows and Linux, press CTRL+M to open the dev menu, then select the "Storybook" option.
|
||||
- If running on a real device, shaking the device brings up the react-native dev menu. You can also press `d` in the terminal window where you ran `npm start`.
|
||||
4. The Storybook interface opens in the mobile app. The stories can be controlled either through the desktop browser Storybook UI or the mobile browser Storybook UI. Both will render the component on the device.
|
||||
|
||||
>**Caveat**: Promises are currently broken in Storybook for react native. Components using promises will not work correctly. There is a temporary hacky fix to work around this issue: [storybookjs/react-native#57](https://github.com/storybookjs/react-native/issues/57#issuecomment-737931284).
|
||||
77
docs/develop/contribute/more-info/mobile/unsigned/android.md
Normal file
77
docs/develop/contribute/more-info/mobile/unsigned/android.md
Normal file
@@ -0,0 +1,77 @@
|
||||
---
|
||||
title: "Sign unsigned Android builds"
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
With every Mattermost mobile app release, we publish the Android unsigned apk in in the [GitHub Releases](https://github.com/mattermost/mattermost-mobile/releases) page. This guide describes the steps needed to modify and sign the app, so it can be distributed and installed on Android devices.
|
||||
|
||||
#### Prerequisites
|
||||
|
||||
1. [Apktool](https://ibotpeaches.github.io/Apktool/) is a tool for reverse engineering Android apk files.
|
||||
2. [XMLStarlet](http://xmlstar.sourceforge.net/doc/UG/xmlstarlet-ug.html) is a set of command line utilities (tools) which can be used to transform, query, validate, and edit XML documents and files using a simple set of shell commands in the same way it is done for plain text files using UNIX `grep`, `sed`, `awk`, `diff`, `patch`, `join`, etc., commands.
|
||||
3. [JQ](https://stedolan.github.io/jq/) is like `sed` for JSON data - you can use it to slice, filter, map, and transform structured data with the same ease that `sed`, `awk`, and `grep` let you work with text.
|
||||
4. Android SDK as described in the [Developer Setup](/developers/contribute/more-info/mobile/developer-setup#additional-setup-for-android).
|
||||
5. Set up keys and Google Services as described in steps 2, 3, 4, and 6 of the [Build your own App guide](/developers/contribute/more-info/mobile/build-your-own/android#build-preparations).
|
||||
6. [sign-android](/scripts/sign-android) script to sign the Android app.
|
||||
|
||||
#### Sign tool
|
||||
|
||||
```bash
|
||||
Usage: sign-android <unsigned apk file>
|
||||
[-e|--extract path]
|
||||
[-p|--package-id packageID]
|
||||
[-g|--google-services path]
|
||||
[-d|--display-name displayName]
|
||||
outputApk
|
||||
Usage: sign-android -h|--help
|
||||
Options:
|
||||
-e, --extract path (Optional) Path to extract the unsigned APK file.
|
||||
By default the path of the unsigned APK is used.
|
||||
|
||||
-p, --package-id packageID (Optional) Specify the unique Android application ID.
|
||||
|
||||
-g, --google-services path (Optional) Path to the google-services.json file.
|
||||
Will setup the Firebase to receive Push Notifications.
|
||||
Warning: will apply only if packageID is set.
|
||||
|
||||
-d, --display-name displayName (Optional) Specify new application display name.
|
||||
By default "Mattermost" is used.
|
||||
|
||||
-h, --help Display help message.
|
||||
```
|
||||
|
||||
#### Sign the Mattermost Android app
|
||||
|
||||
Now that all requirements are met, it's time to sign the Mattermost app for Android. Most of the options of the signing tool are optional but you should use your own `package identifier`, `google services settings`, and change the `display name`.
|
||||
|
||||
* Create a folder that will serve as your working directory to store all the needed files.
|
||||
* Download the [sign-android](/scripts/sign-android) script and save it in your working directory.
|
||||
* Download the [Android unsigned build](https://github.com/mattermost/mattermost-mobile/releases) and save it in your working directory.
|
||||
* Open a terminal to your working directory and make sure the `sign-android` script is executable.
|
||||
|
||||
```
|
||||
$ ls -la
|
||||
total 49756
|
||||
drwxr-xr-x 4 user staff 128 Oct 2 08:12 .
|
||||
drwx------@ 59 user staff 1888 Oct 1 14:12 ..
|
||||
-rw-r--r-- 1 user staff 50685064 Sep 29 10:58 Mattermost-unsigned.apk
|
||||
-rw-r--r-- 1 user staff 2597 Oct 2 08:19 google-services.json
|
||||
-rwxr-xr-x 1 user staff 7005 Sep 30 12:47 sign-android
|
||||
```
|
||||
|
||||
* Sign the app
|
||||
|
||||
```bash
|
||||
$ ./sign-android Mattermost-unsigned.apk -p com.example.test -g google-services.json -d "My App" MyApp-signed.apk
|
||||
```
|
||||
|
||||
Once the code sign is complete you should have a signed APK in the working directory with the name **MyApp-signed.apk**.
|
||||
|
||||
---
|
||||
|
||||
<Note title="Note">
|
||||
The app name can be anything but be sure to use double quotes if the name includes white spaces. If you are using a `Google Services` JSON file, you need to specify a `package identifier` that has a corresponding client in the JSON configuration file.
|
||||
</Note>
|
||||
|
||||
|
||||
---
|
||||
22
docs/develop/contribute/more-info/mobile/unsigned/index.md
Normal file
22
docs/develop/contribute/more-info/mobile/unsigned/index.md
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
title: "Sign unsigned builds"
|
||||
sidebar_position: 4
|
||||
---
|
||||
|
||||
Mattermost publishes an unsigned build of the mobile app in the [GitHub Releases](https://github.com/mattermost/mattermost-mobile/releases) page with every version that gets released.
|
||||
|
||||
These unsigned builds cannot be distributed nor installed directly on devices until they are properly signed.
|
||||
|
||||
---
|
||||
|
||||
<Note title="Note">
|
||||
Android and Apple require all apps to be digitally signed with a certificate before they can be installed.
|
||||
</Note>
|
||||
|
||||
|
||||
---
|
||||
|
||||
To avoid rebuilding the apps from scratch, you could just **sign** the unsigned builds published by Mattermost with your certificates and keys.
|
||||
|
||||
- [Sign Unsigned Android](/developers/contribute/more-info/mobile/unsigned/android)
|
||||
- [Sign Unsigned iOS](/developers/contribute/more-info/mobile/unsigned/ios)
|
||||
92
docs/develop/contribute/more-info/mobile/unsigned/ios.md
Normal file
92
docs/develop/contribute/more-info/mobile/unsigned/ios.md
Normal file
@@ -0,0 +1,92 @@
|
||||
---
|
||||
title: "Sign unsigned iOS builds"
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
With every Mattermost mobile app release, we publish the iOS unsigned ipa in in the [GitHub Releases](https://github.com/mattermost/mattermost-mobile/releases) page, this guide describes the steps needed to modify and sign the app, so it can be distributed and installed on iOS devices.
|
||||
|
||||
#### Requisites
|
||||
|
||||
1. macOS with [Xcode](https://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt=12) installed. The minimum required version is **11.0**.
|
||||
2. Install the Xcode command line tools:
|
||||
```bash
|
||||
$ xcode-select --install
|
||||
```
|
||||
3. Set up your Certificate and Provisioning profiles as described in steps 1 and 2 for [Run on iOS Devices](/developers/contribute/more-info/mobile/developer-setup/run#run-on-ios-devices) in the Developer Setup.
|
||||
4. [sign-ios](/scripts/sign-ios) script to sign the iOS app.
|
||||
|
||||
#### Sign Tool
|
||||
|
||||
```bash
|
||||
Usage: sign-ios <unsigned ipa file>
|
||||
[-a|--app provisioning]
|
||||
[-n|--notification provisioning]
|
||||
[-s|--share provisioning]
|
||||
[-c|--certificate certificateName]
|
||||
[-g|--app-group-id appGroupId]
|
||||
[-d|--display-name displayName]
|
||||
outputIpa
|
||||
Usage: sign-ios -h|--help
|
||||
Options:
|
||||
-a, --app provisioning Provisioning profile for the main application.
|
||||
-a xxx.mobileprovision
|
||||
|
||||
-n, --notification provisioning Provisioning profile for the notification extension.
|
||||
-n xxx.mobileprovision
|
||||
|
||||
-s, --share provisioning Provisioning profile for the share extension.
|
||||
-s xxx.mobileprovision
|
||||
|
||||
-d, --display-name displayName (Optional) Specify new application display name.
|
||||
By default "Mattermost" is used.
|
||||
Warning: will apply for all nested apps and extensions.
|
||||
|
||||
-g, --app-group-id appGroupId Specify the app group identifier to use (AppGroupId).
|
||||
Warning: will apply for all nested apps and extensions.
|
||||
|
||||
-v, --verbose Verbose output.
|
||||
|
||||
-h, --help Display help message.
|
||||
```
|
||||
|
||||
#### Sign the Mattermost iOS app
|
||||
|
||||
Now that all requisites are met, it's time to sign the Mattermost app for iOS. Most of the options of the signing tool are mandatory
|
||||
and you should be using your own `provisioning profiles`, `certificate`, also you could change the app `display name`.
|
||||
|
||||
* Create a folder that will serve as your working directory to store all the needed files.
|
||||
* Download your **Apple Distribution certificate** from the [Apple Developer portal](https://developer.apple.com/account/resources/certificates/list) and save it in your working directory.
|
||||
* Install the previously downloaded certificate into your macOS Keychain. [Learn more](https://developer.apple.com/support/certificates).
|
||||
* Download your **Provisioning profiles** from the [Apple Developer portal](https://developer.apple.com/account/resources/profiles/list) and save it in your working directory.
|
||||
* Download the [sign-ios](/scripts/sign-ios) script and save it in your working directory.
|
||||
* Download the [iOS unsigned build](https://github.com/mattermost/mattermost-mobile/releases) and save it in your working directory.
|
||||
* Open a terminal to your working directory and make sure the `sign-ios` script is executable.
|
||||
|
||||
```
|
||||
$ ls -la
|
||||
total 81472
|
||||
drwxr-xr-x 7 user staff 224 Oct 11 10:54 .
|
||||
drwxr-xr-x 8 user staff 256 Oct 11 10:49 ..
|
||||
-rw-r--r--@ 1 user staff 75261811 Oct 2 12:44 Mattermost-unsigned.ipa
|
||||
-rw-r--r--@ 1 user staff 10746 Oct 2 10:30 app.mobileprovision
|
||||
-rw-r--r--@ 1 user staff 9963 Oct 2 10:30 noti.mobileprovision
|
||||
-rw-r--r--@ 1 user staff 10763 Oct 2 10:30 share.mobileprovision
|
||||
-rwxr-xr-x 1 user staff 38581 Oct 11 10:54 sign-ios
|
||||
```
|
||||
|
||||
* Sign the app
|
||||
|
||||
```bash
|
||||
$ ./sign-ios Mattermost-unsigned.ipa -c "Apple Distribution: XXXXXX. (XXXXXXXXXX)" -a app.mobileprovision -n noti.mobileprovision -s share.mobileprovision -g group.com.mattermost -d "My App Display Name" MyApp-signed.ipa
|
||||
```
|
||||
|
||||
Once the code sign is complete you should have a signed IPA in the working directory with the name **MyApp-signed.ipa**.
|
||||
|
||||
---
|
||||
|
||||
<Note title="Note">
|
||||
The app name can be anything but be sure to use double quotes if the name includes white spaces. The name of the `certificate` should match the name in the macOS Keychain.
|
||||
</Note>
|
||||
|
||||
|
||||
---
|
||||
Reference in New Issue
Block a user