> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notifly.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Request push notification permission

> Implement the push notification permission request in your app.

Your app must request permission before it can display notifications on platforms that require consent. Implement the request at an appropriate point in your app's flow.

> [tab] Android
>
> Android 13 (API level 33, `TIRAMISU`) and later require runtime notification permission. Add the permission request to your app. See [Notification runtime permission](https://developer.android.com/develop/ui/views/notifications/notification-permission) for prerequisites.
>
> This Kotlin example requires `compileSdk` 33 or later. To request permission on Android 13 or later, the final merged `AndroidManifest.xml` must declare `android.permission.POST_NOTIFICATIONS`. If a dependency such as FCM already declares it, you do not need to add it again.
>
> ```kotlin theme={null}
> // Request notification permission
> private fun askNotificationPermission() {
>     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU &&
>         ContextCompat.checkSelfPermission(
>             this,
>             Manifest.permission.POST_NOTIFICATIONS
>         ) != PackageManager.PERMISSION_GRANTED
>     ) {
>         ActivityCompat.requestPermissions(
>             this,
>             arrayOf(Manifest.permission.POST_NOTIFICATIONS),
>             101
>         )
>     }
> }
> ```

> [tab] iOS
>
> Request authorization with `UNUserNotificationCenter`. Choose the request timing, UI, and wording to fit your app.
>
> ```swift theme={null}
> UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { granted, error in
>     if let error = error {
>         print("Failed to request authorization: \(error)")
>         return
>     } else {
>         guard granted else {
>             print("Notification permission denied")
>             return
>         }
>         DispatchQueue.main.async {
>             UIApplication.shared.registerForRemoteNotifications()
>         }
>     }
> }
> ```

> [tab] Flutter
>
> This example is for apps that use `firebase_messaging`.
>
> ```dart theme={null}
> import 'package:firebase_messaging/firebase_messaging.dart';
>
> FirebaseMessaging messaging = FirebaseMessaging.instance;
> NotificationSettings settings = await messaging.requestPermission(
>   alert: true,
>   badge: true,
>   sound: true,
> );
> ```

> [tab] React Native
>
> On iOS, request permission with React Native Firebase as shown below. On Android 13 or later, request the `POST_NOTIFICATIONS` runtime permission with `PermissionsAndroid`. Also check the final manifest declaration described in the Android tab. See [React Native Firebase notification permissions](https://rnfirebase.io/messaging/usage#android---requesting-permissions).
>
> ```javascript theme={null}
> import messaging from '@react-native-firebase/messaging';
>
> await messaging().requestPermission();
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.