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

[Bug]: promptForPushNotificationsWithUserResponse puts app in background for half a second for no reason #1658

Open
3 tasks done
pierroo opened this issue Mar 2, 2024 · 1 comment

Comments

@pierroo
Copy link

pierroo commented Mar 2, 2024

What happened?

I just realized that OneSignal.promptForPushNotificationsWithUserResponse puts the app in background for half a second when it's called.
I use "react-native-appstate-hook" to detect app state change, and if I comment out this function it no longer goes in background.

I never noticed it before, recent changes were updating onesignal from 4.5.1 to 4.5.2, and react native from 0.69.12 to 0.73.4

obviously this is problematic!

Steps to reproduce?

1- set app an app state listener
2- call promptForPushNotificationsWithUserResponse
3- notice that app goes to background when function is called

What did you expect to happen?

Leave my app foreground, obviously

React Native OneSignal SDK version

4.5.2

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@pierroo
Copy link
Author

pierroo commented Mar 2, 2024

Additional information: apparently onesignal is not at fault for putting app in background, even the

PermissionsAndroid.request(
            PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS,
          )

for react native will bring the app to background

does anyone know WHY and if there is a way to avoid it?

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

1 participant