Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do Local Notifications need user permission on iOS?

Tags:

I am using UILocalNotification in my app to schedule notifications. The notifications work fine and show up when I want them to. I dont have an issue with that. I am NOT doing any remote/push notifications.

What got me wondering is that I never saw the famous permissions dialog that you usually see for push notifications in several app. I even reset my device and ran my app. That still didn't cause the permission dialog to show up.

Does this permission dialog not show up if your app is using only local notifications or am I not implementing some method that actually causes the app to ask for this permission?

I know I could implement my own dialog after the app started that asked the user for this permission but I was hoping that Apple took care of that, especially since it treats remote and local notifications the same in the Settings app.

like image 742
RPM Avatar asked Apr 16 '13 23:04

RPM


People also ask

What is local notification in iOS?

With local notifications, your app configures the notification details locally and passes those details to the system, which then handles the delivery of the notification when your app is not in the foreground. Local notifications are supported on iOS, tvOS, and watchOS.

Do you need consent for push notifications?

Push notifications can let users know when others have interacted with their social media accounts by liking photos or leaving comments, as seen in this Android push notification from Luca. Android and Fire OS don't require a user to opt in to receiving these notifications from apps.

What is local notification in iOS Swift?

Use local notifications to get the user's attention. You can display an alert, play a sound, or badge your app's icon. For example, a background app could ask the system to display an alert when your app finishes a particular task. Always use local notifications to convey important information that the user wants.

How do I get notification permissions in iOS?

If the user presses the Turn Off button, the system confirms the selection before denying your app authorization to send additional notifications. To request provisional authorization, add the provisional option when requesting permission to send notifications. let center = UNUserNotificationCenter. current() center.


1 Answers

Yes, in iOS8, local notifications do require permissions.

The documentation for registerUserNotificationSettings: stipulates that

If your app displays alerts, play sounds, or badges its icon while in the background, you must call this method during your launch cycle to request permission to alert the user in those ways. Typically, you make this request if your app uses local or push notifications to alert the user to new information involving your app.

It is recommended that you call this method before you schedule any local notifications or register with the push notification service.

like image 54
luvieere Avatar answered Sep 20 '22 11:09

luvieere