File tree Expand file tree Collapse file tree
lib/android/app/src/main/java/com/wix/reactnativenotifications/fcm Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import android .util .Log ;
66
77import com .facebook .react .ReactApplication ;
8- import com .facebook .react .ReactInstanceManager ;
98import com .facebook .react .bridge .ReactContext ;
109import com .google .firebase .messaging .FirebaseMessaging ;
1110import com .wix .reactnativenotifications .BuildConfig ;
@@ -98,13 +97,9 @@ protected void refreshToken() {
9897 }
9998
10099 protected void sendTokenToJS () {
101- final ReactInstanceManager instanceManager = (( ReactApplication ) mAppContext ). getReactNativeHost (). getReactInstanceManager () ;
102- ReactContext reactContext = instanceManager .getCurrentReactContext ();
100+ ReactApplication reactApplication = (ReactApplication ) mAppContext ;
101+ ReactContext reactContext = reactApplication . getReactHost () .getCurrentReactContext ();
103102
104- if (reactContext == null ) {
105- // If the react context is not available, try to get the current context from the react host (RN0.76).
106- reactContext = ((ReactApplication ) mAppContext ).getReactHost ().getCurrentReactContext ();
107- }
108103 // Note: Cannot assume react-context exists cause this is an async dispatched service.
109104 if (reactContext != null && reactContext .hasActiveReactInstance ()) {
110105 Bundle tokenMap = new Bundle ();
You can’t perform that action at this time.
0 commit comments