webtonative 1.0.77 → 1.0.78
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/ATTConsent/index.d.ts +16 -0
- package/ATTConsent/index.js +53 -1
- package/ATTConsent/types.d.ts +14 -0
- package/ATTConsent/types.js +2 -0
- package/AdMob/index.d.ts +30 -0
- package/AdMob/index.js +101 -1
- package/AdMob/types.d.ts +24 -0
- package/AdMob/types.js +3 -0
- package/AppReview/index.d.ts +6 -0
- package/AppReview/index.js +21 -1
- package/AppReview/types.d.ts +7 -0
- package/AppReview/types.js +3 -0
- package/AppsFlyer/index.d.ts +14 -0
- package/AppsFlyer/index.js +42 -4
- package/AppsFlyer/types.d.ts +9 -0
- package/AppsFlyer/types.js +2 -0
- package/BackgroundLocation/index.d.ts +11 -0
- package/BackgroundLocation/index.js +64 -4
- package/BackgroundLocation/types.d.ts +31 -0
- package/BackgroundLocation/types.js +2 -0
- package/Beacon/index.d.ts +6 -0
- package/Beacon/index.js +29 -1
- package/Beacon/types.d.ts +18 -0
- package/Beacon/types.js +2 -0
- package/Biometric/index.d.ts +26 -0
- package/Biometric/index.js +124 -1
- package/Biometric/types.d.ts +23 -0
- package/Biometric/types.js +2 -0
- package/Bluetooth/index.d.ts +16 -0
- package/Bluetooth/index.js +66 -1
- package/Bluetooth/types.d.ts +33 -0
- package/Bluetooth/types.js +2 -0
- package/BottomNavigation/index.d.ts +10 -0
- package/BottomNavigation/index.js +40 -4
- package/BottomNavigation/types.d.ts +8 -0
- package/BottomNavigation/types.js +2 -0
- package/Clipboard/index.d.ts +11 -0
- package/Clipboard/index.js +44 -4
- package/Clipboard/types.d.ts +19 -0
- package/Clipboard/types.js +3 -0
- package/Facebook/events.d.ts +12 -0
- package/Facebook/events.js +43 -4
- package/Facebook/index.d.ts +2 -0
- package/Facebook/index.js +28 -1
- package/Facebook/types.d.ts +21 -0
- package/Facebook/types.js +2 -0
- package/Firebase/Analytics/index.d.ts +31 -0
- package/Firebase/Analytics/index.js +109 -4
- package/Firebase/Messaging/index.d.ts +16 -0
- package/Firebase/Messaging/index.js +63 -4
- package/Firebase/index.d.ts +3 -0
- package/Firebase/index.js +30 -1
- package/Firebase/types.d.ts +57 -0
- package/Firebase/types.js +3 -0
- package/FirebaseAnalytics/index.d.ts +2 -0
- package/FirebaseAnalytics/index.js +28 -1
- package/Haptics/index.d.ts +6 -0
- package/Haptics/index.js +20 -1
- package/Haptics/types.d.ts +7 -0
- package/Haptics/types.js +2 -0
- package/InAppPurchase/index.d.ts +22 -0
- package/InAppPurchase/index.js +80 -1
- package/InAppPurchase/types.d.ts +33 -0
- package/InAppPurchase/types.js +2 -0
- package/InAppUpdate/index.d.ts +11 -0
- package/InAppUpdate/index.js +38 -1
- package/InAppUpdate/types.d.ts +14 -0
- package/InAppUpdate/types.js +2 -0
- package/MediaPlayer/index.d.ts +16 -0
- package/MediaPlayer/index.js +55 -7
- package/MediaPlayer/types.d.ts +13 -0
- package/MediaPlayer/types.js +2 -0
- package/NativeContacts/index.d.ts +11 -0
- package/NativeContacts/index.js +50 -6
- package/NativeContacts/types.d.ts +13 -0
- package/NativeContacts/types.js +2 -0
- package/NativeDatastore/index.d.ts +7 -0
- package/NativeDatastore/index.js +134 -1
- package/NativeDatastore/type.d.ts +23 -0
- package/NativeDatastore/type.js +2 -0
- package/Notification/index.d.ts +10 -0
- package/Notification/index.js +41 -1
- package/Notification/types.d.ts +13 -0
- package/Notification/types.js +2 -0
- package/OneSignal/index.d.ts +17 -0
- package/OneSignal/index.js +264 -1
- package/OneSignal/types.d.ts +40 -0
- package/OneSignal/types.js +3 -0
- package/Printing/index.d.ts +6 -0
- package/Printing/index.js +19 -1
- package/Printing/types.d.ts +8 -0
- package/Printing/types.js +2 -0
- package/README.md +31 -2
- package/Screen/index.d.ts +8 -0
- package/Screen/index.js +34 -4
- package/Screen/types.d.ts +5 -0
- package/Screen/types.js +3 -0
- package/Siri/index.d.ts +6 -0
- package/Siri/index.js +25 -1
- package/Siri/types.d.ts +13 -0
- package/Siri/types.js +2 -0
- package/SocialLogin/apple/index.d.ts +11 -0
- package/SocialLogin/apple/index.js +31 -0
- package/SocialLogin/facebook/index.d.ts +21 -0
- package/SocialLogin/facebook/index.js +60 -0
- package/SocialLogin/google/index.d.ts +21 -0
- package/SocialLogin/google/index.js +60 -0
- package/SocialLogin/index.d.ts +16 -0
- package/SocialLogin/index.js +22 -1
- package/SocialLogin/types.d.ts +38 -0
- package/SocialLogin/types.js +2 -0
- package/Stripe/index.d.ts +2 -0
- package/Stripe/index.js +48 -1
- package/Stripe/types.d.ts +31 -0
- package/Stripe/types.js +2 -0
- package/VoiceSearch/index.d.ts +12 -0
- package/VoiceSearch/index.js +33 -1
- package/VoiceSearch/types.d.ts +9 -0
- package/VoiceSearch/types.js +2 -0
- package/barcode/barcode-scan.d.ts +15 -0
- package/barcode/barcode-scan.js +39 -1
- package/barcode/barcode-types.d.ts +17 -0
- package/barcode/barcode-types.js +2 -0
- package/barcode/formats.d.ts +17 -0
- package/barcode/formats.js +22 -1
- package/barcode/index.d.ts +4 -0
- package/barcode/index.js +12 -1
- package/barcode/types.d.ts +16 -0
- package/barcode/types.js +21 -1
- package/index.d.ts +155 -0
- package/index.js +540 -2
- package/package.json +150 -3
- package/types/index.d.ts +49 -0
- package/types/index.js +3 -0
- package/utills.d.ts +11 -0
- package/utills.js +110 -1
- package/webtonative.min.js +1 -1
- package/SocialLogin/apple.js +0 -1
- package/SocialLogin/facebook.js +0 -9
- package/SocialLogin/google.js +0 -9
package/MediaPlayer/index.js
CHANGED
|
@@ -1,7 +1,55 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stopMedia = exports.pauseMedia = exports.playMedia = void 0;
|
|
4
|
+
var utills_1 = require("../utills");
|
|
5
|
+
/**
|
|
6
|
+
* Plays media content
|
|
7
|
+
* @param options - Options for playing media
|
|
8
|
+
*/
|
|
9
|
+
var playMedia = function (options) {
|
|
10
|
+
if (options === void 0) { options = {}; }
|
|
11
|
+
var url = options.url, _a = options.imageUrl, imageUrl = _a === void 0 ? "https://images.freeimages.com/images/large-previews/3b2/prague-conference-center-1056491.jpg" : _a;
|
|
12
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
13
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.playMedia(JSON.stringify({ url: url, imageUrl: imageUrl }));
|
|
14
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
15
|
+
utills_1.webToNativeIos.postMessage({
|
|
16
|
+
"action": "playMedia",
|
|
17
|
+
url: url,
|
|
18
|
+
image: imageUrl
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
exports.playMedia = playMedia;
|
|
24
|
+
/**
|
|
25
|
+
* Pauses currently playing media
|
|
26
|
+
* @param options - Options for pausing media
|
|
27
|
+
*/
|
|
28
|
+
var pauseMedia = function (options) {
|
|
29
|
+
if (options === void 0) { options = {}; }
|
|
30
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
31
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.pausePlaying();
|
|
32
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
33
|
+
utills_1.webToNativeIos.postMessage({
|
|
34
|
+
"action": "pauseMedia"
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.pauseMedia = pauseMedia;
|
|
40
|
+
/**
|
|
41
|
+
* Stops currently playing media
|
|
42
|
+
* @param options - Options for stopping media
|
|
43
|
+
*/
|
|
44
|
+
var stopMedia = function (options) {
|
|
45
|
+
if (options === void 0) { options = {}; }
|
|
46
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
47
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.stopPlaying();
|
|
48
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
49
|
+
utills_1.webToNativeIos.postMessage({
|
|
50
|
+
"action": "stopMedia"
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
exports.stopMedia = stopMedia;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface MediaPlayerOptions {
|
|
2
|
+
url?: string;
|
|
3
|
+
imageUrl?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface MediaPlayerIosMessage {
|
|
6
|
+
action: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
image?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface MediaPlayerAndroidParams {
|
|
11
|
+
url?: string;
|
|
12
|
+
imageUrl?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ContactsOptions } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Gets the permission status for contacts access
|
|
4
|
+
* @param options - Options for getting permission status
|
|
5
|
+
*/
|
|
6
|
+
export declare const getPermissionStatus: (options?: ContactsOptions) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Gets all contacts from the device
|
|
9
|
+
* @param options - Options for getting all contacts
|
|
10
|
+
*/
|
|
11
|
+
export declare const getAll: (options?: ContactsOptions) => void;
|
package/NativeContacts/index.js
CHANGED
|
@@ -1,6 +1,50 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAll = exports.getPermissionStatus = void 0;
|
|
4
|
+
var utills_1 = require("../utills");
|
|
5
|
+
/**
|
|
6
|
+
* Gets the permission status for contacts access
|
|
7
|
+
* @param options - Options for getting permission status
|
|
8
|
+
*/
|
|
9
|
+
var getPermissionStatus = function (options) {
|
|
10
|
+
if (options === void 0) { options = {}; }
|
|
11
|
+
var callback = options.callback;
|
|
12
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
13
|
+
(0, utills_1.registerCb)(function (response) {
|
|
14
|
+
var type = response.type;
|
|
15
|
+
if (type === "contactPermissionStatus") {
|
|
16
|
+
callback && callback(response);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.getPermissionStatus();
|
|
20
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
21
|
+
utills_1.webToNativeIos.postMessage({
|
|
22
|
+
action: "askUserForContactPermission",
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.getPermissionStatus = getPermissionStatus;
|
|
28
|
+
/**
|
|
29
|
+
* Gets all contacts from the device
|
|
30
|
+
* @param options - Options for getting all contacts
|
|
31
|
+
*/
|
|
32
|
+
var getAll = function (options) {
|
|
33
|
+
if (options === void 0) { options = {}; }
|
|
34
|
+
var callback = options.callback;
|
|
35
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
36
|
+
(0, utills_1.registerCb)(function (response) {
|
|
37
|
+
var type = response.type;
|
|
38
|
+
if (type === "contactDetails") {
|
|
39
|
+
callback && callback(response);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.getAll();
|
|
43
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
44
|
+
utills_1.webToNativeIos.postMessage({
|
|
45
|
+
action: "getUserContactDetails",
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
exports.getAll = getAll;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ContactsResponse {
|
|
2
|
+
type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
export interface ContactsCallback {
|
|
6
|
+
(response: ContactsResponse): void;
|
|
7
|
+
}
|
|
8
|
+
export interface ContactsOptions {
|
|
9
|
+
callback?: ContactsCallback;
|
|
10
|
+
}
|
|
11
|
+
export interface ContactsIosMessage {
|
|
12
|
+
action: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IDeleteAppDataOptions, IGetAppDataOptions, ISetAppDataOptions } from "./type";
|
|
2
|
+
export declare const setAppData: (options?: ISetAppDataOptions) => void;
|
|
3
|
+
export declare const getAppData: (options?: IGetAppDataOptions) => void;
|
|
4
|
+
export declare const deleteAppData: (options?: IDeleteAppDataOptions) => void;
|
|
5
|
+
export declare const setCloudData: (options?: ISetAppDataOptions) => void;
|
|
6
|
+
export declare const getCloudData: (options?: IGetAppDataOptions) => void;
|
|
7
|
+
export declare const deleteCloudData: (options?: IDeleteAppDataOptions) => void;
|
package/NativeDatastore/index.js
CHANGED
|
@@ -1 +1,134 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteCloudData = exports.getCloudData = exports.setCloudData = exports.deleteAppData = exports.getAppData = exports.setAppData = void 0;
|
|
4
|
+
var utills_1 = require("../utills");
|
|
5
|
+
var setAppData = function (options) {
|
|
6
|
+
if (options === void 0) { options = {}; }
|
|
7
|
+
var callback = options.callback, keyName = options.keyName, value = options.value;
|
|
8
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
9
|
+
(0, utills_1.registerCb)(function (response) {
|
|
10
|
+
var type = response.type;
|
|
11
|
+
if (type === "setAppData") {
|
|
12
|
+
callback && callback(response);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
utills_1.platform === "ANDROID_APP" &&
|
|
16
|
+
utills_1.webToNative.setAppData(JSON.stringify({
|
|
17
|
+
keyName: keyName,
|
|
18
|
+
value: value,
|
|
19
|
+
}));
|
|
20
|
+
utills_1.platform === "IOS_APP" &&
|
|
21
|
+
utills_1.webToNativeIos &&
|
|
22
|
+
utills_1.webToNativeIos.postMessage({
|
|
23
|
+
action: "setAppData",
|
|
24
|
+
keyName: keyName,
|
|
25
|
+
value: value,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
exports.setAppData = setAppData;
|
|
30
|
+
var getAppData = function (options) {
|
|
31
|
+
if (options === void 0) { options = {}; }
|
|
32
|
+
var callback = options.callback, keyName = options.keyName;
|
|
33
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
34
|
+
(0, utills_1.registerCb)(function (response) {
|
|
35
|
+
var type = response.type;
|
|
36
|
+
if (type === "getAppData") {
|
|
37
|
+
callback && callback(response);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.getAppData(keyName);
|
|
41
|
+
utills_1.platform === "IOS_APP" &&
|
|
42
|
+
utills_1.webToNativeIos &&
|
|
43
|
+
utills_1.webToNativeIos.postMessage({
|
|
44
|
+
action: "getAppData",
|
|
45
|
+
keyName: keyName,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
exports.getAppData = getAppData;
|
|
50
|
+
var deleteAppData = function (options) {
|
|
51
|
+
if (options === void 0) { options = {}; }
|
|
52
|
+
var callback = options.callback, keyName = options.keyName;
|
|
53
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
54
|
+
(0, utills_1.registerCb)(function (response) {
|
|
55
|
+
var type = response.type;
|
|
56
|
+
if (type === "deleteAppData") {
|
|
57
|
+
callback && callback(response);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.deleteAppData(keyName);
|
|
61
|
+
utills_1.platform === "IOS_APP" &&
|
|
62
|
+
utills_1.webToNativeIos &&
|
|
63
|
+
utills_1.webToNativeIos.postMessage({
|
|
64
|
+
action: "deleteAppData",
|
|
65
|
+
keyName: keyName,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
exports.deleteAppData = deleteAppData;
|
|
70
|
+
var setCloudData = function (options) {
|
|
71
|
+
if (options === void 0) { options = {}; }
|
|
72
|
+
var callback = options.callback, keyName = options.keyName, value = options.value;
|
|
73
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
74
|
+
(0, utills_1.registerCb)(function (response) {
|
|
75
|
+
var type = response.type;
|
|
76
|
+
if (type === "setCloudData") {
|
|
77
|
+
callback && callback(response);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
utills_1.platform === "ANDROID_APP" &&
|
|
81
|
+
utills_1.webToNative.setCloudData(JSON.stringify({
|
|
82
|
+
keyName: keyName,
|
|
83
|
+
value: value,
|
|
84
|
+
}));
|
|
85
|
+
utills_1.platform === "IOS_APP" &&
|
|
86
|
+
utills_1.webToNativeIos &&
|
|
87
|
+
utills_1.webToNativeIos.postMessage({
|
|
88
|
+
action: "setCloudData",
|
|
89
|
+
keyName: keyName,
|
|
90
|
+
value: value,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
exports.setCloudData = setCloudData;
|
|
95
|
+
var getCloudData = function (options) {
|
|
96
|
+
if (options === void 0) { options = {}; }
|
|
97
|
+
var callback = options.callback, keyName = options.keyName;
|
|
98
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
99
|
+
(0, utills_1.registerCb)(function (response) {
|
|
100
|
+
var type = response.type;
|
|
101
|
+
if (type === "getCloudData") {
|
|
102
|
+
callback && callback(response);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.getCloudData(keyName);
|
|
106
|
+
utills_1.platform === "IOS_APP" &&
|
|
107
|
+
utills_1.webToNativeIos &&
|
|
108
|
+
utills_1.webToNativeIos.postMessage({
|
|
109
|
+
action: "getCloudData",
|
|
110
|
+
keyName: keyName,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
exports.getCloudData = getCloudData;
|
|
115
|
+
var deleteCloudData = function (options) {
|
|
116
|
+
if (options === void 0) { options = {}; }
|
|
117
|
+
var callback = options.callback, keyName = options.keyName;
|
|
118
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
119
|
+
(0, utills_1.registerCb)(function (response) {
|
|
120
|
+
var type = response.type;
|
|
121
|
+
if (type === "deleteCloudData") {
|
|
122
|
+
callback && callback(response);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.deleteCloudData(keyName);
|
|
126
|
+
utills_1.platform === "IOS_APP" &&
|
|
127
|
+
utills_1.webToNativeIos &&
|
|
128
|
+
utills_1.webToNativeIos.postMessage({
|
|
129
|
+
action: "deleteCloudData",
|
|
130
|
+
keyName: keyName,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
exports.deleteCloudData = deleteCloudData;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type IKeyName = {
|
|
2
|
+
value?: any;
|
|
3
|
+
keyName?: string;
|
|
4
|
+
};
|
|
5
|
+
export type IAppDataCB = {
|
|
6
|
+
isSuccess: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type IAppDataCBWithValue = {
|
|
9
|
+
isSuccess: boolean;
|
|
10
|
+
value?: any;
|
|
11
|
+
keyName?: string;
|
|
12
|
+
};
|
|
13
|
+
export type ISetAppDataOptions = IKeyName & {
|
|
14
|
+
callback?: (response: IAppDataCBWithValue) => void;
|
|
15
|
+
};
|
|
16
|
+
export type IGetAppDataOptions = {
|
|
17
|
+
callback?: (response: IAppDataCBWithValue) => void;
|
|
18
|
+
keyName?: string;
|
|
19
|
+
};
|
|
20
|
+
export type IDeleteAppDataOptions = {
|
|
21
|
+
callback?: (response: IAppDataCB) => void;
|
|
22
|
+
keyName?: string;
|
|
23
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NotificationOptions } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Checks notification permission status
|
|
4
|
+
* @param options - Options for checking notification permission
|
|
5
|
+
*/
|
|
6
|
+
export declare const checkNotificationPermission: (options?: NotificationOptions) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Opens the app notification settings page
|
|
9
|
+
*/
|
|
10
|
+
export declare const openAppNotificationPage: () => void;
|
package/Notification/index.js
CHANGED
|
@@ -1 +1,41 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.openAppNotificationPage = exports.checkNotificationPermission = void 0;
|
|
4
|
+
var utills_1 = require("../utills");
|
|
5
|
+
/**
|
|
6
|
+
* Checks notification permission status
|
|
7
|
+
* @param options - Options for checking notification permission
|
|
8
|
+
*/
|
|
9
|
+
var checkNotificationPermission = function (options) {
|
|
10
|
+
if (options === void 0) { options = {}; }
|
|
11
|
+
var callback = options.callback;
|
|
12
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
13
|
+
(0, utills_1.registerCb)(function (response) {
|
|
14
|
+
var type = response.type;
|
|
15
|
+
if (type === "checkNotificationPermission") {
|
|
16
|
+
callback && callback(response);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.checkNotificationPermission();
|
|
20
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
21
|
+
utills_1.webToNativeIos.postMessage({
|
|
22
|
+
action: "checkNotificationPermission",
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.checkNotificationPermission = checkNotificationPermission;
|
|
28
|
+
/**
|
|
29
|
+
* Opens the app notification settings page
|
|
30
|
+
*/
|
|
31
|
+
var openAppNotificationPage = function () {
|
|
32
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
33
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.openAppNotificationPage();
|
|
34
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
35
|
+
utills_1.webToNativeIos.postMessage({
|
|
36
|
+
action: "openAppNotificationPage",
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
exports.openAppNotificationPage = openAppNotificationPage;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface NotificationResponse {
|
|
2
|
+
type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
export interface NotificationCallback {
|
|
6
|
+
(response: NotificationResponse): void;
|
|
7
|
+
}
|
|
8
|
+
export interface NotificationOptions {
|
|
9
|
+
callback?: NotificationCallback;
|
|
10
|
+
}
|
|
11
|
+
export interface NotificationIosMessage {
|
|
12
|
+
action: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TagsOptions, TriggerOptions, EmailOptions, SMSOptions } from "./types";
|
|
2
|
+
export declare const getPlayerId: () => Promise<string>;
|
|
3
|
+
export declare const setExternalUserId: (userId: string) => boolean | void;
|
|
4
|
+
export declare const removeExternalUserId: () => boolean | void;
|
|
5
|
+
export declare const setTags: ({ tags }: TagsOptions) => boolean | void;
|
|
6
|
+
export declare const addTrigger: (options?: TriggerOptions) => void;
|
|
7
|
+
export declare const addTriggers: (options?: TriggerOptions) => void;
|
|
8
|
+
export declare const removeTrigger: (options?: TriggerOptions) => void;
|
|
9
|
+
export declare const removeTriggers: (options?: TriggerOptions) => void;
|
|
10
|
+
export declare const getTriggerValue: (options?: TriggerOptions) => void;
|
|
11
|
+
export declare const getTriggers: (options?: TriggerOptions) => void;
|
|
12
|
+
export declare const setEmail: (options?: EmailOptions) => void;
|
|
13
|
+
export declare const setSMSNumber: (options?: SMSOptions) => void;
|
|
14
|
+
export declare const logoutEmail: (options?: EmailOptions) => void;
|
|
15
|
+
export declare const logoutSMSNumber: (options?: SMSOptions) => void;
|
|
16
|
+
export declare const optInUser: () => void;
|
|
17
|
+
export declare const optOutUser: () => void;
|