user-123
user-123

Reputation: 884

Delaying display of push notification alert

All the code I've ever seen put the -[[UIApplication sharedApplication] registerForRemoteNotificationTypes:... in the AppDelegate's -didFinishLaunchingWithOptions:... and so the push alert is the first thing the user sees as he enters the app.

My goal is to delay it a little bit, i.e. show something and then in some viewDidLoad show user the alert. Is it possible?

Another related question is will -didFailToRegisterForRemoteNotificationsWithError will be called if the user denies the push or just if something is wrong with the registration?

Thanks!

Upvotes: 0

Views: 186

Answers (1)

user-123
user-123

Reputation: 884

Well, I will answer my question after testing it with a test app (because mine cannot be uninstalled for the whole day, I have got work to do.. :) )

1) The alert CAN be delayed. the moment you call -registerForRemoteNotificationTypes, that moment the alert will show and the answer has to be given. The only way to dismiss that alert is to reboot the device, in which your answer to the alert is NO!

2) No, didFailToRegisterForRemoteNotificationsWithError is only called if something went wrong with the registration (certificates, etc.).

Upvotes: 2

Related Questions