0
votes

I implemented a iOS application. I found a strange behavior for push notification in my application.

When I launch the application first time Push notification alert will come with two options. one is "Don't allow" and another one is "Ok".

If I tap on "Don't allow" button , the Badge, Alert and Sound button state should be OFF in settings->Notification center->myApp.

But this in not happening in my application.

Once user tap on "Don't allow" button in the push notifications in my application , the Badge, Alert and Sound button state is showing as ON in settings->Notification center->myApp.

Why my app is behaving like this ? Can any one help me on this please.

Thanks,

3

3 Answers

0
votes

if you'll be able to have the action event on button then you can put this code in Don't allow action event

[[UIApplication sharedApplication] setApplicationIconBadgeNumber: 1];
[[UIApplication sharedApplication] setApplicationIconBadgeNumber: 0];
[[UIApplication sharedApplication] cancelAllLocalNotifications];

i hope it helps!

0
votes

Notification center for an allows us to customize how the notifications can be present for an app. ie like an alert view or notifications at the top like in Android. It has nothing to with the push notification enabled or not.

0
votes

I think you are doing correct steps but If you want to reset notification permissions you can follow these steps: Settings >> General >> Reset >> Erase All Content and Settings. Or uninstall app wait for 24hours and then install again.