Skip to content

Commit

Permalink
Trying to fix the problem when sendEvent method was fired before Reac…
Browse files Browse the repository at this point in the history
…t was fully set up, as suggested in OneSignal#906
  • Loading branch information
italodokyte committed Aug 24, 2021
1 parent 41e32ae commit bf1737c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ private void removeHandlers() {
}

private void sendEvent(String eventName, Object params) {
if(!mReactContext.hasActiveCatalystInstance()) {
return;
}

mReactContext
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
.emit(eventName, params);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-onesignal",
"version": "4.3.0",
"version": "4.3.1",
"description": "React Native OneSignal SDK",
"main": "src/index",
"typings": "src/index.d.ts",
Expand Down

0 comments on commit bf1737c

Please sign in to comment.