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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notifly-sdk",
3
- "version": "2.2.5",
3
+ "version": "2.2.6",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/constant.js CHANGED
@@ -1,4 +1,4 @@
1
- export const SDK_VERSION = '2.2.5';
1
+ export const SDK_VERSION = '2.2.6';
2
2
 
3
3
  export const NAMESPACE = {
4
4
  'EVENTID': '830b5f7b-e392-43db-a17b-d835f0bcab2b',
@@ -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={0}
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
+ }