notifly-sdk 2.2.5 → 2.2.6
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.
- package/package.json +1 -1
- package/src/constant.js +1 -1
- package/src/in_app_message.js +14 -1
package/package.json
CHANGED
package/src/constant.js
CHANGED
package/src/in_app_message.js
CHANGED
|
@@ -43,6 +43,7 @@ export async function showInAppMessage(data, openedInAppWebViewCount) {
|
|
|
43
43
|
}));
|
|
44
44
|
});
|
|
45
45
|
`;
|
|
46
|
+
const backdropOpacity = _getBackgroundOpacity(modalProperties?.backgroundOpacity);
|
|
46
47
|
|
|
47
48
|
const webviewMessageHandler = (e) => {
|
|
48
49
|
const message = JSON.parse(e.nativeEvent.data);
|
|
@@ -138,7 +139,7 @@ export async function showInAppMessage(data, openedInAppWebViewCount) {
|
|
|
138
139
|
openedInAppWebViewCount.count = openedInAppWebViewCount.count - 1;
|
|
139
140
|
modal.destroy();
|
|
140
141
|
}}
|
|
141
|
-
backdropOpacity={
|
|
142
|
+
backdropOpacity={backdropOpacity}
|
|
142
143
|
style={webViewProps.modalStyle}
|
|
143
144
|
>
|
|
144
145
|
<View>
|
|
@@ -243,3 +244,15 @@ function _getViewHeight(modalProps, screenWidth, screenHeight) {
|
|
|
243
244
|
|
|
244
245
|
return viewHeight;
|
|
245
246
|
}
|
|
247
|
+
|
|
248
|
+
function _getBackgroundOpacity(backgroundOpacity) {
|
|
249
|
+
// if backgroundOpacity is not defined, default value is 0.2
|
|
250
|
+
if (backgroundOpacity === undefined) {
|
|
251
|
+
return 0.2;
|
|
252
|
+
}
|
|
253
|
+
// if backgroundOpacity is not between 0 and 1, default value is 0.2
|
|
254
|
+
if (backgroundOpacity < 0 || backgroundOpacity > 1) {
|
|
255
|
+
return 0.2;
|
|
256
|
+
}
|
|
257
|
+
return backgroundOpacity;
|
|
258
|
+
}
|