Steps for pushing pigeon mail (ios)
We have studied the push mechanism of ios over the past two days. Here we will introduce the push mechanism of Xin Ge:
The application configuration first enters the pigeon, creates an application, and then click the Application List on the console: for example:
Click application configuration. The application configuration page is displayed:
In the development environment, add a test device:
When you move the mouse over the test device, the modify button is displayed. click the button to display the add device interface (device token: udid)
Add release and test certificate
After the certificate is set,
Open the terminal and find the project directory.
(It must be in the corresponding directory. When I first verified it, I directly reported an error in the root directory and could not find the file. Later I found that it should be verified in the project directory !!), Verify whether the certificate is valid:
Development Certificate: openssl s_client-connect gateway.sandbox.push.apple.com: 2195-cert xxx. pem-key xxx. pem
Test Certificate: openssl s_client-connect gateway.push.apple.com: 2195-cert xxx. pem-key xxx. pem
After the verification is valid, upload the certificate. Hover the mouse over the development certificate. When the certificate is generated, the upload button is displayed. Click Upload. The corresponding interface is displayed. Upload the certificate. Access SDK
According to the access on the document, there is generally no problem. In the development environment, set a specified account: (this account will be used when sending notifications. In the development environment, set this account, check whether the specified device has received the notification. If it is a release environment, set it as needed)
Click the notification to go to the corresponding interface and implement it in the following method:
- (void)application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary*)userInfo{}
Now, the application configuration and SDK access have been completed, and you can finally test and send a notification !!
Send notification
On the application configuration page, click Create notification on the left-side toolbar. The create notification page is displayed:
As shown in, there are some differences between the production environment and the development environment. You can select all devices or some accounts as needed for the user scope of the production environment. The user scope of the development environment is a single account, and the account isAccess SDK
[XGPush setAccount: @ "123456"]; In appdelegate, add it here, and fill in the corresponding content. Click send. When a prompt is displayed, the notification is successfully sent!
The last reminder is that the certificate must be set correctly !!!