iOS remote push

Source: Internet
Author: User

Remote Push app configuration process
I. Create an app ID that supports remote push features
Add App ID
Set bundle ID, cannot set wildcard ID

Tick the remote notification option, which can be checked when the app ID is configured, or can be changed based on the original app ID.


Tick the remote notification option
Tick remote notification option two. Request a developer certificate and select the app ID you just created
Create a remote push certificate
Create a push certificate

Select the app ID that we just configured, tick the push option.


Select App ID

Select the CSR file generated locally by our computer using the Certificate Assistant


Select a file with the suffix. certsigningrequest three. Download the CER file and import Keychain management
Download Certificate four. We need to regenerate the configuration file
Build configuration file

Select the environment for this provisioning profile and click Continue


Click Continue

Select the app ID you want to create provisioning profile and click Continue


Click Continue

Select the developer certificate that belongs to, (here create a number of developer certificates, it is recommended to create only one, easy to manage) for convenience. Select all here, then click Continue to proceed to the next step.


Click Continue to enter the next step

Select the device (select all) that will be installed for the provisioning profile, and click Continue


Choose Select All

Fill in the profile Name for the provisioning profile and click Generate to complete the creation


Finish creating

Create complete, click Download to download to local. Double-click the downloaded provisioning profile and add it to Xcode.

Five. Export the push certificate to the. p12 file and upload the server. In team development, if you encounter multi-person development, you also need to export to colleagues. P12 Certificate for others to use.


Note: When exporting a certificate, try not to expand the private key.


Export a file with a. p12 suffix
Export certificate

When you pass it on to the server, you need to tell the server to develop the password for the colleague certificate.


Set Password six. Remote Push application development process

Specifically how to create new applications and other development is not much to say, directly say and push related.

Open the bundle identifier option for the Info.plist file to fill in the app ID to configure the push certificate


APP ID fill in

Click on Project, go to build Setting interface, swipe down, go to code Signing configure certificate


Configuring certificates

Need to modify the app's capabilities in Xcode to open remote notifications


Open remote notifications Seven. Get Devicetoken, and send to server

Due to iOS system restrictions, we need to register remote notification, we directly on the code


Registering Remote Notifications

After registering for the notification, Apple will return the Devicetoken through the proxy method in the form of the appropriate proxy method. Note: Be sure to connect!

This proxy method sends the bundle ID of the phone's Udid + application to Apple, which is encoded by the Apple and then returned through the proxy method.

Devicetoken = (mobile phone's Udid + app bundle ID) Apple encoding

The returned devicetoken are of the NSData type, and the approximate format is as follows: <7040f7d5 5a974598 c5cf31b5 3e340b39 68affd25 122f0ce1 3f315226 396c2e5b>

After registering the notification, the Devicetoken returned by Apple is received in the proxy method


Get the Devicetoken sent to Apple

Implement proxy method for receiving remote notifications, triggering method is consistent with local notification process

IOS8 previously used this method:


Get push message

Use this method after IOS8:


Get push message

There are two purposes for the execution of Completionhandler

The 1> system will measure the power consumed by the app and record whether new data is available based on the Uibackgroundfetchresult parameters passed

The app's interface thumbnails are automatically updated when 2> calls the finished processing code

Note: The time between receiving a remote notification and completing a network request cannot exceed 30 seconds



Wen/Liu Xiaozhong (Jane book author)
Original link: http://www.jianshu.com/p/5639a3d2a2be
Copyright belongs to the author, please contact the author to obtain authorization, and Mark "book author".

iOS remote push

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.