Early access · launching soon. Request access

Early access

Early access · launching soon
Product
IntelligenceEarly access. Designed and in development. No results yet. See what's left on the roadmap.
Developers
Resources
Request access

A person reads every request.

In your appEarly accessDesigned and in development. No results yet. See what's left on the roadmap.

Push notification permission: Android 13+, iOS, Flutter

Oricato Team Last updated SDK 1.0.1

Early access · launching soon.

A notification can only reach someone who allowed it. This guide covers when to ask, how to ask with the Oricato SDK on Android, iOS and Flutter, what to do when people say no, and how the answer reaches your Oricato project. The examples use a neutral app called Lingora (package com.lingora.app).

How permission works on each platform

Platform What the OS does Oricato API
Android 13+ (API 33+) Runtime prompt for POST_NOTIFICATIONS. The SDK already declares the permission in its manifest. Oricato.requestPermission(activity) { granted -> }
Android 12L and lower No runtime prompt. Notifications are on unless people switch them off in Settings. The same call, which returns the current state without a prompt
iOS UNUserNotificationCenter.requestAuthorization asks once; later changes happen in Settings. Oricato.requestPermission(options:completion:)
Flutter Android 13+ prompt or iOS prompt, from Dart await Oricato.requestPermission()

The SDK reports the state to the server as push_permission on the subscription. Every platform uses the same four values, but not every platform produces all of them: Android never reports provisional, and Android 12L and lower never report not_determined (there is no prompt, so the state is granted or denied from the start).

push_permission Meaning Dashboard label
granted Notifications can be shown. Allowed
provisional iOS only: delivered quietly to Notification Center, no banner or sound. Allowed quietly (iOS)
denied Refused, or allowed once and then switched off in Settings. Blocked
not_determined Never asked. Not asked yet

A subscription is subscribed only when it has a token, is opted in, and push_permission is granted or provisional.

On Android, the SDK reports granted only when the permission is granted and app notifications are enabled. If the permission is granted but notifications for the app are switched off in Settings, it reports denied. On iOS, authorized and ephemeral (App Clips) map to granted.

Prerequisites

  • The Oricato SDK 1.0.1 is installed and Oricato.initialize(...) runs at startup: Android, iOS or Flutter.
  • Android: your app targets API 33 or higher (targetSdk = 33 or more) so that it can show the prompt itself.
  • iOS: the Push Notifications capability is on and your APNs key (.p8) is uploaded in Firebase (see Firebase and APNs credentials).
  • A real device to test on. The iOS Simulator is not a reliable place to test push permission end to end.

Best practice: ask once, at a moment of value

Both Apple’s Human Interface Guidelines and Android’s notification permission guide recommend asking in context, when people understand what they get. In practice:

  • Never ask on a cold first launch. People have not seen your app yet, so they have no reason to say yes.
  • Ask at a moment of value: after onboarding, or when the person turns on something that needs notifications, such as a reminder, an order update or a reply alert.
  • Show a short pre-prompt first: one screen in your own UI that says what they will receive and why it helps them, with “Turn on” and “Not now”. Only call the system prompt after “Turn on”.
  • Ask once. On iOS the system prompt appears only once per install. On Android 13+ the system stops showing it after the person denies it twice.
  • If they said no, do not nag. Later, at another relevant moment, offer a shortcut to the app’s notification settings.

Step 1. Pick the moment

Choose one place in your flow where notifications clearly help the person. In Lingora, that is the moment someone turns on “Daily reminder”. Check the current state first, so you only show the pre-prompt to people who were never asked.

Android (Kotlin)

import com.oricato.push.Oricato
import com.oricato.push.OricatoPermissionStatus

when (Oricato.getPermissionStatus(context)) {
    OricatoPermissionStatus.GRANTED -> enableReminder()
    OricatoPermissionStatus.NOT_DETERMINED -> showPrePrompt()
    OricatoPermissionStatus.DENIED -> showSettingsHint()
}

iOS (Swift)

import OricatoPush

Oricato.getPermissionStatus { status in
    // Runs on the main thread.
    switch status {
    case .granted, .provisional: enableReminder()
    case .notDetermined: showPrePrompt()
    case .denied: showSettingsHint()
    }
}

Flutter (Dart)

import 'package:oricato_push/oricato_push.dart';

final status = await Oricato.getPermissionStatus();
switch (status) {
  case OricatoPermissionStatus.granted:
  case OricatoPermissionStatus.provisional:
    enableReminder();
  case OricatoPermissionStatus.notDetermined:
    showPrePrompt();
  case OricatoPermissionStatus.denied:
    showSettingsHint();
}

In Flutter, status.allowsNotifications is true for granted and provisional.

Step 2. Show a pre-prompt

The pre-prompt is your own screen or dialog, not an Oricato API. Keep it short and specific, for example:

Get your daily reminder We will send one reminder a day at the time you pick. You can change this any time. [Turn on] [Not now]

If the person taps “Not now”, do not call the system prompt. You can offer it again at a later relevant moment.

Step 3. Call requestPermission

Android

// From an Activity, after the person tapped "Turn on".
Oricato.requestPermission(this) { granted ->
    // Called on the main thread.
    if (granted) enableReminder() else showSettingsHint()
}

Signature: Oricato.requestPermission(activity: Activity, callback: OricatoPermissionCallback? = null). The callback receives granted: Boolean.

  • Android 13+: the SDK shows the POST_NOTIFICATIONS prompt from a translucent SDK activity and reports the answer to the server.
  • Below Android 13: there is no prompt. The callback receives the current state right away (true when app notifications are enabled).
  • Already granted: no prompt; the callback receives true right away.
  • Granted, but app notifications are off in Settings (Android 13+): getPermissionStatus returns DENIED, yet the callback can still receive true, because the POST_NOTIFICATIONS permission itself is granted. If the callback says true but Oricato.getPermissionStatus(context) is still DENIED, call Oricato.openNotificationSettings(context) so the person can switch notifications back on.

From Java, the callback is a functional interface:

Oricato.requestPermission(this, granted -> {
    if (granted) enableReminder(); else showSettingsHint();
});

iOS

// After the person tapped "Turn on".
Oricato.requestPermission { granted in
    // Runs on the main thread.
    if granted { enableReminder() } else { showSettingsHint() }
}

Signature:

public static func requestPermission(
    options: UNAuthorizationOptions = [.alert, .sound, .badge],
    completion: ((Bool) -> Void)? = nil
)

The SDK calls UNUserNotificationCenter.current().requestAuthorization(options:), reports the new state, and calls UIApplication.shared.registerForRemoteNotifications() when permission is granted.

To deliver quietly without a prompt (provisional authorization, iOS 12+), add .provisional:

Oricato.requestPermission(options: [.alert, .sound, .badge, .provisional]) { granted in
    // The status becomes .provisional; notifications go to Notification Center without a banner or sound.
}

Flutter

// After the person tapped "Turn on".
final status = await Oricato.requestPermission();
if (status.allowsNotifications) {
  enableReminder();
} else {
  showSettingsHint();
}

Signature: static Future<OricatoPermissionStatus> requestPermission({bool provisional = false}). It shows the Android 13+ POST_NOTIFICATIONS prompt or the iOS requestAuthorization prompt, reports the result to the server and returns the new status. Pass provisional: true to request iOS provisional authorization.

Step 4. Handle a denial with a settings shortcut

After a denial, apps cannot show the system prompt again. Offer a button that opens the app’s notification settings instead, at a moment when it makes sense (for example when the person taps the reminder switch again).

Android

Oricato.openNotificationSettings(context)

This opens the app’s notification settings screen (Settings.ACTION_APP_NOTIFICATION_SETTINGS on Android 8.0+, the app details screen on older versions).

iOS

The Oricato iOS SDK has no settings helper. Use the standard Apple API UIApplication.openSettingsURLString:

// Standard Apple API (UIKit), not part of the Oricato SDK.
if let url = URL(string: UIApplication.openSettingsURLString) {
    UIApplication.shared.open(url)
}

Flutter

The Flutter SDK 1.0.1 has no settings helper. Open the app settings with a settings plugin of your choice, or your own platform channel that calls the native APIs shown above.

When the person comes back from Settings, you do not need to do anything: the SDK reports the change on its own (see the next section).

What 1.0.1 reports automatically

Since SDK 1.0.1, Oricato keeps push_permission current without extra code:

  • Any prompt counts. A permission granted or denied from your own prompt, another SDK’s prompt, or Oricato.requestPermission is reported as soon as the app returns to the foreground.
  • Settings changes count. If someone switches notifications on or off in the phone’s Settings, the change is reported when the app is next in the foreground. On iOS, the SDK also registers with APNs after a grant if nothing else in the app did.
  • Pushes that cannot be shown count. On Android, if an Oricato push arrives while app notifications are switched off, the SDK reports push_permission = denied so the server stops targeting the device. A delivered receipt is still recorded when the message asked for one, because the device did receive it.
  • No duplicate writes. The SDK compares the state with what the server last received and only sends an update when something changed.

You can see the value for each device on your project’s Audience page in the dashboard, where it is shown as Allowed, Allowed quietly (iOS), Blocked or Not asked yet. The public REST API (/api/v1) has no subscription endpoints; the raw push_permission value (granted, denied, not_determined or provisional) appears on the subscription records that the dashboard reads.

optIn and optOut are not the OS permission

Oricato.optIn() and Oricato.optOut() are an app-level switch, separate from the system permission:

  • optOut() tells the server to stop sending to this installation, even when the OS permission is granted. Use it for an in-app “Notifications” switch.
  • optIn() turns sending back on (opted in is the default). It does not show a prompt and cannot override a denied OS permission.
// Android
Oricato.optOut()
Oricato.optIn()
// iOS
Oricato.optOut()
Oricato.optIn()
// Flutter
await Oricato.optOut();
await Oricato.optIn();

A device receives notifications only when it is opted in and push_permission is granted or provisional.

Migrating from OneSignal: only one SDK prompts

While OneSignal is still in the app, only one SDK should show the prompt. Both SDKs read the same system permission, so keep OneSignal’s prompt and leave out Oricato.requestPermission, or the other way round. On iOS, if you keep OneSignal’s prompt, you can keep application.registerForRemoteNotifications() in your app, but it is optional: since 1.0.1, the Oricato SDK calls registerForRemoteNotifications() itself when it sees a grant from any prompt, and it reports whatever answer OneSignal’s prompt receives as soon as the app is back in front. See Migrate from OneSignal.

Verify it works

  1. Install a build of Lingora on a real device and open it once, so the subscription is created.
  2. In the dashboard, open your project’s Audience page and find the device. Its permission shows Not asked yet (not_determined) on Android 13+ and iOS, or Allowed on older Android versions.
  3. Go through your pre-prompt and allow notifications. The device changes to Allowed (granted), or Allowed quietly (iOS) for provisional.
  4. Switch notifications off for the app in the phone’s Settings, then return to the app. The device changes to Blocked (denied).
  5. Switch them back on and return to the app. It changes back to Allowed.
  6. Send a test notification from Verify setup and confirm it appears.

To see what the SDK does, raise the log level during testing. On Android:

import com.oricato.push.Oricato
import com.oricato.push.OricatoLogLevel

Oricato.setLogLevel(OricatoLogLevel.DEBUG)

The SDK then logs “Notification permission is now …; reporting it” when the state changes.

Troubleshooting

The Android prompt never shows

  • The device runs Android 12L or lower. There is no runtime prompt; the callback gets the current state. Notifications are on by default; people turn them off in Settings.
  • The person already denied it twice. Android 13+ stops showing the prompt. requestPermission returns false without a dialog. Offer Oricato.openNotificationSettings(context) instead.
  • Your app targets API 32 or lower. On Android 13+, the system then decides when to show the prompt itself (typically when the app creates its first notification channel), and your call cannot show it. Set targetSdk to 33 or higher.
  • Permission is already granted. The callback receives true right away and no prompt appears.

iOS shows no prompt

  • The prompt appears only once per install. After that, requestPermission returns the stored answer. Delete and reinstall the app to test the prompt again.
  • If you requested .provisional, no prompt is shown by design. Notifications arrive quietly in Notification Center with no banner or sound, and the status is provisional. People can choose to keep or turn off those notifications from the notification itself.

Permission is granted but notifications stay silent

Some Android OEM skins, for example TECNO HiOS, can demote notifications to silent (no sound, no heads-up banner) even when the permission is granted. This is a device setting, not an Oricato setting. Ask people to check the app’s notification settings on their phone (allow sound and banners, or set the channel to an alerting level), and see Android notification channels for how channel importance and sound are set.

The dashboard still shows the old state

The state is reported when the app comes to the foreground. Bring the app to the front once after changing Settings. If the device still shows the old value, check that the device has network access and that the SDK is version 1.0.1 or later; 1.0.0 did not report permission changes made outside Oricato.

Notifications do not arrive at all

Permission is only one requirement. On Android, check that the manifest declares com.oricato.push.OricatoMessagingService (or that your own FirebaseMessagingService forwards to Oricato), and that the FCM token is not null. On iOS, check that the APNs key is uploaded in Firebase; without it, sends fail with apns_auth_error. See Troubleshooting delivery.

Related

Get early access to Oricato.

Founding teams get early access, free help moving from OneSignal, and a founding discount.

We use this to reply, plan your invitation and set up your account. Privacy Policy

A person reads every request.

Or get the monthly newsletter