IOS Remote Push

Source: Internet
Author: User

2 things you need to do for an iOS app agent

1. When the program starts, register the remote Notification Service, plainly: is to send a message to Apple, asked "my latest devicetoken is how much?".

Note: When registering for the first time, user authorization is required, that is, our common "xxx app" wants to send you push notifications

The specific code is as follows

-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (nsdictionary *) launchOptions

{

Registering a remote Notification service

[Application Registerforremotenotificationtypes:uiremotenotificationtypebadge |

Uiremotenotificationtypesound |

Uiremotenotificationtypealert];

return YES;

}

2. Submit UserID + Devicetoken to the server.

The following callback method does not necessarily adjust: The network is not good, it will not be adjusted

-(void) Application: (UIApplication *) application Didregisterforremotenotificationswithdevicetoken: (NSData *) Devicetoken

{

Submit UserID + Devicetoken to company server

The company server will look at this userid the latest commit devicetoken and the devicetoken stored in the database are the same. If not, update the Devicetoken in the database.

Write the code that submits the UserID + Devicetoken in curly braces

}

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.