Unity-Technologies / com.unity.mobile.notifications

Mobile Notifications Package
https://docs.unity3d.com/Packages/com.unity.mobile.notifications@2.1/manual/index.html
Other
131 stars 42 forks source link

Wrong status after swipe away the dialog #233

Closed IgorGalimski closed 1 year ago

IgorGalimski commented 1 year ago

I found an issue with 2.1.0 version When I request the permission with PermissionRequest class and swipe away the dialog - the state of permission is DeniedDontAskAgain. It sounds wrong - because according to android documentation the status should not change: https://developer.android.com/develop/ui/views/notifications/notification-permission#user-swipe-away User swipes away from dialog If the user swipes away from the dialog—that is, they don't select either allow or don't allow—the state of the notification permission doesn't change.

Apart from this - when I try to request the permission again - I can't do it, because PermissionRequest class has check for Denied status:

    public PermissionRequest()
    {
        Status = AndroidNotificationCenter.UserPermissionToPost;
        switch (Status)
        {
            case PermissionStatus.NotRequested:
            case PermissionStatus.Denied:
                Status = PermissionStatus.RequestPending;
                RequestPermission();
                break;
        }
    }

It means - after I swipe away the dialog I can't request the permission anymore

IgorGalimski commented 1 year ago

Up

aurimasc commented 1 year ago

Opened a ticket in core Unity, the issue is there.