react-native-netmera 2.0.0-beta02 → 2.0.0-beta03
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 +2 -2
- package/RNNetmera.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/netmera/reactnativesdk/RNNetmeraPushActionCallbacks.kt +13 -17
- package/android/src/main/java/com/netmera/reactnativesdk/RNNetmeraUtil.kt +39 -8
- package/ios/RNNetmera.swift +3 -5
- package/ios/RNNetmeraPushLifecycleDelegate.swift +14 -18
- package/ios/RNNetmeraPushObject.swift +77 -88
- package/lib/module/Netmera.js +33 -15
- package/lib/module/Netmera.js.map +1 -1
- package/lib/module/index.js +4 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/NetmeraCarouselObject.js +18 -0
- package/lib/module/models/NetmeraCarouselObject.js.map +1 -0
- package/lib/module/models/NetmeraInteractiveAction.js +3 -3
- package/lib/module/models/NetmeraInteractiveAction.js.map +1 -1
- package/lib/module/models/NetmeraPushAction.js +27 -0
- package/lib/module/models/NetmeraPushAction.js.map +1 -0
- package/lib/module/models/NetmeraPushObject.js +58 -0
- package/lib/module/models/NetmeraPushObject.js.map +1 -0
- package/lib/typescript/src/Netmera.d.ts +8 -4
- package/lib/typescript/src/Netmera.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +4 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/models/NetmeraCarouselObject.d.ts +8 -0
- package/lib/typescript/src/models/NetmeraCarouselObject.d.ts.map +1 -0
- package/lib/typescript/src/models/NetmeraCategory.d.ts +2 -2
- package/lib/typescript/src/models/NetmeraCategory.d.ts.map +1 -1
- package/lib/typescript/src/models/NetmeraInteractiveAction.d.ts +2 -2
- package/lib/typescript/src/models/NetmeraInteractiveAction.d.ts.map +1 -1
- package/lib/typescript/src/models/NetmeraPushAction.d.ts +17 -0
- package/lib/typescript/src/models/NetmeraPushAction.d.ts.map +1 -0
- package/lib/typescript/src/models/NetmeraPushObject.d.ts +40 -0
- package/lib/typescript/src/models/NetmeraPushObject.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/Netmera.ts +53 -35
- package/src/index.ts +8 -2
- package/src/models/NetmeraCarouselObject.ts +23 -0
- package/src/models/NetmeraCategory.ts +2 -2
- package/src/models/NetmeraInteractiveAction.ts +5 -5
- package/src/models/NetmeraPushAction.ts +28 -0
- package/src/models/NetmeraPushObject.ts +90 -0
- package/lib/module/models/NetmeraInbox.js +0 -37
- package/lib/module/models/NetmeraInbox.js.map +0 -1
- package/lib/typescript/src/models/NetmeraInbox.d.ts +0 -24
- package/lib/typescript/src/models/NetmeraInbox.d.ts.map +0 -1
- package/src/models/NetmeraInbox.ts +0 -60
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
* Copyright (c) 2026 Netmera Research.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import NetmeraPushAction from './NetmeraPushAction';
|
|
6
|
+
|
|
5
7
|
export default class NetmeraInteractiveAction {
|
|
6
8
|
id?: string;
|
|
7
|
-
actionIconName?: string;
|
|
8
9
|
actionTitle?: string;
|
|
9
|
-
action?:
|
|
10
|
+
action?: NetmeraPushAction;
|
|
10
11
|
customJson?: Record<string, any>;
|
|
11
12
|
|
|
12
13
|
static fromJson(json: Record<string, any>): NetmeraInteractiveAction {
|
|
13
14
|
const item = new NetmeraInteractiveAction();
|
|
14
15
|
item.id = json['id'];
|
|
15
|
-
item.
|
|
16
|
-
item.
|
|
17
|
-
item.action = json['act'];
|
|
16
|
+
item.actionTitle = json['title'];
|
|
17
|
+
item.action = json['act'] ? NetmeraPushAction.fromJson(json['act']) : undefined;
|
|
18
18
|
item.customJson = json['prms'];
|
|
19
19
|
return item;
|
|
20
20
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026 Netmera Research.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export enum NetmeraPushActionType {
|
|
6
|
+
openApp = 0,
|
|
7
|
+
openDeeplink = 1,
|
|
8
|
+
showWebView = 2,
|
|
9
|
+
nothing = 3,
|
|
10
|
+
sendEvent = 4,
|
|
11
|
+
share = 5,
|
|
12
|
+
review = 6,
|
|
13
|
+
showWidget = 7,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default class NetmeraPushAction {
|
|
17
|
+
actionType?: NetmeraPushActionType;
|
|
18
|
+
url?: string;
|
|
19
|
+
close?: boolean;
|
|
20
|
+
|
|
21
|
+
static fromJson(json: Record<string, any>): NetmeraPushAction {
|
|
22
|
+
const obj = new NetmeraPushAction();
|
|
23
|
+
obj.actionType = json['at'];
|
|
24
|
+
obj.url = json['url'];
|
|
25
|
+
obj.close = json['close'];
|
|
26
|
+
return obj;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026 Netmera Research.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import NetmeraPushAction from './NetmeraPushAction';
|
|
6
|
+
import NetmeraInteractiveAction from './NetmeraInteractiveAction';
|
|
7
|
+
import NetmeraCarouselObject from './NetmeraCarouselObject';
|
|
8
|
+
|
|
9
|
+
export enum NetmeraPushType {
|
|
10
|
+
undefined = 0,
|
|
11
|
+
standard = 1,
|
|
12
|
+
interactive = 2,
|
|
13
|
+
popup = 3,
|
|
14
|
+
silent = 6,
|
|
15
|
+
ping = 7,
|
|
16
|
+
configUpdate = 8,
|
|
17
|
+
inAppMessage = 10,
|
|
18
|
+
recall = 11,
|
|
19
|
+
review = 12,
|
|
20
|
+
forceUpdate = 13,
|
|
21
|
+
widget = 14,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default class NetmeraPushObject {
|
|
25
|
+
pushId?: string;
|
|
26
|
+
pushInstanceId?: string;
|
|
27
|
+
pushType?: NetmeraPushType;
|
|
28
|
+
category?: string;
|
|
29
|
+
categories?: number[];
|
|
30
|
+
customJson?: Record<string, any>;
|
|
31
|
+
pushAction?: NetmeraPushAction;
|
|
32
|
+
interactiveActions?: NetmeraInteractiveAction[];
|
|
33
|
+
carousel?: NetmeraCarouselObject[];
|
|
34
|
+
title?: string;
|
|
35
|
+
subtitle?: string;
|
|
36
|
+
body?: string;
|
|
37
|
+
mediaAttachmentURL?: string;
|
|
38
|
+
externalId?: string;
|
|
39
|
+
sendDate?: string;
|
|
40
|
+
expireTime?: string;
|
|
41
|
+
deepLink?: string;
|
|
42
|
+
webPage?: string;
|
|
43
|
+
inboxStatus?: number;
|
|
44
|
+
|
|
45
|
+
static fromJson(json: Record<string, any>): NetmeraPushObject {
|
|
46
|
+
const obj = new NetmeraPushObject();
|
|
47
|
+
obj.pushId = json['pushId'];
|
|
48
|
+
obj.pushInstanceId = json['pushInstanceId'];
|
|
49
|
+
obj.pushType = json['pushType'];
|
|
50
|
+
obj.category = json['category'];
|
|
51
|
+
obj.categories = json['categories'];
|
|
52
|
+
obj.customJson = json['customJson'];
|
|
53
|
+
obj.title = json['title'];
|
|
54
|
+
obj.subtitle = json['subtitle'];
|
|
55
|
+
obj.body = json['body'];
|
|
56
|
+
obj.mediaAttachmentURL = json['mediaAttachmentURL'];
|
|
57
|
+
obj.externalId = json['externalId'];
|
|
58
|
+
obj.sendDate = json['sendDate'];
|
|
59
|
+
obj.expireTime = json['expireTime'];
|
|
60
|
+
obj.deepLink = json['deepLink'];
|
|
61
|
+
obj.webPage = json['webPage'];
|
|
62
|
+
obj.inboxStatus = json['inboxStatus'];
|
|
63
|
+
|
|
64
|
+
if (json['pushAction']) {
|
|
65
|
+
obj.pushAction = NetmeraPushAction.fromJson(json['pushAction']);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (json['interactiveActions'] != null) {
|
|
69
|
+
const raw =
|
|
70
|
+
typeof json['interactiveActions'] === 'string'
|
|
71
|
+
? JSON.parse(json['interactiveActions'])
|
|
72
|
+
: json['interactiveActions'];
|
|
73
|
+
obj.interactiveActions = Array.isArray(raw)
|
|
74
|
+
? raw.map(NetmeraInteractiveAction.fromJson)
|
|
75
|
+
: [];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (json['carousel'] != null) {
|
|
79
|
+
const raw =
|
|
80
|
+
typeof json['carousel'] === 'string'
|
|
81
|
+
? JSON.parse(json['carousel'])
|
|
82
|
+
: json['carousel'];
|
|
83
|
+
obj.carousel = Array.isArray(raw)
|
|
84
|
+
? raw.map(NetmeraCarouselObject.fromJson)
|
|
85
|
+
: [];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return obj;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
* Copyright (c) 2026 Netmera Research.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import NetmeraInteractiveAction from "./NetmeraInteractiveAction.js";
|
|
8
|
-
export default class NetmeraPushInbox {
|
|
9
|
-
static fromJson(json) {
|
|
10
|
-
const inbox = new NetmeraPushInbox();
|
|
11
|
-
inbox.title = json['title'];
|
|
12
|
-
inbox.subtitle = json['subtitle'];
|
|
13
|
-
inbox.body = json['body'];
|
|
14
|
-
inbox.pushType = json['pushType'];
|
|
15
|
-
inbox.pushId = json['pushId'];
|
|
16
|
-
inbox.pushInstanceId = json['pushInstanceId'];
|
|
17
|
-
inbox.sendDate = json['sendDate'];
|
|
18
|
-
inbox.inboxStatus = json['inboxStatus'];
|
|
19
|
-
inbox.deepLink = json['action_deeplink_url'];
|
|
20
|
-
inbox.webPage = json['action_webpage_url'];
|
|
21
|
-
inbox.externalId = json['externalId'];
|
|
22
|
-
inbox.customJson = json['customJson'];
|
|
23
|
-
inbox.pushAction = json['pushAction'];
|
|
24
|
-
inbox.carousel = json['carousel'];
|
|
25
|
-
inbox.mediaAttachmentURL = json['mediaAttachmentURL'];
|
|
26
|
-
inbox.category = json['category'];
|
|
27
|
-
inbox.categories = json['categories'];
|
|
28
|
-
inbox.expireTime = json['expireTime'];
|
|
29
|
-
const rawActions = json['interactiveActions'];
|
|
30
|
-
if (rawActions != null) {
|
|
31
|
-
const actionsArray = typeof rawActions === 'string' ? JSON.parse(rawActions) : rawActions;
|
|
32
|
-
inbox.interactiveActions = actionsArray.map(NetmeraInteractiveAction.fromJson);
|
|
33
|
-
}
|
|
34
|
-
return inbox;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=NetmeraInbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["NetmeraInteractiveAction","NetmeraPushInbox","fromJson","json","inbox","title","subtitle","body","pushType","pushId","pushInstanceId","sendDate","inboxStatus","deepLink","webPage","externalId","customJson","pushAction","carousel","mediaAttachmentURL","category","categories","expireTime","rawActions","actionsArray","JSON","parse","interactiveActions","map"],"sourceRoot":"../../../src","sources":["models/NetmeraInbox.ts"],"mappings":";;AAAA;AACA;AACA;;AAEA,OAAOA,wBAAwB,MAAM,+BAA4B;AAEjE,eAAe,MAAMC,gBAAgB,CAAC;EAqBpC,OAAOC,QAAQA,CAACC,IAAyB,EAAoB;IAC3D,MAAMC,KAAK,GAAG,IAAIH,gBAAgB,CAAC,CAAC;IACpCG,KAAK,CAACC,KAAK,GAAGF,IAAI,CAAC,OAAO,CAAC;IAC3BC,KAAK,CAACE,QAAQ,GAAGH,IAAI,CAAC,UAAU,CAAC;IACjCC,KAAK,CAACG,IAAI,GAAGJ,IAAI,CAAC,MAAM,CAAC;IACzBC,KAAK,CAACI,QAAQ,GAAGL,IAAI,CAAC,UAAU,CAAC;IACjCC,KAAK,CAACK,MAAM,GAAGN,IAAI,CAAC,QAAQ,CAAC;IAC7BC,KAAK,CAACM,cAAc,GAAGP,IAAI,CAAC,gBAAgB,CAAC;IAC7CC,KAAK,CAACO,QAAQ,GAAGR,IAAI,CAAC,UAAU,CAAC;IACjCC,KAAK,CAACQ,WAAW,GAAGT,IAAI,CAAC,aAAa,CAAC;IACvCC,KAAK,CAACS,QAAQ,GAAGV,IAAI,CAAC,qBAAqB,CAAC;IAC5CC,KAAK,CAACU,OAAO,GAAGX,IAAI,CAAC,oBAAoB,CAAC;IAC1CC,KAAK,CAACW,UAAU,GAAGZ,IAAI,CAAC,YAAY,CAAC;IACrCC,KAAK,CAACY,UAAU,GAAGb,IAAI,CAAC,YAAY,CAAC;IACrCC,KAAK,CAACa,UAAU,GAAGd,IAAI,CAAC,YAAY,CAAC;IACrCC,KAAK,CAACc,QAAQ,GAAGf,IAAI,CAAC,UAAU,CAAC;IACjCC,KAAK,CAACe,kBAAkB,GAAGhB,IAAI,CAAC,oBAAoB,CAAC;IACrDC,KAAK,CAACgB,QAAQ,GAAGjB,IAAI,CAAC,UAAU,CAAC;IACjCC,KAAK,CAACiB,UAAU,GAAGlB,IAAI,CAAC,YAAY,CAAC;IACrCC,KAAK,CAACkB,UAAU,GAAGnB,IAAI,CAAC,YAAY,CAAC;IAErC,MAAMoB,UAAU,GAAGpB,IAAI,CAAC,oBAAoB,CAAC;IAC7C,IAAIoB,UAAU,IAAI,IAAI,EAAE;MACtB,MAAMC,YAAmC,GACvC,OAAOD,UAAU,KAAK,QAAQ,GAAGE,IAAI,CAACC,KAAK,CAACH,UAAU,CAAC,GAAGA,UAAU;MACtEnB,KAAK,CAACuB,kBAAkB,GAAGH,YAAY,CAACI,GAAG,CACzC5B,wBAAwB,CAACE,QAC3B,CAAC;IACH;IAEA,OAAOE,KAAK;EACd;AACF","ignoreList":[]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import NetmeraInteractiveAction from './NetmeraInteractiveAction';
|
|
2
|
-
export default class NetmeraPushInbox {
|
|
3
|
-
title?: string;
|
|
4
|
-
subtitle?: string;
|
|
5
|
-
body?: string;
|
|
6
|
-
pushType?: number;
|
|
7
|
-
pushId?: string;
|
|
8
|
-
pushInstanceId?: string;
|
|
9
|
-
sendDate?: string;
|
|
10
|
-
inboxStatus?: number;
|
|
11
|
-
deepLink?: string;
|
|
12
|
-
webPage?: string;
|
|
13
|
-
externalId?: string;
|
|
14
|
-
customJson?: Record<string, any>;
|
|
15
|
-
pushAction?: Record<string, any>;
|
|
16
|
-
carousel?: any[];
|
|
17
|
-
mediaAttachmentURL?: string;
|
|
18
|
-
category?: string;
|
|
19
|
-
categories?: any[];
|
|
20
|
-
interactiveActions?: NetmeraInteractiveAction[];
|
|
21
|
-
expireTime?: string;
|
|
22
|
-
static fromJson(json: Record<string, any>): NetmeraPushInbox;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=NetmeraInbox.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NetmeraInbox.d.ts","sourceRoot":"","sources":["../../../../src/models/NetmeraInbox.ts"],"names":[],"mappings":"AAIA,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAElE,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC;IACnB,kBAAkB,CAAC,EAAE,wBAAwB,EAAE,CAAC;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,gBAAgB;CAgC7D"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026 Netmera Research.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import NetmeraInteractiveAction from './NetmeraInteractiveAction';
|
|
6
|
-
|
|
7
|
-
export default class NetmeraPushInbox {
|
|
8
|
-
title?: string;
|
|
9
|
-
subtitle?: string;
|
|
10
|
-
body?: string;
|
|
11
|
-
pushType?: number;
|
|
12
|
-
pushId?: string;
|
|
13
|
-
pushInstanceId?: string;
|
|
14
|
-
sendDate?: string;
|
|
15
|
-
inboxStatus?: number;
|
|
16
|
-
deepLink?: string;
|
|
17
|
-
webPage?: string;
|
|
18
|
-
externalId?: string;
|
|
19
|
-
customJson?: Record<string, any>;
|
|
20
|
-
pushAction?: Record<string, any>;
|
|
21
|
-
carousel?: any[];
|
|
22
|
-
mediaAttachmentURL?: string;
|
|
23
|
-
category?: string;
|
|
24
|
-
categories?: any[];
|
|
25
|
-
interactiveActions?: NetmeraInteractiveAction[];
|
|
26
|
-
expireTime?: string;
|
|
27
|
-
|
|
28
|
-
static fromJson(json: Record<string, any>): NetmeraPushInbox {
|
|
29
|
-
const inbox = new NetmeraPushInbox();
|
|
30
|
-
inbox.title = json['title'];
|
|
31
|
-
inbox.subtitle = json['subtitle'];
|
|
32
|
-
inbox.body = json['body'];
|
|
33
|
-
inbox.pushType = json['pushType'];
|
|
34
|
-
inbox.pushId = json['pushId'];
|
|
35
|
-
inbox.pushInstanceId = json['pushInstanceId'];
|
|
36
|
-
inbox.sendDate = json['sendDate'];
|
|
37
|
-
inbox.inboxStatus = json['inboxStatus'];
|
|
38
|
-
inbox.deepLink = json['action_deeplink_url'];
|
|
39
|
-
inbox.webPage = json['action_webpage_url'];
|
|
40
|
-
inbox.externalId = json['externalId'];
|
|
41
|
-
inbox.customJson = json['customJson'];
|
|
42
|
-
inbox.pushAction = json['pushAction'];
|
|
43
|
-
inbox.carousel = json['carousel'];
|
|
44
|
-
inbox.mediaAttachmentURL = json['mediaAttachmentURL'];
|
|
45
|
-
inbox.category = json['category'];
|
|
46
|
-
inbox.categories = json['categories'];
|
|
47
|
-
inbox.expireTime = json['expireTime'];
|
|
48
|
-
|
|
49
|
-
const rawActions = json['interactiveActions'];
|
|
50
|
-
if (rawActions != null) {
|
|
51
|
-
const actionsArray: Record<string, any>[] =
|
|
52
|
-
typeof rawActions === 'string' ? JSON.parse(rawActions) : rawActions;
|
|
53
|
-
inbox.interactiveActions = actionsArray.map(
|
|
54
|
-
NetmeraInteractiveAction.fromJson
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return inbox;
|
|
59
|
-
}
|
|
60
|
-
}
|