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

Argument 1 of OneSignal.sendOutcome must not be null #1348

Closed
leethree opened this issue Jan 20, 2022 · 3 comments · Fixed by #1356
Closed

Argument 1 of OneSignal.sendOutcome must not be null #1348

leethree opened this issue Jan 20, 2022 · 3 comments · Fixed by #1356

Comments

@leethree
Copy link

leethree commented Jan 20, 2022

Description:

sendOutcome doesn't work without its 2nd argument since recent versions. it was working fine in previous versions.

Environment

react-native-onesignal v4.3.4
react-native: v0.66.4

Steps to Reproduce Issue:

  1. OneSignal.sendOutcome('foobar');
  2. see error:

image

Anything else:

I think it's caused by this commit: 7d48a4c

The default value of handler is removed:

image

@nan-li
Copy link
Contributor

nan-li commented Jan 21, 2022

Thanks for reporting @leethree, we will fix this in the next release.

In the meantime, as a temporary workaround, you can pass an empty function as the second argument.

@manuhook
Copy link

Hi @nan-li, on the last version I have this crash happening in production (never happen before):

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.onesignal.OSOutcomeEventsController.sendSavedOutcomes()' on a null object reference
       at com.onesignal.OneSignal.init(OneSignal.java:837)
       at com.onesignal.OneSignal.setAppId(OneSignal.java:692)
       at com.onesignal.OneSignal.reassignDelayedInitParams(OneSignal.java:1136)
       at com.onesignal.OneSignal.onRemoteParamSet(OneSignal.java:844)
       at com.onesignal.OneSignal$6.complete(OneSignal.java:1077)
       at com.onesignal.OneSignalRemoteParams.processJson(OneSignalRemoteParams.java:206)
       at com.onesignal.OneSignalRemoteParams.access$100(OneSignalRemoteParams.java:12)
       at com.onesignal.OneSignalRemoteParams$1.onSuccess(OneSignalRemoteParams.java:151)
       at com.onesignal.OneSignalRestClient$5.run(OneSignalRestClient.java:292)
       at java.lang.Thread.run(Thread.java:929)

Do you think it's related ?
Thank you

@nan-li
Copy link
Contributor

nan-li commented Jan 30, 2022

Hi @manuhook, I don't think your exception is related to the original poster's issue.

  1. Are you on react-native-onesignal v4.3.5?
  2. What devices and Android versions are experiencing this crash?
  3. How many/percentage of users are being affected?

It looks like it may be related to this open issue in the OneSignal-Android-SDK.

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