iOS remote push

Source: Internet
Author: User
Tags ssl certificate

iOS remote push

I. About PUSH notifications

Push notifications, also called remote notifications, are features that are introduced after iOS 3.0. is when a program is not started or is not running in the foreground, a way to tell the user that a new message is being sent from an external server to the application. Generally speaking, when you want to display a message or download data, the notification is sent by the remote server (the provider of the program) and then pushed to the device via Apple's push notification service (Apple push Notification service, or APNs).

A new message that you push may be a message, an expiring schedule, or a new data on a remote server. When presented on the system, you can display a warning message or display a number on the program icon, and you can also play a warning tone. Once the user notices that the program has new information, time, or data, they can run the program and access the new content. You can also choose to ignore the notification, and the program will not be activated.

The IPhone, ipad and ipod touch only have one app running in the foreground at the same time. Most programs run in the background and can respond to content that some users are interested in (timing, or data, and so on). Push notifications allow the program to notify the user when these events occur.

To develop and deploy push notifications as a provider for your program, you must obtain an SSL certificate through the iOS Developer programs portal. Each certificate is limited to one program, using the program's bundle ID as the identity. Certificates are used for two purposes: one for sandbox (for development and testing) and the other for publishing products. Both of these run environments have the IP addresses specified for each and require different certificates. The respective provisioning profiles must also be acquired for two different environments.

APNs provides two basic services: message push and feedback service.

Message push: Use streaming TCP sockets to send push notifications as binary data to APNs. Message push has two interfaces for the development and test sandbox, and each has its own address and port. Regardless of which interface you use, you need to use SSL certificates to establish a secure channel through TLS or SSL. The provider prepares the notification information and sends it to the APNS through this channel. Note: sandbox:gateway.sandbox.push.apple.com:219 Product interface: gateway.push.apple.com:2195

Feedback Service: You can get a send failure record for a program. The provider should use the feedback service to periodically check which devices are not receiving notifications, and do not need to send notifications repeatedly to these devices, reducing the burden on the push server. Note: sandbox:feedback.push.apple.com:2196 Product interface: feedback.sandbox.push.apple.com:2196

Two. Working mechanism of Apple Push notification

Your own client sends messages to your app's Apns,apns to send messages to your phone. This is based on the token recognition. The phone is sending messages to your application.

    • The first is the application registration message push.
    • iOS and APNs server to Devicetoken. The application accepts Devicetoken.
    • The application sends Devicetoken to the push server-side program (Provider).
    • The service-side program sends messages to the APNS service.
    • The APNs service sends messages to the iphone app.

1. Provider refers to the push server of an iphone software, which is the server we are going to develop.

2. APNS is an abbreviation for Apple push Notification Service (Apple push server) and is Apple's server.

The above can be divided into three stages:

The first stage: Push server (provider) to send the message, the logo of the purpose of the iphone packaging, sent to APNs;

Phase II: APNs in its own list of registered push service iphones, find the iphone with the corresponding logo and send the message to the iphone;

The third stage: The iphone sends the message to the appropriate application and follows the settings to eject the push notification.

Configuration prior to three pushes

In any iOS app development, developers always play a role within the team: Team managers, Team admins, and team members. The iphone development certificate and configuration files are done by different roles. Usually team managers are the only people within the team who can create development SSL certificates (sandbox environments) and distribution SSL certificates (product environments). Both team managers and team administrators can create profiles for development and distribution. Team members can only download and install certificates and configuration files (! Here's a good idea of distinguishing between certificates and profiles: A certificate, certificates, which is primarily a signing key that is generated using access key chain. While the configuration file, i.e. provisioning profiles, it is mainly based on different apps to generate the targeted code signature files. The difference is that generally a developer account can have only one certificates (and development one, distribtuion one), but can have multiple provisioning profiles files, and these provisioning Profiles usually use the same certrificates when they are created). The following sections describe the process in detail.

Note: iOS Provisioning portal is for all iOS developers.

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.