开发者

iOS - UIRemoteNotificationTypeBadge & Push

If my application is started and only started. I implemented application:didReceiveRemoteNotification: to receive the payload. If a message is sent to my iPhone, is this method called for every registration type, such as the following one?

[[UIApplication sharedApplication]
registerForRemoteNotificationTypes:**UIRemoteNotificationTypeNone**]; //1

[[UIApplication sharedApplication]
registerForRemoteNotificationTypes:**UIRemoteNotificationTypeBadge**]; //2

[[UIApplicatio开发者_如何学运维n sharedApplication]
registerForRemoteNotificationTypes:**UIRemoteNotificationTypeSound**];  //3

[[UIApplication sharedApplication]
registerForRemoteNotificationTypes:**UIRemoteNotificationTypeAlert**];  //4

I have a big doubt for solution 1...


The method only needs to be called once. The types argument is a bitmask of the types that you wish to register for:

[[UIApplication sharedApplication] registerForRemoteNotificationTypes: UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound];

The code above would register for Badge and Sound remote notifications.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜