react-native-netmera 1.7.3 → 1.7.4

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/README.md CHANGED
@@ -210,9 +210,9 @@ export const onPushReceive = async (message) => {
210
210
 
211
211
  ```
212
212
  // For receiving Media Push, you must add Netmera pods to top of your Podfile.
213
- pod "Netmera", "3.23.4-WithoutDependency"
214
- pod "Netmera/NotificationServiceExtension", "3.23.4-WithoutDependency"
215
- pod "Netmera/NotificationContentExtension", "3.23.4-WithoutDependency"
213
+ pod "Netmera", "3.23.5-WithoutDependency"
214
+ pod "Netmera/NotificationServiceExtension", "3.23.5-WithoutDependency"
215
+ pod "Netmera/NotificationContentExtension", "3.23.5-WithoutDependency"
216
216
  ```
217
217
 
218
218
  5. In order to use the widget URL callback, add these methods to between `@implementation AppDelegate` and `@end`.
package/RNNetmera.podspec CHANGED
@@ -18,6 +18,6 @@ Pod::Spec.new do |s|
18
18
  s.requires_arc = true
19
19
 
20
20
  s.dependency 'React'
21
- s.dependency 'Netmera','3.23.4-WithoutDependency'
21
+ s.dependency 'Netmera','3.23.5-WithoutDependency'
22
22
  end
23
23
 
@@ -19,7 +19,7 @@ android {
19
19
  }
20
20
 
21
21
  dependencies {
22
- implementation 'com.netmera:nmcore:3.12.0'
22
+ implementation 'com.netmera:nmcore:3.13.1'
23
23
  implementation 'com.netmera:nmfcm:3.12.0'
24
24
  implementation 'com.netmera:nmhms:3.11.0'
25
25
  implementation 'com.facebook.react:react-native:+'
@@ -23,7 +23,7 @@ public class RNNetmera {
23
23
  static void setNetmeraHeaders() {
24
24
  ContentValues headerValues = new ContentValues();
25
25
  headerValues.put("X-netmera-framework", "react");
26
- headerValues.put("X-netmera-frameworkV", "1.7.3");
26
+ headerValues.put("X-netmera-frameworkV", "1.7.4");
27
27
  Netmera.setNetmeraHeaders(headerValues);
28
28
  }
29
29
 
@@ -7,7 +7,9 @@
7
7
 
8
8
  package com.netmera.reactnativesdk;
9
9
 
10
+ import android.app.Activity;
10
11
  import android.os.Bundle;
12
+ import android.util.Log;
11
13
 
12
14
  import androidx.annotation.NonNull;
13
15
  import androidx.annotation.Nullable;
@@ -49,6 +51,7 @@ public class RNNetmeraModule extends ReactContextBaseJavaModule {
49
51
  private static final String CODE = "code";
50
52
  private static final String CATEGORIES = "categories";
51
53
  private static final String PAGE_SIZE = "pageSize";
54
+ private static final String REVENUE = "revenue";
52
55
  private static final String INCLUDE_EXPIRED_OBJECTS = "includeExpiredObjects";
53
56
  private static final String STATUS = "status";
54
57
  private static final String ERROR_CODE_NULL_INBOX = "2017";
@@ -112,7 +115,12 @@ public class RNNetmeraModule extends ReactContextBaseJavaModule {
112
115
 
113
116
  @ReactMethod
114
117
  public void requestPushNotificationAuthorization() {
115
- Netmera.requestNotificationPermissions(reactContext.getCurrentActivity());
118
+ Activity activity = getCurrentActivity();
119
+ if (activity != null) {
120
+ Netmera.requestNotificationPermissions(activity);
121
+ } else {
122
+ Log.e("NETMERA", "Cannot call requestNotificationPermissions because current ReactActivity is null");
123
+ }
116
124
  }
117
125
 
118
126
  @ReactMethod
@@ -155,6 +163,11 @@ public class RNNetmeraModule extends ReactContextBaseJavaModule {
155
163
  Netmera.turnOffSendingEventAndUserUpdate(turnOff);
156
164
  }
157
165
 
166
+ @ReactMethod
167
+ public void kill() {
168
+ Netmera.kill();
169
+ }
170
+
158
171
  @ReactMethod
159
172
  public void fetchCoupons(final int page, final int max, final Promise promise) {
160
173
  Netmera.fetchCoupons(page, max, new NMFetchCouponsResultListener() {
@@ -298,6 +311,11 @@ public class RNNetmeraModule extends ReactContextBaseJavaModule {
298
311
  eventMap.remove(CODE);
299
312
  }
300
313
 
314
+ if (hasKey(eventMap, REVENUE)) {
315
+ event.setRevenue(readableMap.getDouble(REVENUE));
316
+ eventMap.remove(REVENUE);
317
+ }
318
+
301
319
  event.setEventParameters(eventMap);
302
320
  Netmera.sendEvent(event);
303
321
  }
package/ios/RNNetmera.m CHANGED
@@ -55,7 +55,7 @@ NSString *const ERROR_MESSAGE_UPDATE_USER = @"Error occurred while updating user
55
55
 
56
56
  + (void)setNetmeraHeaders {
57
57
  [Netmera setFramework:@"react"];
58
- [Netmera setFrameworkVersion:@"1.7.3"];
58
+ [Netmera setFrameworkVersion:@"1.7.4"];
59
59
  }
60
60
 
61
61
  + (void)setPushDelegate:(NSObject<NetmeraPushDelegate> *)delegate {
@@ -140,6 +140,10 @@ RCT_EXPORT_METHOD(stopDataTransfer) {
140
140
  [Netmera stopDataTransfer];
141
141
  }
142
142
 
143
+ RCT_EXPORT_METHOD(kill) {
144
+ [Netmera kill];
145
+ }
146
+
143
147
  RCT_EXPORT_METHOD(fetchCoupons:(int)page
144
148
  max: (int)max
145
149
  resolver: (RCTPromiseResolveBlock)resolve
@@ -270,6 +274,12 @@ RCT_EXPORT_METHOD(sendEvent:(NSDictionary *)eventDictionary) {
270
274
  RNNetmeraEvent *event = [RNNetmeraEvent event];
271
275
  event.netmeraEventKey = mutableEventDictionary[@"code"];
272
276
  [mutableEventDictionary removeObjectForKey:@"code"];
277
+
278
+ if (mutableEventDictionary[@"revenue"] != nil) {
279
+ event.revenue = [mutableEventDictionary[@"revenue"] doubleValue];
280
+ [mutableEventDictionary removeObjectForKey:@"revenue"];
281
+ }
282
+
273
283
  event.eventParameters = mutableEventDictionary;
274
284
  [Netmera sendEvent:event];
275
285
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-netmera",
3
- "version": "1.7.3",
3
+ "version": "1.7.4",
4
4
  "description": "Netmera React Native SDK",
5
5
  "main": "index.ts",
6
6
  "author": "netmera",
package/src/Netmera.ts CHANGED
@@ -157,6 +157,12 @@ export default class Netmera {
157
157
  }
158
158
  };
159
159
 
160
+ static kill = () => {
161
+ if (isAndroid()) {
162
+ RNNetmera.kill();
163
+ }
164
+ };
165
+
160
166
  static startDataTransfer = () => {
161
167
  RNNetmera.startDataTransfer();
162
168
  };
@@ -4,4 +4,5 @@
4
4
 
5
5
  export default abstract class NetmeraEvent {
6
6
  abstract code: string;
7
+ revenue?: number;
7
8
  }