-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
request permission is never fired at all on android 13 #2012
Comments
https://github.com/ZarishIqbal/cordova-local-notifications-plugin use this instead |
private void requestPermission(CallbackContext callbackContext) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// Create a notification channel for Android 8.0 and above
createNotificationChannel();
if (NotificationManagerCompat.from(context).areNotificationsEnabled()) {
callbackContext.success("Notification already enabled");
} else {
Intent intent = new Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS);
intent.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName());
context.startActivity(intent);
}
}
} Or change the native code to this. |
Hi ZarishIqbal - Thanks for posting the code. I'm trying to work with your code to fix the Android 13 permission problem. I've looked at https://github.com/ZarishIqbal/cordova-local-notifications-plugin and don't see where you're requestPermission() function. I''d like to integrate your requestPermission() function into https://github.com/bhandaribhumin/cordova-plugin-local-notification-12 which is what I've been using for a while. Many thanks! |
Figured it out. Use the plugin https://github.com/NeoLSN/cordova-plugin-android-permissions and then it's simple.
and of course add POST_NOTIFICATION to your Android Manifest file. |
This should be fixed, with the latest master. |
ionic v3
it never fire any push notification permission . and when I look into permission, push notification is off.
ionic info
The text was updated successfully, but these errors were encountered: