Skip to content
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

Exponea.requestPushAuthorization not resolving on Android when permission is denied. #125

Open
dannyBies opened this issue Sep 2, 2024 · 1 comment

Comments

@dannyBies
Copy link

When I call Exponea.requestPushAuthorization I see the following behaviour:

IOS

  • Grant push notification permission
    Works as expected

  • Deny push notification permission
    Works as expected

Android

  • Deny push notification permission
    The promise never resolves. It should return false. This results in the app not executing code that's running in the same thread.
await Exponea.requestPushAuthorization();
console.log("I am not called")

This log will never appear.

  • Grant push notification permission
    The promise does not resolve the first time this function is called just like the above scenario. If I call this function again at a later point it will resolve successfully and return true as expected.

I am using a OnePlus 8T - Android 14 to test

@adam1929
Copy link
Collaborator

adam1929 commented Sep 3, 2024

Hi @dannyBies thank you for reporting.
Behaviour you described does make sense, but still is unwanted. Native part is waiting for response from system if permission has been granted or not. The promise is resulted after that.
In case of denied permission, SDK should show dialog to user to grant permission. That has to be done on main UI thread. Is it possible that you are invoking await Exponea.requestPushAuthorization(); on UI thread (button click, etc...) ? Could you move await into background thread?
If that doesn't help, could you see any suspicious app logs or system logs? There could be something that prevents from system to response to SDK so promise.resolve() is delayed or not called at all.
If you want to investigate this behaviour with your logs, please ask your CSM and open issue with our support team.
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants