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]: Exception in Hostfunction: <unknown> #1788

Open
2 of 3 tasks
jeroenburgers opened this issue Feb 19, 2025 · 2 comments
Open
2 of 3 tasks

[Bug]: Exception in Hostfunction: <unknown> #1788

jeroenburgers opened this issue Feb 19, 2025 · 2 comments

Comments

@jeroenburgers
Copy link

jeroenburgers commented Feb 19, 2025

What happened?

We are trying to update React Native from 0.75.* to 0.77.1. When we open the app in the simulator we receive an error message from the OneSignal SDK.

Image

Current react native: 0.77.1
Current One Signal SDK: 4.5.4

Steps to reproduce?

It happend when we update to the latest react native version. When we disable `setExternalUserId`, the app works fine. Possible it's a problem with the OneSignal SDK.

We know that are a new version of OneSignal SDK is available, but we are not ready to update to the latest version.

What did you expect to happen?

I expected that the app would run correctly after implementing setExternalUserId from OneSignal.

React Native OneSignal SDK version

4.5.4

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

Code of Conduct

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

nan-li commented Feb 19, 2025

Hi @jeroenburgers thanks for reporting. Unfortunately Exception in Hostfunction: <unknown> is not a lot of information for us to go on.

  1. Can you share an example of how you use setExternalUserId()? What arguments are you passing, since it has optional parameters?
  2. Do you run into errors calling other OneSignal methods? What other OneSignal methods work for you? This could help us narrow down how the setExternalUserId() method is differs.
  3. Have you tested on Android? Does any errors appear?

@jeroenburgers
Copy link
Author

Hi @nan-li,

We have decided to migrate to version 5. It's a waste of time to invest in it. Our approach is always to keep these types of updates separate.

What happened: The app crashed when we used setExternalUserId in an initialized useEffect hook. Without this method, everything works fine.

It might have been due to our AppDelegete file which is replaced with a Swift file (just like the migration guide of react native).

For now, we can close this issue.

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