Open JmeHsieh opened 5 years ago
Hello there!
Sorry for taking so long to reply.
Was this tested only on a simulator or also in physical devices?
I was testing on physical iPhoneX
Does the same happen with v0.4.4?
@Vanethos I have this issue on a Oneplus 5 running Android 9 (didn't test any other version) with this code.
onPressed: () async {
PermissionStatus status = await NotificationPermissions.requestNotificationPermissions();
print('Status: $status');
final bool granted = status == PermissionStatus.granted;
print('Granted: $granted');
return Navigator.maybePop(context, granted);
},
And this is the output:
I/flutter (15444): Status: PermissionStatus.unknown
I/flutter (15444): Granted: false
In the docs, it says Android will never have an unknown
status, but I'm getting it. In app settings, notifications are enabled (fresh install of the app, so it should be enabled by default anyway). Also, if I manually disable them, it also prints unknown
as status.
I'm using v0.4.4
and Flutter 1.15.4-pre.117
while debugging.
@Vanethos I'm having the same behavior with version 0.4.4 on an iPhone device with iOS 13.3.1
When the status is already granted
,
requestNotificationPermissions
always returns unknown
, yet
getNotificationPermissionStatus
returns granted
correctly.
@Vanethos this issue probably needs to be reopened. And probably is a high priority one... If you need help to make a fix let me know!
@thearaks if you know or can work out a fix for this, you can submit a PR for it with the fix, so it can be fixed and published faster
@Zazo032 I'm not an expert iOS developer and, beside that, I prefer to get in touch with the maintainer before submitting a PR. The last thing I want is to spend time preparing a fix that will never be merged since I'm already pretty busy at the moment :)
@thearaks in the following days I’ll be checking this issue, thanks for the heads up!
@Vanethos hi! Any update on this issue? 😄
If the permission status is currently unknown,
requestNotificationPermissions
will returngranted
if I accept the dialog, which is correct.But when the status is already granted,
requestNotificationPermissions
always returnsunknown
, yetgetNotificationPermissionStatus
returnsgranted
correctly.Tested on iOS 12.1, 13.1, 13.2.