Apple APNs ' device token features and outdated updates

Source: Internet
Author: User
<span id="Label3"></p><p>APNs full name is Apple Push Notification Service. With the iphone should be accustomed to, each install a new app launch, almost will pop up a warning box, "xxx app" want to send you push notifications. The permission request of this warning box is for APNs push, after the user authorizes, the application provider can send the message to the user via Apns.<br>Apns's work mechanism can be divided into two steps, the first step is to register the push service from APNs to obtain device token to inform the application provider server, The second step is the application provider service side through the APNs to the device push messages, device token is as the only indication of Devices.<br><br>is a process of device token Generation. We use the first installation of the launch of the 360 child defender application as an example, the application will pop up a warning box, requesting users to allow sending push notifications, the user allows –> child defender will register the push service to the system, the system will automatically connect to the APNS server after the registration request to obtain a device token (I.E. device Token) The –>apns server generates a device token containing the device ID and sends it to the appliance –> Child defender receives device token, which is saved locally and sent to the child defender server, and is completed in the first Step.<br><br>is a diagram of the push message, which is maintained by device token and APNs server. Also take 360 child defender as an example, when the child is home, the child defender server needs to send the reminder to the Parents. The Child defender server will then push the encrypted arrival reminder message to Apns,apns after decryption and then push it to the specified device based on device token, using device token as the Target. In this way, a push is Complete.<br>Knowing the working mechanism of apns, it is obvious that device token plays a crucial role in series-pointing. If device token is wrong or missing, the push cannot be delivered to the target device. So it's important to understand some of the features of device token, whether it's a test or a development:<br>1. Each device token is unique and will only correspond to one MACHINE.<br>2.device token is associated with the device system (note that it is not tied to the device!) See below for details), the same token is obtained for different applications on the same device System.<br>3. The app uninstall reinstall, the acquired device token will not change, and will not eject the Push permission request popup, will automatically inherit the previous setup Information. This feature is prone to some security issues, and after users uninstall and reinstall an app, they may receive a push message from their last login when they are not signed in to the app. I've had this situation with both my iphone QQ and Skype. The client has no way to handle this problem because the client is unable to respond to the server when it is Uninstalled. Apple has a feedback mechanism to solve this problem, and Apple maintains a constantly updated list of devices for push failures for each Application. The server can periodically check and update the list of push devices, which can solve most problems and reduce unnecessary message overhead.<br>4. The 3rd client cannot process, but exiting the login notification server is the work of the Client. When the user exits the login client, the client should tell the server to stop the message that the device continues to push the user out of the login Account. This should not be a feature of device token, it is a standard processing method.<br>I believe a lot of people have this question, as the only indication of a device push, will device token change or expire? Apple is somewhat vague on this point, but in official documents it is suggested that developers should get device tokens to APNs and pass them on to the server each time they launch the app. From this point of view, device tokens change, or not every time you start to Get. Because Apple officials did not give a clear picture of device token changes, so the following are some of the previous experience summed up, mainly quoted StackOverflow on the question of an answer, the respondents said that the Apple and an engineer to communicate with the results of their own experiments.<br>1. Upgrading the system device token is subject to change, confirming that the upgrade to IOS5 will change and that the device token will change after upgrading the large system Version.<br>2. Erase all content and settings, device token will change after Reset.<br>3. Device token changes after restoring a non-native backup.<br>4.device token will expire, this controversy, there is said to be half a year, there is said that two years, but will expire should be Conclusive.<br>5. Backup or restore the backup of this machine, device token will not change.<br>So on the safe side, it's a good idea to check device tokens and send to the server every time Apple launches the app.</p><p><p></p></p><p><p>Source: http://blogs.360.cn/360qtest/2014/03/24/%E8%8B%B9%E6%9E%9Capns-device-token%E7%89%B9%E6%80%A7%E5%92%8C%E8% bf%87%e6%9c%9f%e6%9b%b4%e6%96%b0/</p></p><p><p>Apple APNs ' device token features and outdated updates</p></p></span>

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.