1

In my application I am registering device for APNS with this code

[[UIApplication sharedApplication]registerForRemoteNotificationTypes: (UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge )];

It will prompt an alert with two option Don't Allow and Ok.

I just want to know when didRegisterForRemoteNotificationsWithDeviceToken method will be called in application.

My problem is that didRegisterForRemoteNotificationsWithDeviceToken this method get called before user select any option Don't Allow and Ok for push notification.

Thanks.

Arun
  • 3,406
  • 4
  • 30
  • 55
S S
  • 193
  • 1
  • 1
  • 11
  • http://stackoverflow.com/questions/10983536/when-is-didregisterforremotenotificationswithdevicetoken-called – Lochana Ragupathy Mar 22 '13 at 06:49
  • my problem is this 'didRegisterForRemoteNotificationsWithDeviceToken this method get called before user select any option Don't Allow and Ok for push notification.' – S S Mar 22 '13 at 06:58
  • During Apps first launch it will ask for the users permission after saying OK to the alert then it gets triggered if no it wont and once if it yes from next launch it will be getting called followed by registerForRemoteNotificationTypes and manually the user can enable notifications from setting try putting some NSLog and see how it works – Lochana Ragupathy Mar 22 '13 at 07:02
  • when application is lunched at the first time in your iPhone then its calling that Don't Allow and Ok alert message.... u need to call every time? – Nag_iphone Mar 22 '13 at 07:03
  • but in my case didRegisterForRemoteNotificationsWithDeviceToken method getting called before any selection by user – S S Mar 22 '13 at 07:04
  • y your calling like this way ?means is there any button, to register push notification for particular users . – Nag_iphone Mar 22 '13 at 07:07
  • r u getting my point? – Nag_iphone Mar 22 '13 at 07:09
  • @Nag_iphone no I dont want to call every time. didRegisterForRemoteNotificationsWithDeviceToken I am calling api web service to store devicetoken at server my code is if(rntypes == UIRemoteNotificationTypeBadge){ pushBadge = @"enabled"; } I am also passing that value in web service – S S Mar 22 '13 at 07:09
  • see one thing leave it for "didRegisterForRemoteNotifications" this method ......i am asking before registration the "Divice token" do u want ask the alert ? am i correct? – Nag_iphone Mar 22 '13 at 07:13
  • @Nag_iphone yes correct – S S Mar 22 '13 at 08:00
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/26707/discussion-between-s-s-and-nag-iphone) – S S Mar 22 '13 at 08:06

0 Answers0