What are the differences between iOS notifications, local notifications, and push notifications? APNS mechanism ., Iosapns

Source: Internet
Author: User

What are the differences between iOS notifications, local notifications, and push notifications? APNS mechanism ., Iosapns

Local/push notifications are designed for different needs.
Local notifications are local for iPhone, iPad, or iPod.
Push notifications-from outside the device. They come from remote servers-also known as remote notifications-that are pushed to applications on the device (using APNs) and can view messages or download data at the same time.
APNS: Apple Push Notification Service"

 

Mobile phone -- (uuid, bundleid) apns
Apns-token-mobile phone
Mobile phone -- upload token to server -- server record token
Server -- send token to -- apns
Apns-push to Mobile Phone Based on token

Register to receive remote notifications

-(BOOL) application :( UIApplication *) application metadata :( NSDictionary *) launchOptions {// register remote notification UIRemoteNotificationType = custom | UIRemoteNotificationTypeBadge | uiremotenotiftypetypesound; [application metadata: type]; return YES ;}

Receive deviceToken

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{    NSLog(@"%@", deviceToken);}

Send deviceToken to your server

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{    NSLog(@"%@", deviceToken);}

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.