Skip to content

Commit

Permalink
Remove default callback function from setExternalUserId
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
rgomezp committed Jan 8, 2021
1 parent 4b7bc48 commit 7ab9134
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export default class OneSignal {
return;
}

RNOneSignal.setExternalUserId(externalId, varArg1, varArg2 || function(){});
RNOneSignal.setExternalUserId(externalId, varArg1, varArg2);
}

static removeExternalUserId(handler) {
Expand Down

0 comments on commit 7ab9134

Please sign in to comment.