IPhone push notification message push

Source: Internet
Author: User
Tags ssl certificate

For exampleArticleConcepts

1. Provider: Corresponds toPushmebabyProject (used to send messages to apns)

2. apns:Apple_push_notification_service Apple message push Server

3. iPhone: Used to receive messages pushed by apns

4. Client app:Corresponding toPushclientProject, installed on the iPhoneProgram(It is used to receive messages sent by apns from the iPhone to a developed client app)

Certificate -------------------------------------------------------------------------------------------------------------------------------------------------------

After the introduction of several concepts, I would like to declare that it will be used in the following project configurations.Apple developer accountDownloadAps_developer_identity.cer and rename apns. CerIn the pushmebaby project, you can configure push functions smoothly.

Certificate ----------------------------------------------------------------------------------------------------------------------------------------------------

Start now

1, Get devicetoken

In the main. M file of the pushclient project

-(Void) Application :( uiapplication *) Application didregisterforremotenotificationswithdevicetoken :( nsdata *) devicetoken

The devicetoken is obtained in the method, which is used to fill in pushmebaby and send messages to the server. 2, Get the license required in the server (to use the relevant configuration in the developer account) 1. First log on to the https://developer.apple.com/devcenter/ios/index.action login account

2,

3,

4. Download push SSL Certificate and rename the original file name aps_developer_identity.cer --------> to apns. Cer.

5. Download The testpush. mobileprovision configuration to the project.

After obtaining the preliminary project configuration and some certificates, We need to download the project files pushmebaby and pushclient.

:

Http://download.csdn.net/source/3182374

We will do two things after the download is complete.

1. Copy the obtained apns. Cer file to the pushmebaby project file directory at the same level.

2. Install pushclient on the real machine and run it to obtain the devicetoken.

(Actually, in the push client

-(Void) Application :(Uiapplication*) Application didregisterforremotenotificationswithdevicetoken :(Nsdata*) Devicetoken

{

}

Devicetoken in

)

Remember to replace the 40 characters that you just obtained in the pushmebaby project

Applicationdelegate. m

-(ID) Init

{

...

Self. devicetoken = "The devicetoken you just obtained ";

}

After running the project

The device token above is the sub-device to be pushed.

Then run pushmebaby to run normally. You can see the following results: apns

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.