Skip to content

Commit

Permalink
Pull request #17: Klatypov PZ-165 background crash
Browse files Browse the repository at this point in the history
Merge in MML/infobip-mobile-messaging-react-native-plugin from klatypov-PZ-165-background_crash to master

Squashed commit of the following:

commit fa4ba6035af4484a9ba81fbc1a4bfe22638d37f6
Author: Konstantin Latypov <[email protected]>
Date:   Sat Oct 3 21:45:31 2020 +0300

    Remove comment

commit 74cf25cc8d1aef61a6292646498164fcbf811670
Author: Konstantin Latypov <[email protected]>
Date:   Sat Oct 3 21:43:22 2020 +0300

    Fix background crash
  • Loading branch information
Konstantin Latypov authored and Konstantin Latypov committed Oct 5, 2020
1 parent b2b5ec0 commit b191042
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ public class ReactNativeMobileMessagingModule extends ReactContextBaseJavaModule

public ReactNativeMobileMessagingModule(ReactApplicationContext reactContext) {
super(reactContext);

while (getReactApplicationContext() == null);
reactContext = getReactApplicationContext();

this.reactContext = reactContext;
reactContext.addLifecycleEventListener(this);
}
Expand Down Expand Up @@ -230,6 +234,12 @@ public void init(ReadableMap args, final Callback successCallback, final Callbac
builder.withoutSystemInfo();
}

if (reactContext == null) {
Log.i(Utils.TAG, "reactContext: IS NULL");
} else {
Log.i(Utils.TAG, "reactContext.toString():");
Log.i(Utils.TAG, reactContext.toString());
}
if (configuration.messageStorage != null) {
MessageStoreAdapter.reactContext = reactContext;
builder.withMessageStore(MessageStoreAdapter.class);
Expand Down

0 comments on commit b191042

Please sign in to comment.