Skip to content

Commit 7ab9134

Browse files
committed
Remove default callback function from setExternalUserId
Motivation: this default callback isn't necessary because in the Java bridge the callback parameter is of type `final` which is `nullable`. This was prompted by the need for a workaround for a crash caused by having the external id and email set. If both are set, currently the native SDK triggers the `onSuccess` of each setter method to fire independently which is causing the passed in callback to fire twice, which is prohibited by React Native (crashes).
1 parent 4b7bc48 commit 7ab9134

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ export default class OneSignal {
254254
return;
255255
}
256256

257-
RNOneSignal.setExternalUserId(externalId, varArg1, varArg2 || function(){});
257+
RNOneSignal.setExternalUserId(externalId, varArg1, varArg2);
258258
}
259259

260260
static removeExternalUserId(handler) {

0 commit comments

Comments
 (0)