react-native-netmera 1.4.6-nohms → 1.4.7-nohms

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.
@@ -1 +1 @@
1
- #Thu Nov 17 17:47:56 TRT 2022
1
+ #Fri Dec 30 11:39:30 TRT 2022
@@ -16,7 +16,7 @@ android {
16
16
  }
17
17
 
18
18
  dependencies {
19
- implementation 'com.netmera:nmcore:3.9.7'
19
+ implementation 'com.netmera:nmcore:3.9.9'
20
20
  implementation 'com.netmera:nmfcm:3.9.3'
21
21
  implementation 'com.facebook.react:react-native:+'
22
22
  }
@@ -16,7 +16,7 @@ public class RNNetmera {
16
16
  static void setNetmeraHeaders() {
17
17
  ContentValues headerValues = new ContentValues();
18
18
  headerValues.put("X-netmera-framework", "react");
19
- headerValues.put("X-netmera-frameworkV", "1.4.6");
19
+ headerValues.put("X-netmera-frameworkV", "1.4.7");
20
20
  Netmera.setNetmeraHeaders(headerValues);
21
21
  }
22
22
  }
@@ -24,6 +24,7 @@ import com.facebook.react.bridge.WritableNativeMap;
24
24
  import com.google.gson.Gson;
25
25
  import com.netmera.NetmeraCarouselObject;
26
26
  import com.netmera.NetmeraPushObject;
27
+ import com.netmera.NetmeraPushStyle;
27
28
  import com.netmera.data.NMCategoryPreference;
28
29
  import com.netmera.data.NMInboxStatus;
29
30
  import com.netmera.data.NMInboxStatusCount;
@@ -200,6 +201,9 @@ class RNNetmeraUtil {
200
201
 
201
202
  public static WritableMap mapPushObject(NetmeraPushObject pushObject) {
202
203
  WritableMap pushObjectMap = Arguments.createMap();
204
+ if (pushObject == null) {
205
+ return pushObjectMap;
206
+ }
203
207
  pushObjectMap.putInt("pushType", pushObject.getPushType());
204
208
  pushObjectMap.putString("pushId", pushObject.getPushId());
205
209
  pushObjectMap.putString("pushInstanceId", pushObject.getPushInstanceId());
@@ -232,21 +236,28 @@ class RNNetmeraUtil {
232
236
  pushObjectMap.putString("expireTime", String.valueOf(DateFormat.format("yyyy-MM-dd HH:mm:ss", pushObject.getPopupExpirationTime())));
233
237
  }
234
238
 
235
- if (pushObject.getWebPageUrl() != null) {
236
- pushObjectMap.putString("webPage", pushObject.getWebPageUrl());
237
- }
238
-
239
239
  if (pushObject.getInteractiveActions() != null && !pushObject.getInteractiveActions().isEmpty()) {
240
240
  pushObjectMap.putString("interactiveActions", new Gson().toJson(pushObject.getInteractiveActions()));
241
241
  }
242
242
 
243
243
  /* Push Style */
244
244
  if (pushObject.getPushStyle() != null) {
245
- pushObjectMap.putString("title", pushObject.getPushStyle().getContentTitle());
246
- pushObjectMap.putString("subtitle", pushObject.getPushStyle().getSubText());
247
- pushObjectMap.putString("body", pushObject.getPushStyle().getContentText());
248
- pushObjectMap.putString("mediaAttachmentURL", pushObject.getPushStyle().getBigPicturePath());
249
- pushObjectMap.putString("carousel", new Gson().toJson(pushObject.getPushStyle().retrieveCarouselObjects()));
245
+ NetmeraPushStyle pushStyle = pushObject.getPushStyle();
246
+ if (pushStyle.getContentTitle() != null) {
247
+ pushObjectMap.putString("title", pushStyle.getContentTitle());
248
+ }
249
+ if (pushStyle.getSubText() != null) {
250
+ pushObjectMap.putString("subtitle", pushStyle.getSubText());
251
+ }
252
+ if (pushStyle.getContentText() != null) {
253
+ pushObjectMap.putString("body", pushStyle.getContentText());
254
+ }
255
+ if (pushStyle.getBigPicturePath() != null) {
256
+ pushObjectMap.putString("mediaAttachmentURL", pushStyle.getBigPicturePath());
257
+ }
258
+ if (pushStyle.retrieveCarouselObjects() != null) {
259
+ pushObjectMap.putString("carousel", new Gson().toJson(pushStyle.retrieveCarouselObjects()));
260
+ }
250
261
  }
251
262
 
252
263
  if (pushObject.getSendDate() != null) {
@@ -255,6 +266,10 @@ class RNNetmeraUtil {
255
266
 
256
267
  if (pushObject.getPushAction() != null) {
257
268
  pushObjectMap.putString("pushAction", new Gson().toJson(pushObject.getPushAction()));
269
+
270
+ if (pushObject.getWebPageUrl() != null) {
271
+ pushObjectMap.putString("webPage", pushObject.getWebPageUrl());
272
+ }
258
273
  }
259
274
 
260
275
  return pushObjectMap;
package/ios/RNNetmera.m CHANGED
@@ -46,7 +46,7 @@ NSString *const ERROR_MESSAGE_SET_CATEGORY_PREFERENCE = @"Error occurred while s
46
46
 
47
47
  + (void)setNetmeraHeaders {
48
48
  [Netmera setFramework:@"react"];
49
- [Netmera setFrameworkVersion:@"1.4.6"];
49
+ [Netmera setFrameworkVersion:@"1.4.7"];
50
50
  }
51
51
 
52
52
  + (void)setPushDelegate:(NSObject<NetmeraPushDelegate> *)delegate {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-netmera",
3
- "version": "1.4.6-nohms",
3
+ "version": "1.4.7-nohms",
4
4
  "description": "Netmera React Native SDK",
5
5
  "main": "index.js",
6
6
  "author": "netmera",