Skip to content

Commit e7f52b0

Browse files
committed
Add Twilio Notify instructions
1 parent cd21132 commit e7f52b0

File tree

1 file changed

+99
-11
lines changed
  • src/engage/campaigns/mobile-push

1 file changed

+99
-11
lines changed

src/engage/campaigns/mobile-push/index.md

Lines changed: 99 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ You'll set up mobile push in four stages:
1515

1616
1. [Set up analytics for mobile push](#1-set-up-analytics-for-mobile-push).
1717
2. [Add the Engage SDK plugin](#2-add-the-engage-sdk-plugin).
18-
3. [Configure push credentials](#3-configure-push-credentials).
19-
4. [Configure mobile push in Engage](#4-configure-mobile-push-in-engage).
18+
3. [Configure iOS push notifications](#3-configure-ios-push-notifications).
19+
4. [Configure Android push notifications](#4-configure-android-push-notifications).
20+
5. [Configure mobile push in Engage](#5-configure-mobile-push-in-engage).
2021

2122
## 1. Set up analytics for mobile push
2223

@@ -224,15 +225,102 @@ Now that you've integrated Analytics for Kotlin, follow these steps to add the E
224225
225226
The previous steps are required. For configuration options, including subscription statuses and customized actions, visit the [getting started section](https://github.com/segment-integrations/analytics-kotlin-engage#getting-started){:target="_blank"} of Segment's Twilio Engage Destination documentation on GitHub.
226227
227-
## 3. Configure push credentials
228+
Next, you'll configure your iOS and Android push credentials for use with Twilio Notify and Twilio Notifications.
228229
229-
In this step, you'll configure your iOS and Android push credentials for use with Twilio Notify and Twilio Notifications.
230+
## 3. Configure iOS push notifications
230231
231-
### Configure iOS push notifications
232+
### 3a. Set up an App ID
232233
233-
Follow the steps in Twilio's [How to Configure iOS Push Notifications documentation](https://www.twilio.com/docs/notify/configure-ios-push-notifications){:target="_blank"}.
234+
Before you begin, log into your [Apple development account](https://developer.apple.com/account){:target="_blank"} and click on **Identifiers** under the **Certificates, Identifiers & Profiles** section. This will show a list of identifiers, including App IDs.
234235
235-
### Configure Android push notifications
236+
#### Option 1: Use an existing App ID
237+
238+
1. If your App ID is already on this list, click on it; a list of capabilities will pop up.
239+
2. Check the **Push Notifications** option.
240+
3. Ignore the **Configure** button for now. Click **Save**.
241+
242+
#### Option 2: Create a new App ID
243+
244+
1. If your App ID isn’t on this list, click the **+** symbol to add a new App ID.
245+
2. Choose **App IDs** and click the **Continue** button.
246+
3. Give your app a description.
247+
4. Enter an Explicit Bundle ID that matches the bundle identifier (such as `com.twilio.notify.NotifyQuickstart`) of your app in Xcode.
248+
5. Under **Capabilities**, check **Push Notifications**.
249+
6. Click **Continue**.
250+
7. Click **Register** to confirm and create your new App ID.
251+
252+
### 3b. Create a certificate
253+
254+
Next, you’ll create a push notification certificate, which lets your app receive notifications. You can either make a development certificate or a production certificate. This guide explains how to make a development certificate. Segment recommends that you use Xcode managed certificates.
255+
256+
#### Option 1: Use an Xcode managed certificate
257+
258+
1. In your Xcode project, go to the **General** pane of the target for your iOS application.
259+
2. In the **Signing** section, check **Automatically manage signing**.
260+
3. If you are using the Quickstart app and see a provisioning error message, you may need to rename the bundle ID to a unique identifier. To do so, [give your bundle a new name](https://developer.apple.com/account/resources/certificates/list){:target="_blank"}, then enter your new identifier in the **Identity** section of the General pane.
261+
4. Go to the **Capabilities** tab and make sure that Push Notifications are enabled.
262+
5. Verify that you successfully created your certificates:
263+
- Sign in to the Apple developer portal and click on **Certificates, IDs & Profile**. In the **Certificates** section, select **Development** or **Production**, depending on the type of certificate you want to verify.
264+
- Alternatively, go to **Applications > Utilities > Keychain Access** and select **Certificates**. Search for `iPhone`, and verify that your certificate has a disclosure triangle, which indicates that your private key exists in the keychain.
265+
266+
#### Option 2: Manually create a certificate
267+
268+
Segment recommends that you use Xcode managed certificates for your application. If you prefer to create your certificate manually, follow these steps:
269+
270+
1. Add a certificate on the [Apple Developer Portal](https://developer.apple.com/account/resources/certificates/add){:target="_blank"}.
271+
2. Under **Services**, select **Apple Push Notification service SSL (Sandbox & Production)**, then click **Continue**.
272+
3. In the text box, select the App ID you previously created, then click **Continue**.
273+
4. You're prompted to create a Certificate Signing Request (CSR) and given instructions on how to do it. Create one.
274+
5. Once you've created a CSR, click **Continue**.
275+
6. Upload the CSR, then click **Generate** to generate your certificate.
276+
277+
You just created an Apple Development iOS Push Services certificate, which you can now download and double-click to add to your Mac’s keychain.
278+
279+
### 3c. Create a credential for Twilio
280+
281+
1. On your Mac, go to **Applications > Utilities > Keychain Access**, then select **My Certificates**.
282+
2. Right-click your new certificate. It should be labeled **Apple Development iOS Push Services**.
283+
3. Choose **Export**.
284+
4. Save your credential file as `cred.p12`; leave the password blank.
285+
286+
You will extract your certificate key and private key from this file — you need these two keys to create a Twilio credential. First, run this command in Terminal:
287+
288+
```zsh
289+
openssl pkcs12 -in cred.p12 -nokeys -out cert.pem -nodes
290+
```
291+
292+
`cert.pem` is your certificate key file. Next, run the following command in the terminal:
293+
294+
```zsh
295+
openssl pkcs12 -in cred.p12 -nocerts -out key.pem -nodes
296+
297+
```
298+
299+
`key.pem` is your private key file. Next, run this command to process this key:
300+
301+
```zsh
302+
openssl rsa -in key.pem -out key.pem
303+
```
304+
305+
You can now paste your credentials into the modal found in the Twilio Console. Make sure that you strip anything **outside** of the `-----BEGIN CERTIFICATE-----` and `-----END CERTIFICATE-----` boundaries and outside of the `-----BEGIN RSA PRIVATE KEY-----` and `-----END RSA PRIVATE KEY-----` boundaries before pasting your credentials. Check the **Sandbox** button if you made a development certificate. Sandbox is synonymous with development mode.
306+
307+
> warning ""
308+
> Once you save a credential, the `CERTIFICATE` and `PRIVATE KEY` fields are hidden for security reasons.
309+
310+
After you've pasted your credentials, click **Save**. You should see a SID appear on the new page; copy it to your clipboard, as you'll need it in the next step.
311+
312+
313+
### 3d. Configure your Twilio Service to use your APNS credentials
314+
315+
Twilio lets you build multiple applications within a single account. To separate those applications, you need to create Service instances that hold all the data and configuration for a given application.
316+
317+
To do so, you'll to configure your Service instance to use the Credential that contains your APNS certificate and private key. You can do that using the Services page in the Console. You’ll need to update your Service with the Twilio Push Credential SID.
318+
319+
If you're just getting started, set up the APN credential first, then create your Service by clicking the blue plus button on the [Services Console](https://console.twilio.com/us1/develop/notify/services?frameUrl=%2Fconsole%2Fnotify%2Fservices%3Fx-target-region%3Dus1&_ga=2.170545120.1341805708.1700099403-1979911827.1631664239&_gl=1*1msrgrt*_ga*MTk3OTkxMTgyNy4xNjMxNjY0MjM5*_ga_RRP8K4M4F3*MTcwMDEwNTYwOC45Ny4xLjE3MDAxMDU2MjAuMC4wLjA.){:target="_blank"} page.
320+
321+
For more information, view Twilio's [How to Configure iOS Push Notifications documentation](https://www.twilio.com/docs/notify/configure-ios-push-notifications){:target="_blank"}.
322+
323+
## 4. Configure Android push notifications
236324

237325
Follow the steps in Twilio's [Configuring Android Push Notifications](https://www.twilio.com/docs/notify/configure-android-push-notifications){:target="_blank"}.
238326

@@ -246,11 +334,11 @@ During Step 5, [Upload your API Key to Twilio](https://www.twilio.com/docs/notif
246334

247335
With your server key copied, finish steps 5 and 6 in the Twilio documentation.
248336

249-
## 4. Configure mobile push in Engage
337+
## 5. Configure mobile push in Engage
250338

251339
Follow these steps to set up mobile push in Twilio Engage.
252340

253-
### 4a. Set up Twilio credentials
341+
### 5a. Set up Twilio credentials
254342

255343
> success ""
256344
> Follow the steps in 4a only if you're new to Twilio Engage Premier. If you've already [configured messaging services](/docs/engage/onboarding/#generate-an-api-key-and-select-your-messaging-services) as part of Twilio Engage Premier onboarding, you can skip to 4b.
@@ -267,7 +355,7 @@ Follow these steps to set up mobile push in Twilio Engage.
267355
12. Click **Verify**, then select the messaging services you want to use in your space.
268356
13. Click **Save Twilio Account.**
269357

270-
### 4b. Create a new push service
358+
### 5b. Create a new push service
271359

272360
Complete mobile push onboarding by creating a new push service:
273361

@@ -277,6 +365,6 @@ Complete mobile push onboarding by creating a new push service:
277365
4. Name the push service, select or create APN and FCM credentials, then click **Create Push Service**.
278366
5. Your new messaging service appears in the **Add messaging services** dropdown. Select it, then click **Save**.
279367

280-
## 5. Build a mobile push template
368+
## Build a mobile push template
281369

282370
Now that you've completed mobile push setup, you're ready to [build a mobile push template](/docs/engage/content/mobile-push/).

0 commit comments

Comments
 (0)