Summary of Push usage

Source: Internet
Author: User

It's not hard to integrate a push in an iOS client, and with the official documentation and demo, there are several important timing diagrams that run several times and probably know how to write the code.

Here's a recap of the push code flow based on your own understanding:

1, create a push SKD object, SKD will send ClientID to a push server, and asynchronously return ClientID. A push server uses ClientID to uniquely identify each device, and after receiving ClientID, you can upload clientid and user information to the app server.

2, to Apple Server registration APNs, received Devicetoken, call a push SKD method will devicetoken and ClientID binding.

3, the app server can use ClientID to push information to the device: (1) If the app is in the foreground, the information will be transferred from the app server to a push server, by a push server to find the corresponding device through ClientID. (2) If the app switches to the background, this time the Push SDK is turned off, push the message through APNs, Devicetoken to find the corresponding device.

Push SDK calls are recommended in the main thread to ensure thread safety.

The next point is to keep a record of where I'm going:

1, a push release environment and the development environment to upload different certificates, the app installed with the release certificate cannot receive the push message of the development environment certificate.

2. It takes 24 hours to replace the development certificate and publish the certificate, the reason: When the new certificate comes into effect, there will be a new devicetoken, but the pit dad's push is actually going to be 24 hours apart before the ClientID and Devicetoken will be re-bound, So this time ClientID does not map to the correct devicetoken, so the background push cannot succeed. WORKAROUND: You can register two tweets with one app, upload different certificates, use different appkey, so you don't need 24 hours of waiting.

3, through the message: is said to be a custom message, distinguish between ordinary notifications.

Summary of Push usage

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.