@imatis/react-native-notifications 4.3.3-imatis.12 → 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.
|
@@ -58,6 +58,14 @@ public class PushNotificationProps {
|
|
|
58
58
|
return 0.0;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
public Double getVolume() {
|
|
62
|
+
String val = mBundle.getString("volume");
|
|
63
|
+
if(val != null && !val.isEmpty()){
|
|
64
|
+
return Double.parseDouble(val);
|
|
65
|
+
}
|
|
66
|
+
return 0.0;
|
|
67
|
+
}
|
|
68
|
+
|
|
61
69
|
public Boolean getOverridemute() {
|
|
62
70
|
String val = mBundle.getString("overridemute");
|
|
63
71
|
if(val != null && !val.isEmpty()){
|
|
@@ -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
|
-
|
|
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.
|
|
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.
|
|
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/
|
|
79
|
+
"url": "git+https://github.com/ImatisVN/react-native-notifications.git"
|
|
80
80
|
},
|
|
81
|
-
"homepage": "https://github.com/
|
|
81
|
+
"homepage": "https://github.com/ImatisVN/react-native-notifications",
|
|
82
82
|
"bugs": {
|
|
83
|
-
"url": "https://github.com/
|
|
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
|
+
}
|