webtonative 1.0.76 → 1.0.78-beta.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/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 +8 -0
- package/Notification/index.js +39 -5
- 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/RevenueCat/index.d.ts +7 -0
- package/RevenueCat/index.js +136 -0
- 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 +154 -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
|
@@ -1,4 +1,109 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.logScreen = exports.logEvent = exports.setDefaultEventParameters = exports.setUserProperty = exports.setUserId = exports.setCollection = void 0;
|
|
4
|
+
var utills_1 = require("../../utills");
|
|
5
|
+
/**
|
|
6
|
+
* Sets Firebase Analytics collection enabled or disabled
|
|
7
|
+
* @param options - Options for setting analytics collection
|
|
8
|
+
*/
|
|
9
|
+
var setCollection = function (options) {
|
|
10
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
11
|
+
var enabled = options.enabled;
|
|
12
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
13
|
+
utills_1.webToNativeIos.postMessage({
|
|
14
|
+
action: "setFirebaseAnalyticsCollection",
|
|
15
|
+
enabled: enabled,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.setFirebaseAnalyticsCollection(enabled);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.setCollection = setCollection;
|
|
22
|
+
/**
|
|
23
|
+
* Sets Firebase user ID
|
|
24
|
+
* @param options - Options for setting user ID
|
|
25
|
+
*/
|
|
26
|
+
var setUserId = function (options) {
|
|
27
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
28
|
+
var userId = options.userId;
|
|
29
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
30
|
+
utills_1.webToNativeIos.postMessage({
|
|
31
|
+
action: "setFirebaseUserId",
|
|
32
|
+
userId: userId,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.setFirebaseUserId(userId);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
exports.setUserId = setUserId;
|
|
39
|
+
/**
|
|
40
|
+
* Sets a Firebase user property
|
|
41
|
+
* @param options - Options for setting user property
|
|
42
|
+
*/
|
|
43
|
+
var setUserProperty = function (options) {
|
|
44
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
45
|
+
var key = options.key, value = options.value;
|
|
46
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
47
|
+
utills_1.webToNativeIos.postMessage({
|
|
48
|
+
action: "setFirebaseUserProp",
|
|
49
|
+
key: key,
|
|
50
|
+
value: value,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.setFirebaseUserProp(key, value);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
exports.setUserProperty = setUserProperty;
|
|
57
|
+
/**
|
|
58
|
+
* Sets default event parameters for Firebase Analytics
|
|
59
|
+
* @param options - Options for setting default parameters
|
|
60
|
+
*/
|
|
61
|
+
var setDefaultEventParameters = function (options) {
|
|
62
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
63
|
+
var parameters = options.parameters;
|
|
64
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
65
|
+
utills_1.webToNativeIos.postMessage({
|
|
66
|
+
action: "setFirebaseDefaultParam",
|
|
67
|
+
parameters: parameters,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.setFirebaseDefaultParam(parameters);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
exports.setDefaultEventParameters = setDefaultEventParameters;
|
|
74
|
+
/**
|
|
75
|
+
* Logs a Firebase Analytics event
|
|
76
|
+
* @param options - Options for logging an event
|
|
77
|
+
*/
|
|
78
|
+
var logEvent = function (options) {
|
|
79
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
80
|
+
var eventName = options.eventName, parameters = options.parameters;
|
|
81
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
82
|
+
utills_1.webToNativeIos.postMessage({
|
|
83
|
+
action: "logFirebaseEvent",
|
|
84
|
+
eventName: eventName,
|
|
85
|
+
parameters: parameters,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.logFirebaseEvent(eventName, parameters);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
exports.logEvent = logEvent;
|
|
92
|
+
/**
|
|
93
|
+
* Logs a Firebase Analytics screen view
|
|
94
|
+
* @param options - Options for logging a screen view
|
|
95
|
+
*/
|
|
96
|
+
var logScreen = function (options) {
|
|
97
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
98
|
+
var screenName = options.screenName, screenClass = options.screenClass;
|
|
99
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
100
|
+
utills_1.webToNativeIos.postMessage({
|
|
101
|
+
action: "logFirebaseScreenView",
|
|
102
|
+
screenName: screenName,
|
|
103
|
+
screenClass: screenClass,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.logFirebaseScreenView(screenName, screenClass);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
exports.logScreen = logScreen;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FirebaseTopicSubscriptionOptions, FirebaseTopicUnsubscriptionOptions, FirebaseFCMTokenOptions } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Subscribes to a Firebase Cloud Messaging topic
|
|
4
|
+
* @param options - Options for topic subscription
|
|
5
|
+
*/
|
|
6
|
+
export declare const subscribe: (options: FirebaseTopicSubscriptionOptions) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Unsubscribes from a Firebase Cloud Messaging topic
|
|
9
|
+
* @param options - Options for topic unsubscription
|
|
10
|
+
*/
|
|
11
|
+
export declare const unsubscribe: (options: FirebaseTopicUnsubscriptionOptions) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Gets the Firebase Cloud Messaging token
|
|
14
|
+
* @param options - Options for getting FCM token
|
|
15
|
+
*/
|
|
16
|
+
export declare const getFCMToken: (options: FirebaseFCMTokenOptions) => void;
|
|
@@ -1,4 +1,63 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFCMToken = exports.unsubscribe = exports.subscribe = void 0;
|
|
4
|
+
var utills_1 = require("../../utills");
|
|
5
|
+
/**
|
|
6
|
+
* Subscribes to a Firebase Cloud Messaging topic
|
|
7
|
+
* @param options - Options for topic subscription
|
|
8
|
+
*/
|
|
9
|
+
var subscribe = function (options) {
|
|
10
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
11
|
+
var toTopic = options.toTopic;
|
|
12
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
13
|
+
utills_1.webToNativeIos.postMessage({
|
|
14
|
+
action: "firebaseSubscribeToTopic",
|
|
15
|
+
topic: toTopic,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.subscribeToTopic(toTopic);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.subscribe = subscribe;
|
|
22
|
+
/**
|
|
23
|
+
* Unsubscribes from a Firebase Cloud Messaging topic
|
|
24
|
+
* @param options - Options for topic unsubscription
|
|
25
|
+
*/
|
|
26
|
+
var unsubscribe = function (options) {
|
|
27
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
28
|
+
var fromTopic = options.fromTopic;
|
|
29
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
30
|
+
utills_1.webToNativeIos.postMessage({
|
|
31
|
+
action: "firebaseUnsubscribeFromTopic",
|
|
32
|
+
topic: fromTopic,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.unsubscribeFromTopic(fromTopic);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
exports.unsubscribe = unsubscribe;
|
|
39
|
+
/**
|
|
40
|
+
* Gets the Firebase Cloud Messaging token
|
|
41
|
+
* @param options - Options for getting FCM token
|
|
42
|
+
*/
|
|
43
|
+
var getFCMToken = function (options) {
|
|
44
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
45
|
+
var callback_1 = options.callback;
|
|
46
|
+
(0, utills_1.registerCb)(function (response) {
|
|
47
|
+
var type = response.type;
|
|
48
|
+
if (type === "getFCMToken") {
|
|
49
|
+
if (utills_1.platform === "ANDROID_APP") {
|
|
50
|
+
response.token = response.fcm_registration_token;
|
|
51
|
+
}
|
|
52
|
+
callback_1 && callback_1(response);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
56
|
+
utills_1.webToNativeIos.postMessage({
|
|
57
|
+
action: "getFCMToken",
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.getRegistrationToken();
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
exports.getFCMToken = getFCMToken;
|
package/Firebase/index.js
CHANGED
|
@@ -1 +1,30 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.Messaging = exports.Analytics = void 0;
|
|
27
|
+
var Analytics = __importStar(require("./Analytics"));
|
|
28
|
+
exports.Analytics = Analytics;
|
|
29
|
+
var Messaging = __importStar(require("./Messaging"));
|
|
30
|
+
exports.Messaging = Messaging;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export interface FirebaseAnalyticsCollectionOptions {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
}
|
|
4
|
+
export interface FirebaseUserIdOptions {
|
|
5
|
+
userId: string;
|
|
6
|
+
}
|
|
7
|
+
export interface FirebaseUserPropertyOptions {
|
|
8
|
+
key: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}
|
|
11
|
+
export interface FirebaseEventParameters {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
export interface FirebaseDefaultParametersOptions {
|
|
15
|
+
parameters: FirebaseEventParameters;
|
|
16
|
+
}
|
|
17
|
+
export interface FirebaseEventOptions {
|
|
18
|
+
eventName: string;
|
|
19
|
+
parameters?: FirebaseEventParameters;
|
|
20
|
+
}
|
|
21
|
+
export interface FirebaseScreenOptions {
|
|
22
|
+
screenName: string;
|
|
23
|
+
screenClass?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface FirebaseAnalyticsIosMessage {
|
|
26
|
+
action: string;
|
|
27
|
+
enabled?: boolean;
|
|
28
|
+
userId?: string;
|
|
29
|
+
key?: string;
|
|
30
|
+
value?: string;
|
|
31
|
+
parameters?: FirebaseEventParameters;
|
|
32
|
+
eventName?: string;
|
|
33
|
+
screenName?: string;
|
|
34
|
+
screenClass?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface FirebaseTopicSubscriptionOptions {
|
|
37
|
+
toTopic: string;
|
|
38
|
+
}
|
|
39
|
+
export interface FirebaseTopicUnsubscriptionOptions {
|
|
40
|
+
fromTopic: string;
|
|
41
|
+
}
|
|
42
|
+
export interface FirebaseFCMTokenResponse {
|
|
43
|
+
type: string;
|
|
44
|
+
token?: string;
|
|
45
|
+
fcm_registration_token?: string;
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
}
|
|
48
|
+
export interface FirebaseFCMTokenCallback {
|
|
49
|
+
(response: FirebaseFCMTokenResponse): void;
|
|
50
|
+
}
|
|
51
|
+
export interface FirebaseFCMTokenOptions {
|
|
52
|
+
callback?: FirebaseFCMTokenCallback;
|
|
53
|
+
}
|
|
54
|
+
export interface FirebaseMessagingIosMessage {
|
|
55
|
+
action: string;
|
|
56
|
+
topic?: string;
|
|
57
|
+
}
|
|
@@ -1 +1,28 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.events = void 0;
|
|
27
|
+
var FirebaseAnalyticsEvents = __importStar(require("../Firebase/Analytics"));
|
|
28
|
+
exports.events = FirebaseAnalyticsEvents;
|
package/Haptics/index.js
CHANGED
|
@@ -1 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.trigger = void 0;
|
|
4
|
+
var utills_1 = require("../utills");
|
|
5
|
+
/**
|
|
6
|
+
* Triggers a haptic feedback effect
|
|
7
|
+
* @param options - Options for the haptic effect
|
|
8
|
+
*/
|
|
9
|
+
var trigger = function (options) {
|
|
10
|
+
if (options === void 0) { options = {}; }
|
|
11
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
12
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
13
|
+
utills_1.webToNativeIos.postMessage({
|
|
14
|
+
action: "haptikEffect",
|
|
15
|
+
effect: options.effect,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
exports.trigger = trigger;
|
package/Haptics/types.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { InAppPurchaseOptions, GetAllPurchasesOptions, GetReceiptDataOptions } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* This function handles native in app purchase
|
|
4
|
+
* @param options - Options for in-app purchase
|
|
5
|
+
* @example wtn.inAppPurchase({
|
|
6
|
+
* productId : 'productId'
|
|
7
|
+
* callback:(data)=>{
|
|
8
|
+
* console.log(data);
|
|
9
|
+
* }
|
|
10
|
+
* });
|
|
11
|
+
*/
|
|
12
|
+
export declare const inAppPurchase: (options: InAppPurchaseOptions) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Gets all purchases (Android only)
|
|
15
|
+
* @param options - Options for getting all purchases
|
|
16
|
+
*/
|
|
17
|
+
export declare const getAllPurchases: (options: GetAllPurchasesOptions) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Gets receipt data (iOS only)
|
|
20
|
+
* @param options - Options for getting receipt data
|
|
21
|
+
*/
|
|
22
|
+
export declare const getReceiptData: (options: GetReceiptDataOptions) => void;
|
package/InAppPurchase/index.js
CHANGED
|
@@ -1 +1,80 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getReceiptData = exports.getAllPurchases = exports.inAppPurchase = void 0;
|
|
4
|
+
var utills_1 = require("../utills");
|
|
5
|
+
/**
|
|
6
|
+
* This function handles native in app purchase
|
|
7
|
+
* @param options - Options for in-app purchase
|
|
8
|
+
* @example wtn.inAppPurchase({
|
|
9
|
+
* productId : 'productId'
|
|
10
|
+
* callback:(data)=>{
|
|
11
|
+
* console.log(data);
|
|
12
|
+
* }
|
|
13
|
+
* });
|
|
14
|
+
*/
|
|
15
|
+
var inAppPurchase = function (options) {
|
|
16
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
17
|
+
var callback_1 = options.callback, productId = options.productId, productType = options.productType, _a = options.isConsumable, isConsumable = _a === void 0 ? false : _a;
|
|
18
|
+
(0, utills_1.registerCb)(function (response) {
|
|
19
|
+
var type = response.type;
|
|
20
|
+
if (type === "inAppPurchase") {
|
|
21
|
+
callback_1 && callback_1(response);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
25
|
+
utills_1.webToNativeIos.postMessage({
|
|
26
|
+
action: "inAppPurchase",
|
|
27
|
+
productId: productId,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
utills_1.platform === "ANDROID_APP" &&
|
|
31
|
+
utills_1.webToNative.inAppPurchase(JSON.stringify({
|
|
32
|
+
action: "inAppPurchase",
|
|
33
|
+
productId: productId,
|
|
34
|
+
productType: productType,
|
|
35
|
+
isConsumable: isConsumable
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.inAppPurchase = inAppPurchase;
|
|
40
|
+
/**
|
|
41
|
+
* Gets all purchases (Android only)
|
|
42
|
+
* @param options - Options for getting all purchases
|
|
43
|
+
*/
|
|
44
|
+
var getAllPurchases = function (options) {
|
|
45
|
+
if (["ANDROID_APP"].includes(utills_1.platform)) {
|
|
46
|
+
var callback_2 = options.callback;
|
|
47
|
+
(0, utills_1.registerCb)(function (response) {
|
|
48
|
+
var type = response.type;
|
|
49
|
+
if (type === "purchaseList") {
|
|
50
|
+
callback_2 && callback_2(response);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
utills_1.platform === "ANDROID_APP" &&
|
|
54
|
+
utills_1.webToNative.getAllPurchases({
|
|
55
|
+
action: "purchaseList"
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
exports.getAllPurchases = getAllPurchases;
|
|
60
|
+
/**
|
|
61
|
+
* Gets receipt data (iOS only)
|
|
62
|
+
* @param options - Options for getting receipt data
|
|
63
|
+
*/
|
|
64
|
+
var getReceiptData = function (options) {
|
|
65
|
+
if (["IOS_APP"].includes(utills_1.platform)) {
|
|
66
|
+
var callback_3 = options.callback;
|
|
67
|
+
(0, utills_1.registerCb)(function (response) {
|
|
68
|
+
var type = response.type;
|
|
69
|
+
if (type === "getReceiptData") {
|
|
70
|
+
callback_3 && callback_3(response);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
74
|
+
utills_1.webToNativeIos.postMessage({
|
|
75
|
+
action: "getReceiptData"
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
exports.getReceiptData = getReceiptData;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface InAppPurchaseResponse {
|
|
2
|
+
type: string;
|
|
3
|
+
isSuccess?: boolean;
|
|
4
|
+
transactionId?: string;
|
|
5
|
+
status?: string;
|
|
6
|
+
receiptData?: any;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}
|
|
9
|
+
export interface InAppPurchaseCallback {
|
|
10
|
+
(response: InAppPurchaseResponse): void;
|
|
11
|
+
}
|
|
12
|
+
export interface InAppPurchaseOptions {
|
|
13
|
+
productId: string;
|
|
14
|
+
callback?: InAppPurchaseCallback;
|
|
15
|
+
productType?: string;
|
|
16
|
+
isConsumable?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface GetAllPurchasesOptions {
|
|
19
|
+
callback?: InAppPurchaseCallback;
|
|
20
|
+
}
|
|
21
|
+
export interface GetReceiptDataOptions {
|
|
22
|
+
callback?: InAppPurchaseCallback;
|
|
23
|
+
}
|
|
24
|
+
export interface InAppPurchaseIosMessage {
|
|
25
|
+
action: string;
|
|
26
|
+
productId?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface InAppPurchaseAndroidParams {
|
|
29
|
+
action: string;
|
|
30
|
+
productId?: string;
|
|
31
|
+
productType?: string;
|
|
32
|
+
isConsumable?: boolean;
|
|
33
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CheckUpdateOptions, UpdateApplicationOptions } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Checks if an app update is available (Android only)
|
|
4
|
+
* @param options - Options for checking app update
|
|
5
|
+
*/
|
|
6
|
+
export declare const checkIfAppUpdateAvailable: (options: CheckUpdateOptions) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Updates the application (Android only)
|
|
9
|
+
* @param options - Options for updating the application
|
|
10
|
+
*/
|
|
11
|
+
export declare const updateApplication: (options: UpdateApplicationOptions) => void;
|
package/InAppUpdate/index.js
CHANGED
|
@@ -1 +1,38 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateApplication = exports.checkIfAppUpdateAvailable = void 0;
|
|
4
|
+
var utills_1 = require("../utills");
|
|
5
|
+
/**
|
|
6
|
+
* Checks if an app update is available (Android only)
|
|
7
|
+
* @param options - Options for checking app update
|
|
8
|
+
*/
|
|
9
|
+
var checkIfAppUpdateAvailable = function (options) {
|
|
10
|
+
if (["ANDROID_APP"].includes(utills_1.platform)) {
|
|
11
|
+
var callback_1 = options.callback;
|
|
12
|
+
(0, utills_1.registerCb)(function (response) {
|
|
13
|
+
var type = response.type;
|
|
14
|
+
if (type === "checkIfAppUpdateAvailable") {
|
|
15
|
+
callback_1 && callback_1(response);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.checkIfAppUpdateAvailable();
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.checkIfAppUpdateAvailable = checkIfAppUpdateAvailable;
|
|
22
|
+
/**
|
|
23
|
+
* Updates the application (Android only)
|
|
24
|
+
* @param options - Options for updating the application
|
|
25
|
+
*/
|
|
26
|
+
var updateApplication = function (options) {
|
|
27
|
+
if (["ANDROID_APP"].includes(utills_1.platform)) {
|
|
28
|
+
var _a = options.updateType, updateType = _a === void 0 ? "immediate" : _a, callback_2 = options.callback;
|
|
29
|
+
(0, utills_1.registerCb)(function (response) {
|
|
30
|
+
var type = response.type;
|
|
31
|
+
if (type === "updateApplication") {
|
|
32
|
+
callback_2 && callback_2(response);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.updateApplication(updateType);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
exports.updateApplication = updateApplication;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface InAppUpdateResponse {
|
|
2
|
+
type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
export interface InAppUpdateCallback {
|
|
6
|
+
(response: InAppUpdateResponse): void;
|
|
7
|
+
}
|
|
8
|
+
export interface CheckUpdateOptions {
|
|
9
|
+
callback?: InAppUpdateCallback;
|
|
10
|
+
}
|
|
11
|
+
export interface UpdateApplicationOptions {
|
|
12
|
+
updateType?: 'immediate' | 'flexible';
|
|
13
|
+
callback?: InAppUpdateCallback;
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MediaPlayerOptions } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Plays media content
|
|
4
|
+
* @param options - Options for playing media
|
|
5
|
+
*/
|
|
6
|
+
export declare const playMedia: (options?: MediaPlayerOptions) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Pauses currently playing media
|
|
9
|
+
* @param options - Options for pausing media
|
|
10
|
+
*/
|
|
11
|
+
export declare const pauseMedia: (options?: MediaPlayerOptions) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Stops currently playing media
|
|
14
|
+
* @param options - Options for stopping media
|
|
15
|
+
*/
|
|
16
|
+
export declare const stopMedia: (options?: MediaPlayerOptions) => void;
|