react-native-netmera 1.3.8 → 1.4.1
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 +276 -185
- package/RNNetmera.podspec +8 -6
- package/android/build/.transforms/{00a1a2a97b81c133eb73f4c946b323aa.bin → 5e6250db45de369f8592b678730f6ff3/results.bin} +0 -0
- package/android/build/.transforms/5e6250db45de369f8592b678730f6ff3/transformed/classes/classes.dex +0 -0
- package/android/build/.transforms/{8b103fc7545c9799a16ff009dc2ead52.bin → f62dff1c96346bd5377ea8eccb1b7016/results.bin} +0 -0
- package/android/build/.transforms/f62dff1c96346bd5377ea8eccb1b7016/transformed/classes/classes.dex +0 -0
- package/android/build/generated/source/buildConfig/debug/com/netmera/reactnativesdk/BuildConfig.java +0 -2
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +16 -0
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +2 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/{compile_only_not_namespaced_r_class_jar → compile_r_class_jar}/debug/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/R.txt +1 -4
- package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +1 -1
- package/android/build/intermediates/javac/debug/classes/com/netmera/reactnativesdk/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/netmera/reactnativesdk/RNNetmera.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/netmera/reactnativesdk/RNNetmeraCategoryObject.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/netmera/reactnativesdk/RNNetmeraConfiguration.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/netmera/reactnativesdk/RNNetmeraModule$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/netmera/reactnativesdk/RNNetmeraModule$10.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/netmera/reactnativesdk/RNNetmeraModule$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/netmera/reactnativesdk/RNNetmeraModule$3.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/netmera/reactnativesdk/RNNetmeraModule$4.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/netmera/reactnativesdk/RNNetmeraModule$5.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/netmera/reactnativesdk/RNNetmeraModule$6.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/netmera/reactnativesdk/RNNetmeraModule$7.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/netmera/reactnativesdk/RNNetmeraModule$8.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/netmera/reactnativesdk/RNNetmeraModule$9.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/netmera/reactnativesdk/RNNetmeraModule.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/netmera/reactnativesdk/RNNetmeraPushBroadcastReceiver.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/netmera/reactnativesdk/RNNetmeraPushHeadlessService.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/netmera/reactnativesdk/RNNetmeraUtil$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/netmera/reactnativesdk/RNNetmeraUtil.class +0 -0
- package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +16 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +1 -4
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build.gradle +3 -3
- package/android/src/main/java/com/netmera/reactnativesdk/RNNetmera.java +2 -6
- package/android/src/main/java/com/netmera/reactnativesdk/RNNetmeraModule.java +116 -5
- package/android/src/main/java/com/netmera/reactnativesdk/RNNetmeraPushBroadcastReceiver.java +9 -7
- package/android/src/main/java/com/netmera/reactnativesdk/RNNetmeraUtil.java +52 -4
- package/index.js +19 -320
- package/ios/RNNetmera.h +2 -2
- package/ios/RNNetmera.m +64 -2
- package/ios/RNNetmeraUtils.h +4 -0
- package/ios/RNNetmeraUtils.m +38 -0
- package/package.json +1 -1
- package/src/Netmera.js +223 -0
- package/src/NetmeraInbox.js +95 -0
- package/src/NetmeraUser.js +92 -0
- package/android/build/.transforms/00a1a2a97b81c133eb73f4c946b323aa/classes/classes.dex +0 -0
- package/android/build/.transforms/8b103fc7545c9799a16ff009dc2ead52/classes/classes.dex +0 -0
- package/android/build/.transforms/9e086edd0cadc1c3e325107cef1d09ca/classes/classes.dex +0 -0
- package/android/build/.transforms/9e086edd0cadc1c3e325107cef1d09ca.bin +0 -1
- package/android/build/.transforms/b0d220ccd1945e73ed321c4b96bb37de/classes/classes.dex +0 -0
- package/android/build/.transforms/b0d220ccd1945e73ed321c4b96bb37de.bin +0 -1
- package/android/build/.transforms/f70db9a523a6c7b9af14929671f6c09b/classes/classes.dex +0 -0
- package/android/build/.transforms/f70db9a523a6c7b9af14929671f6c09b.bin +0 -1
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output.json +0 -27
- package/android/build/intermediates/incremental/debug-mergeNativeLibs/merge-state +0 -0
- package/android/build/intermediates/merged_manifests/debug/output.json +0 -27
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ NETMERA is a Mobile Application Engagement Platform. We offer a series of develo
|
|
|
32
32
|
```
|
|
33
33
|
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
|
|
34
34
|
```
|
|
35
|
-
|
|
35
|
+
implementation project(':react-native-netmera')
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
For both native sides(Android & iOS) you don't have to include extra Netmera SDK libraries.
|
|
@@ -50,11 +50,11 @@ buildscript {
|
|
|
50
50
|
repositories {
|
|
51
51
|
google()
|
|
52
52
|
jcenter()
|
|
53
|
-
maven {url '
|
|
53
|
+
maven {url 'https://developer.huawei.com/repo/'}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
dependencies {
|
|
57
|
-
classpath 'com.android.tools.build:gradle:4.
|
|
57
|
+
classpath 'com.android.tools.build:gradle:4.1.3'
|
|
58
58
|
classpath 'com.google.gms:google-services:4.3.10'
|
|
59
59
|
classpath 'com.huawei.agconnect:agcp:1.6.3.300'
|
|
60
60
|
}
|
|
@@ -65,7 +65,8 @@ allprojects {
|
|
|
65
65
|
google()
|
|
66
66
|
jcenter()
|
|
67
67
|
maven { url 'https://maven.google.com'}
|
|
68
|
-
maven {url '
|
|
68
|
+
maven { url 'https://developer.huawei.com/repo/'}
|
|
69
|
+
maven { url "https://release.netmera.com/release/android" }
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
```
|
|
@@ -99,6 +100,7 @@ apply plugin: 'com.google.gms.google-services'
|
|
|
99
100
|
super.onCreate();
|
|
100
101
|
RNNetmeraConfiguration netmeraConfiguration = new RNNetmeraConfiguration.Builder()
|
|
101
102
|
.firebaseSenderId(<YOUR GCM SENDER ID>)
|
|
103
|
+
.huaweiSenderId(<YOUR HMS SENDER ID>)
|
|
102
104
|
.apiKey(<YOUR NETMERA API KEY>) // This is for enabling Netmera logs.
|
|
103
105
|
.logging(true)
|
|
104
106
|
.build(this);
|
|
@@ -129,28 +131,69 @@ export const onPushDismiss = async (message) => {
|
|
|
129
131
|
export const onPushButtonClicked = async (message) => {
|
|
130
132
|
console.log("onPushButtonClicked: ", message);
|
|
131
133
|
};
|
|
134
|
+
|
|
135
|
+
export const onCarouselObjectSelected = async (message) => {
|
|
136
|
+
console.log("onCarouselObjectSelected: ", message);
|
|
137
|
+
};
|
|
132
138
|
```
|
|
133
139
|
|
|
134
140
|
8) Init `NetmeraBroadcastReceiver` inside your `index.js` file.
|
|
135
141
|
|
|
136
142
|
```
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
143
|
+
import {
|
|
144
|
+
onCarouselObjectSelected,
|
|
145
|
+
onPushButtonClicked,
|
|
146
|
+
onPushDismiss,
|
|
147
|
+
onPushOpen,
|
|
148
|
+
onPushReceive,
|
|
149
|
+
onPushRegister
|
|
150
|
+
} from "./NetmeraPushHeadlessTask";
|
|
151
|
+
|
|
152
|
+
Netmera.initBroadcastReceiver(
|
|
153
|
+
onPushRegister,
|
|
154
|
+
onPushReceive,
|
|
155
|
+
onPushOpen,
|
|
156
|
+
onPushDismiss,
|
|
157
|
+
onPushButtonClicked,
|
|
158
|
+
onCarouselObjectSelected
|
|
159
|
+
)
|
|
151
160
|
|
|
152
|
-
|
|
153
|
-
|
|
161
|
+
// This should be called after Netmera.initBroadcastReceiver method.
|
|
162
|
+
AppRegistry.registerComponent(appName, () => App);
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
9) If you have custom Firebase Messaging integration, please see usage below.
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
messaging()
|
|
169
|
+
.getToken(firebase.app().options.messagingSenderId)
|
|
170
|
+
.then(pushToken => {
|
|
171
|
+
Netmera.onNetmeraNewToken(pushToken)
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
messaging().onMessage(async remoteMessage => {
|
|
175
|
+
if (Netmera.isNetmeraRemoteMessage(remoteMessage.data)) {
|
|
176
|
+
Netmera.onNetmeraFirebasePushMessageReceived(remoteMessage.from, remoteMessage.data)
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
10) If you have custom Huawei Messaging integration, please see usage below.
|
|
182
|
+
|
|
183
|
+
```
|
|
184
|
+
HmsPushInstanceId.getToken("")
|
|
185
|
+
.then((result) => {
|
|
186
|
+
Netmera.onNetmeraNewToken(result.result)
|
|
187
|
+
})
|
|
188
|
+
|
|
189
|
+
HmsPushEvent.onRemoteMessageReceived(event => {
|
|
190
|
+
const remoteMessage = new RNRemoteMessage(event.msg);
|
|
191
|
+
let data = JSON.parse(remoteMessage.getData())
|
|
192
|
+
console.log("onRemoteMessageReceived", data)
|
|
193
|
+
if (Netmera.isNetmeraRemoteMessage(data)) {
|
|
194
|
+
Netmera.onNetmeraHuaweiPushMessageReceived(remoteMessage.getFrom(), data)
|
|
195
|
+
}
|
|
196
|
+
})
|
|
154
197
|
```
|
|
155
198
|
|
|
156
199
|
### Setup - iOS Part
|
|
@@ -169,12 +212,14 @@ $ pod install
|
|
|
169
212
|
#import <React/RCTBridge.h>
|
|
170
213
|
#import <React/RCTBundleURLProvider.h>
|
|
171
214
|
#import <React/RCTRootView.h>
|
|
215
|
+
#import <React/RCTLinkingManager.h>
|
|
172
216
|
#import <RNNetmera/RNNetmeraRCTEventEmitter.h>
|
|
173
217
|
#import <RNNetmera/RNNetmeraUtils.h>
|
|
174
218
|
#import <RNNetmera/RNNetmera.h>
|
|
175
219
|
|
|
176
220
|
@implementation AppDelegate
|
|
177
221
|
|
|
222
|
+
|
|
178
223
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
|
179
224
|
{
|
|
180
225
|
|
|
@@ -194,12 +239,21 @@ $ pod install
|
|
|
194
239
|
[self.window makeKeyAndVisible];
|
|
195
240
|
|
|
196
241
|
[RNNetmera logging: YES];
|
|
197
|
-
[RNNetmera initNetmera
|
|
242
|
+
[RNNetmera initNetmera:<apiKey>];
|
|
198
243
|
[RNNetmera requestPushNotificationAuthorization];
|
|
199
244
|
[RNNetmera setPushDelegate:self];
|
|
200
245
|
return YES;
|
|
201
246
|
}
|
|
202
247
|
|
|
248
|
+
- (BOOL)application:(UIApplication *)application
|
|
249
|
+
openURL:(NSURL *)url
|
|
250
|
+
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
|
|
251
|
+
{
|
|
252
|
+
|
|
253
|
+
NSURL *deeplinkUrl=Netmera.recentPushObject.action.deeplinkURL;
|
|
254
|
+
return [RCTLinkingManager application:application openURL:deeplinkUrl options:options];
|
|
255
|
+
}
|
|
256
|
+
|
|
203
257
|
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
|
204
258
|
{
|
|
205
259
|
#if DEBUG
|
|
@@ -246,8 +300,6 @@ export const onPushReceive = async (message) => {
|
|
|
246
300
|
console.log("onPushReceive: ", message);
|
|
247
301
|
};
|
|
248
302
|
```
|
|
249
|
-
Please take a look at `Setup-Android part 7`
|
|
250
|
-
|
|
251
303
|
|
|
252
304
|
### Calling React Native methods
|
|
253
305
|
|
|
@@ -314,175 +366,214 @@ updateUser() {
|
|
|
314
366
|
##### Netmera Inbox Examples
|
|
315
367
|
|
|
316
368
|
```
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
fetchInbox = async () => {
|
|
327
|
-
try {
|
|
328
|
-
const netmeraInboxFilter = new NetmeraInboxFilter();
|
|
329
|
-
netmeraInboxFilter.status = this.state.inboxState;
|
|
330
|
-
netmeraInboxFilter.pageSize = 2;
|
|
331
|
-
const inbox = await Netmera.fetchInbox(netmeraInboxFilter);
|
|
332
|
-
console.log("inbox", inbox);
|
|
333
|
-
this.setState({inbox: inbox});
|
|
334
|
-
} catch (e) {
|
|
335
|
-
console.log("error", e)
|
|
336
|
-
}
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
fetchNextPage = async () => {
|
|
340
|
-
try {
|
|
341
|
-
const inbox = await Netmera.fetchNextPage();
|
|
342
|
-
this.setState({inbox: inbox});
|
|
343
|
-
console.log("inbox", inbox)
|
|
344
|
-
} catch (e) {
|
|
345
|
-
console.log("error", e)
|
|
346
|
-
}
|
|
347
|
-
};
|
|
348
|
-
|
|
349
|
-
updateAll = async () => {
|
|
350
|
-
if (!this.state.inbox !== undefined) {
|
|
351
|
-
let updateStatus = this.state.inboxState;
|
|
352
|
-
if (updateStatus === Netmera.PUSH_OBJECT_STATUS_ALL) {
|
|
353
|
-
Alert.alert("Error", "Please select different status than all!!")
|
|
354
|
-
console.log("Please select different status than all!!");
|
|
355
|
-
return;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
try {
|
|
359
|
-
Netmera.updateAll(this.state.inboxState).then(() => {
|
|
360
|
-
this.fetchInbox();
|
|
361
|
-
}).catch((error) => {
|
|
362
|
-
console.log("error: " + error)
|
|
363
|
-
})
|
|
364
|
-
} catch (error) {
|
|
365
|
-
console.log("error: " + error)
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
};
|
|
369
|
-
|
|
370
|
-
handlePushObject = async () => {
|
|
371
|
-
if (this.state.inbox !== undefined && this.state.inbox.length > 0) {
|
|
372
|
-
Netmera.handlePushObject(this.state.inbox[0].pushId)
|
|
373
|
-
}
|
|
374
|
-
};
|
|
375
|
-
|
|
376
|
-
handleInteractiveAction = async () => {
|
|
377
|
-
if (this.state.inbox !== undefined && this.state.inbox.length > 0) {
|
|
378
|
-
for (let i = 0; i < this.state.inbox.length; i++) {
|
|
379
|
-
const element = this.state.inbox[i];
|
|
380
|
-
if (element.interactiveActions !== undefined && element.interactiveActions.length > 0) {
|
|
381
|
-
const action = JSON.parse(element.interactiveActions)[0]
|
|
382
|
-
Netmera.handleInteractiveAction(action.id);
|
|
383
|
-
return;
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
};
|
|
388
|
-
|
|
389
|
-
countForStatus = async () => {
|
|
390
|
-
try {
|
|
391
|
-
const count = await Netmera.countForStatus(this.state.inboxState);
|
|
392
|
-
this.setState({countForStatus: count})
|
|
393
|
-
} catch (error) {
|
|
394
|
-
console.log("error: " + error)
|
|
395
|
-
}
|
|
396
|
-
};
|
|
369
|
+
constructor() {
|
|
370
|
+
super();
|
|
371
|
+
this.state = {
|
|
372
|
+
inbox: [],
|
|
373
|
+
inboxState: Netmera.PUSH_OBJECT_STATUS_ALL,
|
|
374
|
+
countForStatus: 0
|
|
375
|
+
}
|
|
376
|
+
}
|
|
397
377
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
378
|
+
fetchInbox = async () => {
|
|
379
|
+
try {
|
|
380
|
+
const netmeraInboxFilter = new NetmeraInboxFilter();
|
|
381
|
+
netmeraInboxFilter.status = this.state.inboxState;
|
|
382
|
+
netmeraInboxFilter.pageSize = 2;
|
|
383
|
+
const inbox = await Netmera.fetchInbox(netmeraInboxFilter);
|
|
384
|
+
console.log("inbox", inbox);
|
|
385
|
+
this.setState({inbox: inbox});
|
|
386
|
+
} catch (e) {
|
|
387
|
+
console.log("error", e)
|
|
388
|
+
}
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
fetchNextPage = async () => {
|
|
392
|
+
try {
|
|
393
|
+
const inbox = await Netmera.fetchNextPage();
|
|
394
|
+
this.setState({inbox: inbox});
|
|
395
|
+
console.log("inbox", inbox)
|
|
396
|
+
} catch (e) {
|
|
397
|
+
console.log("error", e)
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
updateAll = async () => {
|
|
402
|
+
if (!this.state.inbox !== undefined) {
|
|
403
|
+
let updateStatus = this.state.inboxState;
|
|
404
|
+
if (updateStatus === Netmera.PUSH_OBJECT_STATUS_ALL) {
|
|
405
|
+
Alert.alert("Error", "Please select different status than all!!")
|
|
406
|
+
console.log("Please select different status than all!!");
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
try {
|
|
411
|
+
Netmera.updateAll(this.state.inboxState).then(() => {
|
|
412
|
+
this.fetchInbox();
|
|
413
|
+
}).catch((error) => {
|
|
414
|
+
console.log("error: " + error)
|
|
415
|
+
})
|
|
416
|
+
} catch (error) {
|
|
417
|
+
console.log("error: " + error)
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
handlePushObject = async () => {
|
|
423
|
+
if (this.state.inbox !== undefined && this.state.inbox.length > 0) {
|
|
424
|
+
Netmera.handlePushObject(this.state.inbox[0].pushId)
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
handleInteractiveAction = async () => {
|
|
429
|
+
if (this.state.inbox !== undefined && this.state.inbox.length > 0) {
|
|
430
|
+
for (let i = 0; i < this.state.inbox.length; i++) {
|
|
431
|
+
const element = this.state.inbox[i];
|
|
432
|
+
if (element.interactiveActions !== undefined && element.interactiveActions.length > 0) {
|
|
433
|
+
const action = JSON.parse(element.interactiveActions)[0]
|
|
434
|
+
Netmera.handleInteractiveAction(action.id);
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
countForStatus = async () => {
|
|
442
|
+
try {
|
|
443
|
+
const count = await Netmera.countForStatus(this.state.inboxState);
|
|
444
|
+
this.setState({countForStatus: count})
|
|
445
|
+
} catch (e) {
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
inboxUpdateStatus = async () => {
|
|
450
|
+
if (this.state.inboxState === Netmera.PUSH_OBJECT_STATUS_ALL) {
|
|
451
|
+
Alert.alert("Error", "Please select different status than all!!")
|
|
452
|
+
console.log("Please select different status than all!!");
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
if (this.state.inbox === undefined || this.state.inbox < 2) {
|
|
456
|
+
Alert.alert("Error", "Push objects count is less then 2!")
|
|
457
|
+
console.log("Push objects count is less then 2!");
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
Netmera.inboxUpdateStatus(0, 2, this.state.inboxState).then(() => {
|
|
461
|
+
console.log("2 push object status was changed successfully.")
|
|
462
|
+
}).catch((error) => {
|
|
463
|
+
console.log("error: " + error)
|
|
464
|
+
});
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
updateInboxState = (value) => {
|
|
468
|
+
this.setState({inboxState: value})
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
inboxCountForStatus = async () => {
|
|
472
|
+
try {
|
|
473
|
+
const filter = new NMInboxStatusCountFilter();
|
|
474
|
+
filter.nmInboxStatus = this.state.inboxState;
|
|
475
|
+
filter.includeExpired = true;
|
|
476
|
+
const nmInboxStatusCount = await Netmera.getInboxCountForStatus(filter);
|
|
477
|
+
|
|
478
|
+
let countStatusText = "ALL: " + nmInboxStatusCount[NMInboxStatus.STATUS_ALL] + ", " +
|
|
479
|
+
"READ: " + nmInboxStatusCount[NMInboxStatus.STATUS_READ] + ", " +
|
|
480
|
+
"UNREAD: " + nmInboxStatusCount[NMInboxStatus.STATUS_UNREAD] + ", " +
|
|
481
|
+
"DELETED: " + nmInboxStatusCount[NMInboxStatus.STATUS_DELETED]
|
|
482
|
+
|
|
483
|
+
this.setState({countForStatus: countStatusText})
|
|
484
|
+
console.log("nmInboxStatusCount: ", countStatusText);
|
|
485
|
+
} catch (e) {
|
|
486
|
+
console.log("error", e)
|
|
487
|
+
}
|
|
488
|
+
};
|
|
420
489
|
```
|
|
421
490
|
|
|
422
491
|
##### Netmera Inbox Category Examples
|
|
423
492
|
|
|
424
493
|
```
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
fetchCategory = async () => {
|
|
434
|
-
try {
|
|
435
|
-
const netmeraCategoryFilter = new NetmeraCategoryFilter();
|
|
436
|
-
netmeraCategoryFilter.status = this.state.categoryState;
|
|
437
|
-
netmeraCategoryFilter.pageSize = 1;
|
|
438
|
-
const categories = await Netmera.fetchCategory(netmeraCategoryFilter);
|
|
439
|
-
console.log("categories", categories);
|
|
440
|
-
this.setState({categories: categories});
|
|
441
|
-
} catch (e) {
|
|
442
|
-
console.log("error", e)
|
|
443
|
-
}
|
|
444
|
-
};
|
|
445
|
-
|
|
446
|
-
fetchNextCategoryPage = async () => {
|
|
447
|
-
try {
|
|
448
|
-
const categories = await Netmera.fetchNextCategoryPage();
|
|
449
|
-
this.setState({categories: categories});
|
|
450
|
-
console.log("categories", categories)
|
|
451
|
-
} catch (e) {
|
|
452
|
-
console.log("error", e)
|
|
453
|
-
}
|
|
454
|
-
};
|
|
455
|
-
|
|
456
|
-
handlePushObject = async () => {
|
|
457
|
-
if (this.state.categories !== undefined && this.state.categories.length > 0) {
|
|
458
|
-
Netmera.handleLastMessage(this.state.categories[0].categoryName)
|
|
459
|
-
}
|
|
460
|
-
};
|
|
461
|
-
|
|
462
|
-
updateStatusCategories = async () => {
|
|
463
|
-
if (this.state.categoryState === Netmera.PUSH_OBJECT_STATUS_ALL) {
|
|
464
|
-
Alert.alert("Error", "Please select different status than all!!")
|
|
465
|
-
console.log("Please select different status than all!!");
|
|
466
|
-
return;
|
|
467
|
-
}
|
|
468
|
-
if (this.state.categories === undefined || this.state.categories < 1) {
|
|
469
|
-
Alert.alert("Error", "Category object not found!")
|
|
470
|
-
console.log("Category object not found!");
|
|
471
|
-
return;
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
const count = this.state.categories.length < 3 ? this.state.categories.length : 2;
|
|
475
|
-
|
|
476
|
-
Netmera.updateStatusByCategories(0, count, this.state.categoryState).then(() => {
|
|
477
|
-
console.log("Category object status was changed successfully.")
|
|
478
|
-
}).catch((error) => {
|
|
479
|
-
console.log("error: " + error)
|
|
480
|
-
});
|
|
481
|
-
};
|
|
494
|
+
constructor() {
|
|
495
|
+
super();
|
|
496
|
+
this.state = {
|
|
497
|
+
categories: [],
|
|
498
|
+
userCategoryPreferences: [],
|
|
499
|
+
categoryState: Netmera.PUSH_OBJECT_STATUS_ALL,
|
|
500
|
+
}
|
|
501
|
+
}
|
|
482
502
|
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
503
|
+
fetchCategory = async () => {
|
|
504
|
+
try {
|
|
505
|
+
const netmeraCategoryFilter = new NetmeraCategoryFilter();
|
|
506
|
+
netmeraCategoryFilter.status = this.state.categoryState;
|
|
507
|
+
netmeraCategoryFilter.pageSize = 1;
|
|
508
|
+
const categories = await Netmera.fetchCategory(netmeraCategoryFilter);
|
|
509
|
+
console.log("categories", categories);
|
|
510
|
+
this.setState({categories: categories});
|
|
511
|
+
} catch (e) {
|
|
512
|
+
console.log("error", e)
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
|
|
516
|
+
fetchNextCategoryPage = async () => {
|
|
517
|
+
try {
|
|
518
|
+
const categories = await Netmera.fetchNextCategoryPage();
|
|
519
|
+
this.setState({categories: categories});
|
|
520
|
+
console.log("categories", categories)
|
|
521
|
+
} catch (e) {
|
|
522
|
+
console.log("error", e)
|
|
523
|
+
}
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
handlePushObject = async () => {
|
|
527
|
+
if (this.state.categories !== undefined && this.state.categories.length > 0) {
|
|
528
|
+
Netmera.handleLastMessage(this.state.categories[0].categoryName)
|
|
529
|
+
}
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
updateStatusCategories = async () => {
|
|
533
|
+
if (this.state.categoryState === Netmera.PUSH_OBJECT_STATUS_ALL) {
|
|
534
|
+
Alert.alert("Error", "Please select different status than all!!")
|
|
535
|
+
console.log("Please select different status than all!!");
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
if (this.state.categories === undefined || this.state.categories < 1) {
|
|
539
|
+
Alert.alert("Error", "Category object not found!")
|
|
540
|
+
console.log("Category object not found!");
|
|
541
|
+
return;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
const count = this.state.categories.length < 3 ? this.state.categories.length : 2;
|
|
545
|
+
|
|
546
|
+
Netmera.updateStatusByCategories(0, count, this.state.categoryState).then(() => {
|
|
547
|
+
console.log("Category object status was changed successfully.")
|
|
548
|
+
}).catch((error) => {
|
|
549
|
+
console.log("error: " + error)
|
|
550
|
+
});
|
|
551
|
+
};
|
|
552
|
+
|
|
553
|
+
updateCategoryState = (value) => {
|
|
554
|
+
this.setState({categoryState: value})
|
|
555
|
+
};
|
|
556
|
+
|
|
557
|
+
getUserCategoryPreferenceList = async () => {
|
|
558
|
+
Netmera.getUserCategoryPreferenceList().then((response) => {
|
|
559
|
+
this.setState({categories: response})
|
|
560
|
+
console.log("User Category Preference List: " + response)
|
|
561
|
+
}).catch((error) => {
|
|
562
|
+
console.log("error: " + error)
|
|
563
|
+
});
|
|
564
|
+
};
|
|
565
|
+
|
|
566
|
+
setUserCategoryPreference = async (item) => {
|
|
567
|
+
Netmera.setUserCategoryPreference(item.categoryId, !item.optInStatus).then(() => {
|
|
568
|
+
console.log("Successfully set user category preference list")
|
|
569
|
+
setTimeout(() => {
|
|
570
|
+
this.getUserCategoryPreferenceList()
|
|
571
|
+
}, 500)
|
|
572
|
+
|
|
573
|
+
}).catch((error) => {
|
|
574
|
+
console.log("error: " + error)
|
|
575
|
+
});
|
|
576
|
+
};
|
|
486
577
|
```
|
|
487
578
|
|
|
488
579
|
##### Netmera Getting ExternalId (if exists before)
|
package/RNNetmera.podspec
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
1
4
|
|
|
2
5
|
Pod::Spec.new do |s|
|
|
3
6
|
s.name = "RNNetmera"
|
|
4
|
-
s.version = "
|
|
5
|
-
s.summary = "
|
|
7
|
+
s.version = package["version"]
|
|
8
|
+
s.summary = package["description"]
|
|
6
9
|
s.description = <<-DESC
|
|
7
10
|
RNNetmera
|
|
8
11
|
DESC
|
|
9
12
|
s.homepage = "https://github.com/author/RNNetmera.git"
|
|
10
13
|
s.license = "MIT"
|
|
11
|
-
# s.license = { :type => "MIT", :file => "FILE_LICENSE" }
|
|
12
14
|
s.author = { "author" => "author@domain.cn" }
|
|
13
|
-
s.
|
|
15
|
+
s.platforms = { :ios => "9.0" }
|
|
14
16
|
s.source = { :git => "https://github.com/author/RNNetmera.git", :tag => "master" }
|
|
15
|
-
s.source_files = "ios
|
|
17
|
+
s.source_files = "ios/**/*.{h,c,cc,cpp,m,mm,swift}"
|
|
16
18
|
s.requires_arc = true
|
|
17
19
|
|
|
18
20
|
s.dependency 'React'
|
|
19
|
-
s.dependency 'Netmera','3.14.
|
|
21
|
+
s.dependency 'Netmera','3.14.10-WithoutDependency'
|
|
20
22
|
end
|
|
21
23
|
|
|
22
24
|
|
|
File without changes
|
package/android/build/.transforms/5e6250db45de369f8592b678730f6ff3/transformed/classes/classes.dex
ADDED
|
Binary file
|
|
File without changes
|
package/android/build/.transforms/f62dff1c96346bd5377ea8eccb1b7016/transformed/classes/classes.dex
ADDED
|
Binary file
|
package/android/build/generated/source/buildConfig/debug/com/netmera/reactnativesdk/BuildConfig.java
CHANGED
|
@@ -7,6 +7,4 @@ public final class BuildConfig {
|
|
|
7
7
|
public static final boolean DEBUG = Boolean.parseBoolean("true");
|
|
8
8
|
public static final String LIBRARY_PACKAGE_NAME = "com.netmera.reactnativesdk";
|
|
9
9
|
public static final String BUILD_TYPE = "debug";
|
|
10
|
-
public static final int VERSION_CODE = 1;
|
|
11
|
-
public static final String VERSION_NAME = "1.0";
|
|
12
10
|
}
|
package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"artifactType": {
|
|
4
|
+
"type": "AAPT_FRIENDLY_MERGED_MANIFESTS",
|
|
5
|
+
"kind": "Directory"
|
|
6
|
+
},
|
|
7
|
+
"applicationId": "com.netmera.reactnativesdk",
|
|
8
|
+
"variantName": "debug",
|
|
9
|
+
"elements": [
|
|
10
|
+
{
|
|
11
|
+
"type": "SINGLE",
|
|
12
|
+
"filters": [],
|
|
13
|
+
"outputFile": "AndroidManifest.xml"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -3413,7 +3413,6 @@ int string abc_searchview_description_voice 0x0
|
|
|
3413
3413
|
int string abc_shareactionprovider_share_with 0x0
|
|
3414
3414
|
int string abc_shareactionprovider_share_with_application 0x0
|
|
3415
3415
|
int string abc_toolbar_collapse_description 0x0
|
|
3416
|
-
int string ag_sdk_cbg_root 0x0
|
|
3417
3416
|
int string aimodule_exclude_domain 0x0
|
|
3418
3417
|
int string alert_description 0x0
|
|
3419
3418
|
int string androidx_startup 0x0
|
|
@@ -3486,11 +3485,10 @@ int string header_description 0x0
|
|
|
3486
3485
|
int string hide_bottom_view_on_scroll_behavior 0x0
|
|
3487
3486
|
int string hms_abort 0x0
|
|
3488
3487
|
int string hms_abort_message 0x0
|
|
3488
|
+
int string hms_apk_not_installed_hints 0x0
|
|
3489
3489
|
int string hms_bindfaildlg_message 0x0
|
|
3490
3490
|
int string hms_bindfaildlg_title 0x0
|
|
3491
3491
|
int string hms_cancel 0x0
|
|
3492
|
-
int string hms_cancel_after_cancel 0x0
|
|
3493
|
-
int string hms_cancel_install_message 0x0
|
|
3494
3492
|
int string hms_check_failure 0x0
|
|
3495
3493
|
int string hms_checking 0x0
|
|
3496
3494
|
int string hms_confirm 0x0
|
|
@@ -3499,7 +3497,6 @@ int string hms_download_no_space 0x0
|
|
|
3499
3497
|
int string hms_download_retry 0x0
|
|
3500
3498
|
int string hms_downloading_loading 0x0
|
|
3501
3499
|
int string hms_install 0x0
|
|
3502
|
-
int string hms_install_after_cancel 0x0
|
|
3503
3500
|
int string hms_install_message 0x0
|
|
3504
3501
|
int string hms_is_spoof 0x0
|
|
3505
3502
|
int string hms_push_channel 0x0
|
package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
#
|
|
1
|
+
#Sun May 01 12:38:49 TRT 2022
|
package/android/build/intermediates/javac/debug/classes/com/netmera/reactnativesdk/BuildConfig.class
CHANGED
|
Binary file
|
package/android/build/intermediates/javac/debug/classes/com/netmera/reactnativesdk/RNNetmera.class
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|