|
5 | 5 | author: spelluru
|
6 | 6 | ms.service: notification-hubs
|
7 | 7 | ms.topic: include
|
8 |
| - ms.date: 04/11/2018 |
| 8 | + ms.date: 08/28/2018 |
9 | 9 | ms.author: spelluru
|
10 | 10 | ms.custom: include file
|
11 | 11 | ---
|
12 |
| - |
13 | 12 | ## Generate the certificate signing request file
|
| 13 | + |
14 | 14 | The Apple Push Notification Service (APNS) uses certificates to authenticate your push notifications. Follow these instructions to create the necessary push certificate to send and receive notifications. For more information on these concepts, see the official [Apple Push Notification Service](http://go.microsoft.com/fwlink/p/?LinkId=272584) documentation.
|
15 | 15 |
|
16 | 16 | Generate the Certificate Signing Request (CSR) file, which is used by Apple to generate a signed push certificate.
|
17 | 17 |
|
18 |
| -1. On your Mac, run the Keychain Access tool. It can be opened from the **Utilities** folder or the **Other** folder on the launch pad. |
| 18 | +1. On your Mac, run the **Keychain Access** tool. It can be opened from the **Utilities** folder or the **Other** folder on the launch pad. |
19 | 19 | 2. Click **Keychain Access**, expand **Certificate Assistant**, then click **Request a Certificate from a Certificate Authority...**.
|
20 |
| - |
21 |
| -  |
| 20 | + |
| 21 | +  |
22 | 22 | 3. Select your **User Email Address** and **Common Name**, make sure that **Saved to disk** is selected, and then click **Continue**. Leave the **CA Email Address** field blank as it is not required.
|
23 |
| - |
24 |
| -  |
| 23 | + |
| 24 | +  |
| 25 | + |
25 | 26 | 4. Type a name for the Certificate Signing Request (CSR) file in **Save As**, select the location in **Where**, then click **Save**.
|
26 |
| - |
27 |
| -  |
28 |
| - |
29 |
| - This action saves the CSR file in the selected location; the default location is in the Desktop. Remember the location chosen for the file. |
| 27 | + |
| 28 | +  |
| 29 | + |
| 30 | + This action saves the CSR file in the selected location; the default location is in the Desktop. Remember the location chosen for the file. |
30 | 31 |
|
31 | 32 | Next, you register your app with Apple, enable push notifications, and upload the exported CSR to create a push certificate.
|
32 | 33 |
|
33 | 34 | ## Register your app for push notifications
|
| 35 | + |
34 | 36 | To be able to send push notifications to an iOS app, you must register your application with Apple and also register for push notifications.
|
35 | 37 |
|
36 |
| -1. If you have not already registered your app, navigate to the <a href="http://go.microsoft.com/fwlink/p/?LinkId=272456" target="_blank">iOS Provisioning Portal</a> at the Apple Developer Center, sign in with your Apple ID, click **Identifiers**, then click **App IDs**, and finally click on the **+** sign to register a new app. |
37 |
| - |
38 |
| -  |
39 |
| - |
| 38 | +1. If you have not already registered your app, navigate to the [iOS Provisioning Portal](http://go.microsoft.com/fwlink/p/?LinkId=272456) at the Apple Developer Center, sign in with your Apple ID, click **Identifiers**, then click **App IDs**, and finally click on the **+** sign to register a new app. |
| 39 | + |
| 40 | +  |
| 41 | + |
40 | 42 | 2. Update the following three fields for your new app and then click **Continue**:
|
41 |
| - |
42 |
| - * **Name**: Type a descriptive name for your app in the **Name** field in the **App ID Description** section. |
43 |
| - * **Bundle Identifier**: Under the **Explicit App ID** section, enter a **Bundle Identifier** in the form `<Organization Identifier>.<Product Name>` as mentioned in the [App Distribution Guide](https://developer.apple.com/library/mac/documentation/IDEs/Conceptual/AppDistributionGuide/ConfiguringYourApp/ConfiguringYourApp.html#//apple_ref/doc/uid/TP40012582-CH28-SW8). The *Organization Identifier* and *Product Name* you use must match the organization identifier and product name you use when you create your XCode project. In the following screenshot *NotificationHubs* is used as an organization identifier and *GetStarted* is used as the product name. Making sure this value matches the value you use in your XCode project allows you to use the correct publishing profile with XCode. |
44 |
| - * **Push Notifications**: Check the **Push Notifications** option in the **App Services** section. |
45 |
| - |
46 |
| -  |
47 |
| - |
48 |
| - This action generates your App ID and requests you to confirm the information. Click **Register** to confirm the new App ID. |
49 |
| - |
50 |
| - Once you click **Register**, you see the **Registration complete** screen, as shown in the following image. Click **Done**. |
51 |
| - |
52 |
| -  |
53 |
| - |
54 |
| - |
55 |
| -1. In the Developer Center, under App IDs, locate the app ID that you created, and click on its row. |
56 |
| - |
57 |
| -  |
58 |
| - |
59 |
| - Clicking on the app ID displays the app details. Click the **Edit** button at the bottom. |
60 |
| - |
61 |
| -  |
62 |
| - |
63 |
| -2. Scroll to the bottom of the screen, and click the **Create Certificate...** button under the section **Development Push SSL Certificate**. |
64 |
| - |
65 |
| -  |
66 |
| - |
67 |
| - You see the "Add iOS Certificate" assistant. |
68 |
| - |
69 |
| - > [!NOTE] |
70 |
| - > This tutorial uses a development certificate. The same process is used when registering a production certificate. Just make sure that you use the same certificate type when sending notifications. |
71 |
| - > |
72 |
| - > |
73 |
| -3. Click **Choose File**, browse to the location where you saved the CSR file that you created in the first task, then click **Generate**. |
74 |
| - |
75 |
| -  |
76 |
| -4. After the certificate is created by the portal, click the **Download** button, and click **Done**. |
77 |
| - |
78 |
| -  |
79 |
| - |
80 |
| - It downloads the certificate and saves it to your computer in your Downloads folder. |
81 |
| - |
82 |
| -  |
83 |
| - |
84 |
| - > [!NOTE] |
85 |
| - > By default, the downloaded file a development certificate is named **aps_development.cer**. |
86 |
| - > |
87 |
| - > |
88 |
| -5. Double-click the downloaded push certificate **aps_development.cer**. |
89 |
| - |
90 |
| - This action installs the new certificate in the Keychain, as shown in the following image: |
91 |
| - |
92 |
| -  |
93 |
| - |
94 |
| - > [!NOTE] |
95 |
| - > The name in your certificate might be different, but it will be prefixed with **Apple Development iOS Push Services**. |
96 |
| -6. In Keychain Access, right-click the new push certificate that you created in the **Certificates** category. Click **Export**, name the file, select the **.p12** format, and then click **Save**. |
97 |
| - |
98 |
| -  |
99 |
| - |
| 43 | + |
| 44 | + * **Name**: Type a descriptive name for your app in the **Name** field in the **App ID Description** section. |
| 45 | + * **Bundle Identifier**: Under the **Explicit App ID** section, enter a **Bundle Identifier** in the form `<Organization Identifier>.<Product Name>` as mentioned in the [App Distribution Guide](https://developer.apple.com/library/mac/documentation/IDEs/Conceptual/AppDistributionGuide/ConfiguringYourApp/ConfiguringYourApp.html#//apple_ref/doc/uid/TP40012582-CH28-SW8). The *Organization Identifier* and *Product Name* you use must match the organization identifier and product name you use when you create your XCode project. In the following screenshot *NotificationHubs* is used as an organization identifier and *GetStarted* is used as the product name. Making sure this value matches the value you use in your XCode project allows you to use the correct publishing profile with XCode. |
| 46 | + * **Push Notifications**: Check the **Push Notifications** option in the **App Services** section. |
| 47 | + |
| 48 | +  |
| 49 | + |
| 50 | + This action generates your App ID and requests you to confirm the information. Click **Register** to confirm the new App ID. |
| 51 | + |
| 52 | + Once you click **Register**, you see the **Registration complete** screen, as shown in the following image. Click **Done**. |
| 53 | + |
| 54 | +  |
| 55 | + |
| 56 | +3. In the Developer Center, under App IDs, locate the app ID that you created, and click on its row. |
| 57 | + |
| 58 | +  |
| 59 | + |
| 60 | + Clicking on the app ID displays the app details. Click the **Edit** button at the bottom. |
| 61 | + |
| 62 | +  |
| 63 | + |
| 64 | +4. Scroll to the bottom of the screen, and click the **Create Certificate...** button under the section **Development Push SSL Certificate**. |
| 65 | + |
| 66 | +  |
| 67 | + |
| 68 | + You see the **Add iOS Certificate**"** assistant. |
| 69 | + |
| 70 | + > [!NOTE] |
| 71 | + > This tutorial uses a development certificate. The same process is used when registering a production certificate. Just make sure that you use the same certificate type when sending notifications. |
| 72 | +
|
| 73 | +5. Click **Choose File**, browse to the location where you saved the CSR file that you created in the first task, then click **Generate**. |
| 74 | + |
| 75 | +  |
| 76 | + |
| 77 | +6. After the certificate is created by the portal, click the **Download** button, and click **Done**. |
| 78 | + |
| 79 | +  |
| 80 | + |
| 81 | + It downloads the certificate and saves it to your computer in your **Downloads** folder. |
| 82 | + |
| 83 | +  |
| 84 | + |
| 85 | + > [!NOTE] |
| 86 | + > By default, the downloaded file a development certificate is named **aps_development.cer**. |
| 87 | +
|
| 88 | +7. Double-click the downloaded push certificate **aps_development.cer**. |
| 89 | + |
| 90 | + This action installs the new certificate in the Keychain, as shown in the following image: |
| 91 | + |
| 92 | +  |
| 93 | + |
| 94 | + > [!NOTE] |
| 95 | + > The name in your certificate might be different, but it will be prefixed with **Apple Development iOS Push Services**. |
| 96 | +
|
| 97 | +8. In Keychain Access, right-click the new push certificate that you created in the **Certificates** category. Click **Export**, name the file, select the **.p12** format, and then click **Save**. |
| 98 | + |
| 99 | +  |
| 100 | + |
100 | 101 | Make a note of the file name and location of the exported .p12 certificate. It is used to enable authentication with APNS.
|
101 |
| - |
102 |
| - > [!NOTE] |
103 |
| - > This tutorial creates a QuickStart.p12 file. Your file name and location might be different. |
104 |
| - |
| 102 | + |
| 103 | + > [!NOTE] |
| 104 | + > This tutorial creates a QuickStart.p12 file. Your file name and location might be different. |
| 105 | +
|
105 | 106 | ## Create a provisioning profile for the app
|
106 |
| -1. Back in the <a href="http://go.microsoft.com/fwlink/p/?LinkId=272456" target="_blank">iOS Provisioning Portal</a>, select **Provisioning Profiles**, select **All**, and then click the **+** button to create a new profile. You see the **Add iOS Provisioning Profile** Wizard |
107 |
| - |
108 |
| -  |
109 |
| -2. Select **iOS App Development** under **Development** as the provisioning profile type, and click **Continue**. |
| 107 | + |
| 108 | +1. Back in the [iOS Provisioning Portal](http://go.microsoft.com/fwlink/p/?LinkId=272456), select **Provisioning Profiles**, select **All**, and then click the **+** (plus) button to create a new profile. You see the **Add iOS Provisioning Profile** wizard: |
| 109 | + |
| 110 | +  |
| 111 | + |
| 112 | +2. Select **iOS App Development** under **Development** as the provisioning profile type, and click **Continue**. |
| 113 | + |
110 | 114 | 3. Next, select the app ID you created from the **App ID** drop-down list, and click **Continue**
|
111 |
| - |
112 |
| -  |
| 115 | + |
| 116 | +  |
| 117 | + |
113 | 118 | 4. In the **Select certificates** screen, select your usual development certificate used for code signing, and click **Continue**. This certificate is not the push certificate you created.
|
114 |
| - |
115 |
| -  |
| 119 | + |
| 120 | +  |
| 121 | + |
116 | 122 | 5. Next, select the **Devices** to use for testing, and click **Continue**
|
117 |
| - |
118 |
| -  |
| 123 | + |
| 124 | +  |
| 125 | + |
119 | 126 | 6. Finally, pick a name for the profile in **Profile Name**, click **Generate**.
|
120 |
| - |
121 |
| -  |
| 127 | + |
| 128 | +  |
| 129 | + |
122 | 130 | 7. When the new provisioning profile is created click to download it and install it on your Xcode development machine. Then click **Done**.
|
123 |
| - |
124 |
| -  |
| 131 | + |
| 132 | +  |
0 commit comments