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