ios - Callback Method if user declines Push Notification Prompt? -
my problem want show loading screen initial push notification prompt "the app wants send push notifications."
so if user hits yes
can proceed , start app in invoked delegate methods:
- (void)application:(uiapplication*)application didregisterforremotenotificationswithdevicetoken:(nsdata*)devicetoken { [self hideloadingscreen]; } - (void)application:(uiapplication*)application didfailtoregisterforremotenotificationswitherror:(nserror*)error { [self hideloadingscreen]; }
however if user hits no
, none of these methods called, makes sense. question is, there different delegate method gets fired if declines?
my problem if no
selected, loading screens never disappear. somehow need know when user done selection.
in ios 7, when system's push notification prompt appears, app becomes inactive , uiapplicationwillresignactivenotification fires. when user responds prompt (pressing either yes or no), app becomes active again , uiapplicationdidbecomeactivenotification fires.
so can listen notification, , hide loading screen.
note: while prompt displayed, home button, notification center, , control center disabled cannot trigger false-positive uiapplicationdidbecomeactivenotification. if user presses lock button trigger uiapplicationdidbecomeactivenotification.
Comments
Post a Comment