Search code examples
iosnotificationsuilocalnotificationeventkit

APS registerForRemoteNotifications control the default alert style


When I register, on my app delegate, for remote notifications:

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

I do receive remote notifications as banners,

but when I go to setting -> Push notifications, my app's Alert Style is set for banners

I have a need to have it for alarms, is there any way to set it by default to Alerts?

Also, How is this authorization level related to the Local Notifications?

If my settings -> Push Notifications, is set to Banners, does it mean than a LOCAL Notification can't be presented as Alarms?

for my current task I could get by with accepting the remote notifications, and then only convert SOME of them to local, but I do need those locals to show up like an alarm

I have been tinkering with EventKit for the past day but from my POV is has its own limitations, the user can delete or edit at will the event from the Calendar & Reminders application. I could register for a notification for such event but this would receive such notification AFTER the fact. Thing is that these events cost money to the user if he fails to attend (or cancel them) so I always need to warn the user before canceling / deleting / modifying an event

Your guidance is appreciated.


Solution

  • Only the user can switch the style between banner and alert styles. You have no control over this.

    You seem to be confusing alerts and alarms? There's no relation between the two. Hence this sentence makes no sense: "If my settings -> Push Notifications, is set to Banners, does it mean than a LOCAL Notification can't be presented as Alarms?"

    A local notification is not an alarm, its a notification which can be either banner or alert.

    A local notification and an event kit alarm are not the same thing, you seem to thing they are similar or related, they are not, the only thing they have in common is there is a date trigger with both and they look similar when displayed by the OS.

    Anyway you have no control over the local or remote notification banner /alert display style.