You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After obtaining push notification permissions using OneSignal.Notifications.permission in my Flutter project, the initial value is true. However, upon completely closing and reopening the app, the OneSignal.Notifications.permission value returns false.
Steps to reproduce?
1- Initialize OneSignal in the initState method:
void initState() {
OneSignal.initialize("your-app-id");
super.initState();
}
2- Request push notification permissions using a method like the following:
Future<void> requestNotificationPermission() async {
await OneSignal.Notifications.requestPermission(true);
bool permissionGranted = getNotificationPermission();
}
3- Expect the initial permission value to be true after obtaining permissions.
4- Completely close the app and reopen it.
5- Check the OneSignal.Notifications.permission value, and observe that it is now false:
bool getNotificationPermission() {
bool permissionGranted = OneSignal.Notifications.permission;
debugPrint("Notification Permission: $permissionGranted");
return permissionGranted;
}
What did you expect to happen?
I expected that after obtaining push notification permissions, the OneSignal.Notifications.permission value would remain true even after completely closing and reopening the app.
OneSignal Flutter SDK version
5.1.0
Which platform(s) are affected?
iOS
Android
Relevant log output
[OneSignalPlugin] Notification permission status: true
The initial log output indicates that the notification permission status is true after successfully obtaining push notification permissions. However, upon reopening the app, the log output shows:
[OneSignalPlugin] Notification permission status: false
This is unexpected as I anticipated the permission status to persist as true even after restarting the application.
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Hello there--apologies that this issue was missed. If this is still a problem, can you please update to the latest SDK version and open a new issue with updated information? Thank you!
What happened?
After obtaining push notification permissions using OneSignal.Notifications.permission in my Flutter project, the initial value is true. However, upon completely closing and reopening the app, the OneSignal.Notifications.permission value returns false.
Steps to reproduce?
1- Initialize OneSignal in the initState method: void initState() { OneSignal.initialize("your-app-id"); super.initState(); } 2- Request push notification permissions using a method like the following: Future<void> requestNotificationPermission() async { await OneSignal.Notifications.requestPermission(true); bool permissionGranted = getNotificationPermission(); } 3- Expect the initial permission value to be true after obtaining permissions. 4- Completely close the app and reopen it. 5- Check the OneSignal.Notifications.permission value, and observe that it is now false: bool getNotificationPermission() { bool permissionGranted = OneSignal.Notifications.permission; debugPrint("Notification Permission: $permissionGranted"); return permissionGranted; }
What did you expect to happen?
I expected that after obtaining push notification permissions, the OneSignal.Notifications.permission value would remain true even after completely closing and reopening the app.
OneSignal Flutter SDK version
5.1.0
Which platform(s) are affected?
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: