-
Notifications
You must be signed in to change notification settings - Fork 463
Update MPNS to use APNs AuthKey instead of certificates #1476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a638f19
e3f44f3
0ccb5ac
3705753
49d1b63
82b1db8
6ba0059
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,40 +1,55 @@ | ||
| --- | ||
| title: "iOS push notifications" | ||
| heading: "iOS push notifications" | ||
| description: "Push notifications on iOS are managed and dispatched using Apple’s Push Notification Service. Learn how to use this service with Mattermost." | ||
| date: 2015-05-20T11:35:32-04:00 | ||
| description: "Learn how to generate an APNs Auth Key for iOS push notifications." | ||
| date: 2025-09-19T08:44:00+08:00 | ||
| weight: 2 | ||
| aliases: | ||
| - /contribute/mobile/push-notifications/ios | ||
| --- | ||
|
|
||
| Push notifications on iOS are managed and dispatched using {{< newtabref href="https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/APNSOverview.html" title="Apple's Push Notification Service" >}}. You must have a **Paid Apple Developer account** to create certificates needed to send notifications using this service. | ||
| ## Generate APNs Auth Key | ||
|
|
||
| - Generate a Certificate from Keychain Access | ||
| - Launch the **Keychain Access application** in your Mac and select **KeyChain Access -\Certificate Assistant -\Request a Certificate From a Certificate Authority...** | ||
|  | ||
| 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. | ||
|
|
||
| - Enter your email address in **User Email Address** and check the **"Save to disk"** option, then click **Continue** | ||
|  | ||
|
|
||
| - Save the certificate request | ||
|  | ||
| --- | ||
|
|
||
| - Log in to {{< newtabref href="https://developer.apple.com/account" title="Apple developer account" >}} and click **Certificates, Identifiers and Profiles** | ||
|  | ||
| ### Prerequisites | ||
|
|
||
| - Select the plus icon to create a new certificate | ||
|  | ||
| - Apple Developer Program account | ||
| - Registered iOS app Bundle ID with **Push Notifications** capability enabled | ||
|
|
||
| - Select a new "Apple Push Notifications service SSL (Sandbox & Production)" | ||
|  | ||
| --- | ||
|
|
||
| - Choose the App ID you're generating a certificate for. Use the regular App ID for the Mattermost app, **not** for the `.NotificationService`, etc. | ||
|  | ||
| ### 1. Create an APNs Auth Key | ||
|
|
||
| 1. Sign in to {{< newtabref href="https://developer.apple.com/account/resources/authkeys/list" title="Apple Developer: Keys" >}}. | ||
| 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) | ||
|
|
||
|  | ||
|
|
||
| - Choose the certificate request file created using the Keychain access in the previous section and select **Continue**. | ||
|  | ||
| --- | ||
|
|
||
| - Download the Certificate and click **Done** to finish the process | ||
| ### 2. Next Steps | ||
|
|
||
| At this point, you can build the Mattermost app for iOS and use the above downloaded certificate to setup the [Mattermost Push Notification Service]({{< ref "/contribute/more-info/mobile/push-notifications/service" >}}). | ||
| 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]({{< ref "/contribute/more-info/mobile/push-notifications/service" >}}) page to configure the Mattermost Push Notification Service (MPNS). |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,7 +1,7 @@ | ||||||
| --- | ||||||
| title: "Push notification service" | ||||||
| heading: "Install the Mattermost push notification service" | ||||||
| description: "This guide focuses on installing and configuring the push notification service for Mattermost apps." | ||||||
| description: "Learn how to configure the Mattermost Push Notification Service (MPNS) with iOS and Android credentials." | ||||||
| date: 2015-05-20T11:35:32-04:00 | ||||||
| weight: 3 | ||||||
| aliases: | ||||||
|
|
@@ -12,25 +12,30 @@ Now that the app can receive push notifications, we need to make sure that the M | |||||
|
|
||||||
| ### Requirements | ||||||
|
|
||||||
| - A Linux box server with at least 1GB of memory. | ||||||
| - A Linux or FreeBSD box server with at least 1GB of memory. | ||||||
| - A copy of the {{< newtabref href="https://github.com/mattermost/mattermost-push-proxy/releases" title="Mattermost Push Notification Service" >}}. | ||||||
| - [Custom Android and/or iOS]({{< ref "/contribute/more-info/mobile/build-your-own" >}}) Mattermost mobile apps. | ||||||
| - Private and public keys obtained from the {{< newtabref href="https://developer.apple.com/account/ios/certificate/" title="Apple Developer Program" >}}. | ||||||
| - A Firebase Cloud Messaging Server key obtained from the {{< newtabref href="https://console.firebase.google.com" title="Firebase Console" >}}. | ||||||
| - An APNs Auth Key (`.p8`) obtained by following the [iOS Push Notifications guide]({{< ref "/contribute/more-info/mobile/push-notifications/ios" >}}). | ||||||
| - A Firebase Cloud Messaging Server key obtained by following the [Android Push Notifications guide]({{< ref "/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 Mattermost Push Notification Service (any version): | ||||||
| 1. Download the latest Mattermost Push Notification Service: | ||||||
|
|
||||||
| `wget https://github.com/mattermost/mattermost-push-proxy/releases/download/vX.X.X/mattermost-push-proxy.tar.gz` (`mattermost-push-proxy-X.X.X.tar.gz` for releases earlier than v5.9) | ||||||
| `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` | ||||||
|
|
||||||
| In this command, `vX.X.X` refers to the release version you want to download. See {{< newtabref href="https://github.com/mattermost/mattermost-push-proxy/releases" title="Mattermost Push Notification Service 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.tar.gz` | ||||||
| 3. Unzip the downloaded Mattermost Push Notification Service using: | ||||||
| `tar -xvzf mattermost-push-proxy-linux-amd64.tar.gz` | ||||||
|
||||||
| `tar -xvzf mattermost-push-proxy-linux-amd64.tar.gz` | |
| `tar -xvzf mattermost-push-proxy-linux-amd64.tar.gz` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trailing spaces after the backticks on lines 27 and 29 create unnecessary whitespace in the rendered documentation. Remove the trailing spaces for cleaner formatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made this on purpose so that it spans to the next line