@imatis/react-native-notifications 4.3.3-imatis.13 → 4.3.3-imatis.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -89,13 +89,18 @@ public class FcmToken implements IFcmToken {
89
89
 
90
90
  protected void sendTokenToJS() {
91
91
  final ReactInstanceManager instanceManager = ((ReactApplication) mAppContext).getReactNativeHost().getReactInstanceManager();
92
- final ReactContext reactContext = instanceManager.getCurrentReactContext();
92
+ ReactContext reactContext = instanceManager.getCurrentReactContext();
93
93
 
94
+ if (reactContext == null) {
95
+ // If the react context is not available, try to get the current context from the react host (RN0.76).
96
+ reactContext = ((ReactApplication) mAppContext).getReactHost().getCurrentReactContext();
97
+ }
94
98
  // Note: Cannot assume react-context exists cause this is an async dispatched service.
95
- if (reactContext != null && reactContext.hasActiveCatalystInstance()) {
99
+ if (reactContext != null && reactContext.hasActiveReactInstance()) {
96
100
  Bundle tokenMap = new Bundle();
97
101
  tokenMap.putString("deviceToken", sToken);
98
102
  mJsIOHelper.sendEventToJS(TOKEN_RECEIVED_EVENT_NAME, tokenMap, reactContext);
99
103
  }
100
104
  }
105
+
101
106
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imatis/react-native-notifications",
3
- "version": "4.3.3-imatis.13",
3
+ "version": "4.3.3-imatis.14",
4
4
  "description": "Advanced Push Notifications (Silent, interactive notifications) for iOS & Android",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -76,11 +76,11 @@
76
76
  },
77
77
  "repository": {
78
78
  "type": "git",
79
- "url": "https://github.com/wix/react-native-notifications.git"
79
+ "url": "git+https://github.com/ImatisVN/react-native-notifications.git"
80
80
  },
81
- "homepage": "https://github.com/wix/react-native-notifications",
81
+ "homepage": "https://github.com/ImatisVN/react-native-notifications",
82
82
  "bugs": {
83
- "url": "https://github.com/wix/react-native-notifications/issues"
83
+ "url": "https://github.com/ImatisVN/react-native-notifications/issues"
84
84
  },
85
85
  "jest": {
86
86
  "preset": "react-native",
@@ -114,4 +114,4 @@
114
114
  "html"
115
115
  ]
116
116
  }
117
- }
117
+ }