APNS callback Method Didreceiveremotenotification

Source: Internet
Author: User

Transferred from: http://blog.csdn.net/justinjing0612/article/details/8297168

Apple's push notification callback method has only one,

[HTML]View Plaincopy
  1. -(void) Application: (UIApplication *) application didreceiveremotenotification: (nsdictionary *) userInfo
  2. {
  3. NSLog (@ "received push message:%@", [[UserInfo objectforkey:@ "APS"] objectforkey:@ "alert"]);
  4. }

And this is a strange method.


The above dictionary "push test" is a message that is pushed over.

"1" is the icon's corner mark.

"Sound" is the voice of the push message, default is defaulted, this you can also customize.

Only some kind of operation can be, the other operation is not.

This particular operation is a callback to this method when you click on the status bar notification. Is that none of your other operations will be recalled.


Tested:

Only click on the status bar notification, and in the app normal operation in the case of Apple's push is OK, the others are not OK

In order to avoid this, only when the app opens, the app actively go to the server pull the data

To add: If we run the program on the computer, the project is in the running state, this method will be callback. If the item above the phone is not started, then this method will only be called when the notification bar is clicked, the Desktop app icon will not be called when clicked, this is the view of the blogger above.

APNS callback Method Didreceiveremotenotification

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.