It is difficult to configure push notifications. You need an iOS developer account and then configure an Apple id, configuration profile, and SSL certificate.
1. Certificate Signing Request
First, you need to sign the certificate request, which must be completed in Mac OS X by selecting "utility"> "key string access" in the system ", then, choose key string access> certificate assistant> request certificate from the certificate authority ...".
After selecting the "request certificate from Certificate Authority" menu, the certificate Assistant dialog box is displayed. Enter your email address in the user email address, and enter your name in the common name, then, select "Save to disk" in the "request" option ".
Click "continue" in the certificate Assistant dialog box, and the "Save Certificate file" dialog box appears.
2. Configure application push notifications
First, we need to create an app ID. The app ID we created is <team ID>. com.51work6. mypushnot. In the app ID list, click the configure hyperlink next to it to go to the application configuration page. Select enable for Apple push notification service to enable push notification support.
3. generate an SSL Certificate
Push SSL certificate can be configured in two ways: Development push SSL Certificate (configure certificate for development) and production push SSL Certificate (configure certificate for production ). In the development phase, configure the development push SSL Certificate and select the Configure button.
Select the continue button. In this dialog box, select the certificate signature file we requested in the previous section.
Select the generate button to start uploading the file, upload the file successfully, and generate the SSL certificate. on this page, click Download to download the generated SSL Certificate for later use.
Click the done button to close the dialog box and return to the configuration page.
4. Export the p12 file for the SSL Certificate
During programming, we need to use the p12 format file. p12 is used to store personal certificates and private keys. It usually contains a password protected in binary format.
The SSL Certificate file generated in the previous section is aps_development.cer. Double-click this file to display a prompt box for changing the key string. We need the system administrator password.
Open the key string access tool, select "Log on" as the key string on the left, select "my certificate" from the key string type below, and find "Apple development IOS push services: com.51work6. mypushnot ".
Right-click and choose "Apple development IOS push services: com.51work6. mypushnot" in the displayed dialog box ".
During the export process, you need to select the location and password for saving the file, and provide the password
After entering the password, click "OK". The system will also ask us to enter the administrator user password to allow this export operation.
Enter the password and select "Always allow" to export the file. Export the file "certificate. p12" to keep the file secure for later programming.
From IOS network programming and cloud application best practices: Guan Dongsheng @ Tony _ Guan Dongsheng