Push mechanism for iOS apns: local push & remote push

Source: Internet
Author: User
<span id="Label3"></p><p><p><span style="font-family: ‘Microsoft YaHei‘; font-size: 14pt;">Local Push:</span></p></p><p><p><span style="font-family: ‘Microsoft YaHei‘; font-size: 15px;">Local push is mainly used in memos, alarms and other local, time-based message Reminders. This article does not describe in Detail.</span></p></p><p><p></p></p><p><p><span style="font-family: ‘Microsoft YaHei‘; font-size: 14pt;">Remote Push:</span> <span style="font-family: ‘Microsoft YaHei‘; font-size: 15px;">APNS (apple push notification Service)</span></p></p><p><p><span style="font-family: ‘Microsoft YaHei‘; font-size: 15px;"></span></p></p><p><p><span style="font-family: ‘Microsoft YaHei‘; font-size: 16px;">The principle and flow of iOS remote push mechanism:</span></p></p><p><p><span style="color: #ff6600;"><span style="font-family: ‘Microsoft YaHei‘; font-size: 15px;">Register push (orange section):</span> <span style="font-family: ‘Microsoft YaHei‘; font-size: 15px;">If the app allows you to receive push messages, you must first register the remote push in your Code. After registering the push, iOS takes the device serial number to request ANPs and gets Devicetoken. Then the app sends Devicetoken to our App's server. Because if the server has a message for us to push, it will send the message and Devicetoken in a certain format and sent to the ANPs server. </span></span></p></p><p><p><span style="font-family: ‘Microsoft YaHei‘; font-size: 15px; color: #5b5bff;">Message Push (blue part): The original App's server and client are directly interacting with the data, but the iOS push message must pass through the APNs server. Our app first sends the message and target device Devicetoken in a certain format to Apns,apns and then pushes it to the app client on our Device.</span></p></p><p><p><span style="font-family: ‘Microsoft YaHei‘; font-size: 15px;">  </span></p></p><p><p><span style="font-family: ‘Microsoft YaHei‘; font-size: 15px;">How does the server specifically package the data, and when the app is uninstalled on the phone, how does APNs handle it, and sends a push message to it?</span></p></p><p><p><span style="font-family: ‘Microsoft YaHei‘; font-size: 15px;">This blog summary is very good: click to enter</span></p></p><p><p></p></p><p><p><span style="font-family: ‘Microsoft YaHei‘; font-size: 16px;">Code implementation:</span></p></p><p><p><span style="font-family: ‘Microsoft YaHei‘; font-size: 16px;">In the APPDELEGATE.M</span></p></p><p><p><span style="font-family: ‘Microsoft YaHei‘; font-size: 16px;">1. First register the app for remote Push:</span></p></p><p><p><span style="font-family: ‘Microsoft YaHei‘; font-size: 15px;">IOS8:</span></p></p><p><p><span style="font-family: ‘Microsoft YaHei‘; font-size: 15px;">Set the type of push you can receive, generate settings by type, Register settings, and register for remote Push. Overriding proxy methods for successful and failed registrations</span></p></p><p><p><span style="font-family: ‘Microsoft YaHei‘; font-size: 15px;">IOS7:</span></p></p><p><p><span style="font-family: ‘Microsoft YaHei‘; font-size: 15px;">Set the push type first to register the remote push based on the Type. Override the proxy Method.</span></p></p><p><p></p></p><p><p><span style="font-family: ‘Microsoft YaHei‘; font-size: 15px;">2. Get the callback method to devicetoken, and the callback method after the push message is received successfully</span></p></p><p><p><span style="font-family: ‘Microsoft YaHei‘; font-size: 15px;"></span></p></p><p><p><span style="font-family: ‘Microsoft YaHei‘; font-size: 15px;"> </span></p></p><p><p><span style="font-family: ‘Microsoft YaHei‘; font-size: 16px;">Several certificates are required:</span></p></p><p><p><span style="font-family: ‘Microsoft YaHei‘; font-size: 15px;">Reference: Blog "several certificates required for iOS remote push"</span></p></p><p><p></p></p><p><p>Push mechanism for iOS apns: local push & remote push</p></p></span>
Related Article

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.