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]: Already initialized the OneSignal React-Native SDK #1521

Closed
3 tasks done
techday84 opened this issue Jun 9, 2023 · 1 comment
Closed
3 tasks done

[Bug]: Already initialized the OneSignal React-Native SDK #1521

techday84 opened this issue Jun 9, 2023 · 1 comment

Comments

@techday84
Copy link

techday84 commented Jun 9, 2023

What happened?

E/OneSignal: Already initialized the OneSignal React-Native SDK.

This issue happens with 4.5.1 and 4.5.0

"react-native-onesignal": "^4.5.1",
"react-native-share": "^8.1.0",
"react-native-inappbrowser-reborn": "^3.7.0",

Steps to reproduce?

1. Install the packages.
2. Launch the app: npx react-native run-android
3. When the app changes from background to foreground or when you open a link with the inappbrowser or when you try to share a link with whatsApp. I think the error occurs every time the state of the app changes.
4. Note that android studio console error always shows  "E/OneSignal: Already initialized the OneSignal React-Native SDK."

What did you expect to happen?

I don't understand why it always get an error that it is already initialized when the app changes state or when you open things in the app that make it change the app state.

React Native OneSignal SDK version

4.5.1

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

E/OneSignal: Already initialized the OneSignal React-Native SDK

Code of Conduct

  • I agree to follow this project's Code of Conduct
@nan-li
Copy link
Contributor

nan-li commented Jun 10, 2023

Hi @techday84,

Thanks for reaching out with your question. This error message can be safely ignored and we should probably change this to a VERBOSE level log instead of an ERROR.

This is why it is being logged so often: the SDK gets the activity/context info when an Android activity is resumed, but if the SDK already has it, it will output this log. Therefore, the SDK will log this whenever an activity is resumed and it already has the information needed.

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