Skip to content

[Bug]: canRequestPermission function always returns true #1792

Description

@ngoni

What happened?

When calling the below function on v5.0.0-beta4, the function always returns true, even if the device has been prompted for push notification permission (which is contrary to the documentation).

val canRequest: Boolean = OneSignal.Notifications.canRequestPermission

Steps to reproduce?

1. Install v5.0.0-beta4 SDK
2. Ensure this is a new installation of your application on a device with Android 13+
3. Call the following function: `OneSignal.Notifications.canRequestPermission`
4. You'll notice Step 3, return `true` and then proceed to request for Push Notifications Permission. Allow the application the required permission.
5. Execute Step 3 again, you'll notice the function still returns `true`, but based on the documentation this should return `false`

What did you expect to happen?

When I make a call to the below code, after the device has already been prompted for push notifications permission the function should return false

val canRequest: Boolean = OneSignal.Notifications.canRequestPermission

OneSignal Android SDK version

Release 5.0.0-beta4

Android version

13

Specific Android models

Android Studio Emulator on Android 13

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions