Skip to content

Commit

Permalink
fix: skip handlers removal if SDK is not initialized
Browse files Browse the repository at this point in the history
Signed-off-by: Guilherme Ribas <[email protected]>
  • Loading branch information
Ribas187 committed Jan 31, 2024
1 parent 57498c7 commit 850f1b0
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ private void removeObservers() {
}

private void removeHandlers() {
if(!oneSignalInitDone) {
Log.i("OneSignal", "OneSignal React-Native SDK not initialized yet. Could not remove handlers.");
return;
}

OneSignal.getInAppMessages().removeClickListener(rnInAppClickListener);
hasAddedInAppMessageClickListener = false;
OneSignal.getInAppMessages().removeLifecycleListener(rnInAppLifecycleListener);
Expand Down

0 comments on commit 850f1b0

Please sign in to comment.