requestNotificationPermission

actual fun requestNotificationPermission(onGranted: () -> Unit, onDenied: () -> Unit)

Requests notification permission for the application. On Android 13 (API 33) and above, this method initiates an intent to the system settings screen where the user can grant the notification permission.

Note: Ensure to add in the app's manifest file.

expect fun requestNotificationPermission(onGranted: () -> Unit, onDenied: () -> Unit)

Requests notification permission on the platform.

Parameters

onGranted

Callback invoked when the permission is granted.

onDenied

Callback invoked when the permission is denied.

actual fun requestNotificationPermission(onGranted: () -> Unit, onDenied: () -> Unit)

Requests permission to display notifications.

Parameters

onGranted

Callback executed if the permission is granted

onDenied

Callback executed if the permission is denied

actual fun requestNotificationPermission(onGranted: () -> Unit, onDenied: () -> Unit)
actual fun requestNotificationPermission(onGranted: () -> Unit, onDenied: () -> Unit)

Requests notification permission from the user on iOS.

This function uses UNUserNotificationCenter to request authorization for notifications with options for alerts, sounds, and badges.

Parameters

onGranted

Callback to be executed if the user grants notification permissions.

onDenied

Callback to be executed if the user denies notification permissions.

Required Configuration in Info.plist: Add the following keys to your Info.plist file to provide a clear description to the user when the app requests notification permissions:

<key>NSLocationWhenInUseUsageDescription</key>
<string>We need access to notifications to keep you updated about important events.</string>

If you are using remote notifications, make sure to enable the "Push Notifications" capability in your Xcode project.

actual fun requestNotificationPermission(onGranted: () -> Unit, onDenied: () -> Unit)

Requests permission to display notifications.

Parameters

onGranted

Callback executed if the permission is granted

onDenied

Callback executed if the permission is denied