webtonative 1.0.77 → 1.0.78-beta.2
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 -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/OrufyConnect/index.d.ts +22 -0
- package/OrufyConnect/index.js +199 -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 +158 -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
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.restorePurchase = exports.makePurchase = exports.showPaywall = exports.getCustomerInfo = exports.setUserId = exports.isInitialized = exports.configure = void 0;
|
|
4
|
+
var index_1 = require("./../index");
|
|
5
|
+
var utills_1 = require("../utills");
|
|
6
|
+
var configure = function (options) {
|
|
7
|
+
var _a = options || {}, apiKey = _a.apiKey, userId = _a.userId, callback = _a.callback;
|
|
8
|
+
(0, utills_1.registerCb)(function (response) {
|
|
9
|
+
var type = response.type;
|
|
10
|
+
if (type === "configure") {
|
|
11
|
+
callback && callback(response);
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
if (index_1.isAndroidApp) {
|
|
15
|
+
utills_1.webToNative.configure(JSON.stringify(options));
|
|
16
|
+
}
|
|
17
|
+
else if (index_1.isIosApp && utills_1.webToNativeIos) {
|
|
18
|
+
utills_1.webToNativeIos.postMessage({
|
|
19
|
+
action: "configure",
|
|
20
|
+
apiKey: apiKey,
|
|
21
|
+
userId: userId,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
exports.configure = configure;
|
|
26
|
+
var isInitialized = function (options) {
|
|
27
|
+
var callback = (options || {}).callback;
|
|
28
|
+
(0, utills_1.registerCb)(function (response) {
|
|
29
|
+
var type = response.type;
|
|
30
|
+
if (type === "isInitialized") {
|
|
31
|
+
callback && callback(response);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
if (index_1.isAndroidApp) {
|
|
35
|
+
utills_1.webToNative.isInitialized();
|
|
36
|
+
}
|
|
37
|
+
else if (index_1.isIosApp && utills_1.webToNativeIos) {
|
|
38
|
+
utills_1.webToNativeIos.postMessage({
|
|
39
|
+
action: "isInitialized",
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
exports.isInitialized = isInitialized;
|
|
44
|
+
var setUserId = function (options) {
|
|
45
|
+
var _a = options || {}, userId = _a.userId, callback = _a.callback;
|
|
46
|
+
(0, utills_1.registerCb)(function (response) {
|
|
47
|
+
var type = response.type;
|
|
48
|
+
if (type === "setUserId") {
|
|
49
|
+
callback && callback(response);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
if (index_1.isAndroidApp) {
|
|
53
|
+
utills_1.webToNative.setUserId(JSON.stringify(options));
|
|
54
|
+
}
|
|
55
|
+
else if (index_1.isIosApp && utills_1.webToNativeIos) {
|
|
56
|
+
utills_1.webToNativeIos.postMessage({
|
|
57
|
+
action: "setUserId",
|
|
58
|
+
userId: userId,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
exports.setUserId = setUserId;
|
|
63
|
+
var getCustomerInfo = function (options) {
|
|
64
|
+
var callback = (options || {}).callback;
|
|
65
|
+
(0, utills_1.registerCb)(function (response) {
|
|
66
|
+
var type = response.type;
|
|
67
|
+
if (type === "getCustomerInfo") {
|
|
68
|
+
callback && callback(response);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
if (index_1.isAndroidApp) {
|
|
72
|
+
utills_1.webToNative.getCustomerInfo();
|
|
73
|
+
}
|
|
74
|
+
else if (index_1.isIosApp && utills_1.webToNativeIos) {
|
|
75
|
+
utills_1.webToNativeIos.postMessage({
|
|
76
|
+
action: "getCustomerInfo",
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
exports.getCustomerInfo = getCustomerInfo;
|
|
81
|
+
var showPaywall = function (options) {
|
|
82
|
+
var _a = options || {}, offeringId = _a.offeringId, callback = _a.callback;
|
|
83
|
+
(0, utills_1.registerCb)(function (response) {
|
|
84
|
+
var type = response.type;
|
|
85
|
+
if (type === "showPaywall") {
|
|
86
|
+
callback && callback(response);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
if (index_1.isAndroidApp) {
|
|
90
|
+
utills_1.webToNative.showPaywall(JSON.stringify(options));
|
|
91
|
+
}
|
|
92
|
+
else if (index_1.isIosApp && utills_1.webToNativeIos) {
|
|
93
|
+
utills_1.webToNativeIos.postMessage({
|
|
94
|
+
action: "showPaywall",
|
|
95
|
+
offeringId: offeringId,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
exports.showPaywall = showPaywall;
|
|
100
|
+
var makePurchase = function (options) {
|
|
101
|
+
var _a = options || {}, productId = _a.productId, callback = _a.callback;
|
|
102
|
+
(0, utills_1.registerCb)(function (response) {
|
|
103
|
+
var type = response.type;
|
|
104
|
+
if (type === "makePurchase") {
|
|
105
|
+
callback && callback(response);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
if (index_1.isAndroidApp) {
|
|
109
|
+
utills_1.webToNative.makePurchase(JSON.stringify(options));
|
|
110
|
+
}
|
|
111
|
+
else if (index_1.isIosApp && utills_1.webToNativeIos) {
|
|
112
|
+
utills_1.webToNativeIos.postMessage({
|
|
113
|
+
action: "makePurchase",
|
|
114
|
+
productId: productId,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
exports.makePurchase = makePurchase;
|
|
119
|
+
var restorePurchase = function (options) {
|
|
120
|
+
var callback = (options || {}).callback;
|
|
121
|
+
(0, utills_1.registerCb)(function (response) {
|
|
122
|
+
var type = response.type;
|
|
123
|
+
if (type === "restorePurchase") {
|
|
124
|
+
callback && callback(response);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
if (index_1.isAndroidApp) {
|
|
128
|
+
utills_1.webToNative.restorePurchase();
|
|
129
|
+
}
|
|
130
|
+
else if (index_1.isIosApp && utills_1.webToNativeIos) {
|
|
131
|
+
utills_1.webToNativeIos.postMessage({
|
|
132
|
+
action: "restorePurchase",
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
exports.restorePurchase = restorePurchase;
|
package/Screen/index.js
CHANGED
|
@@ -1,4 +1,34 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.keepScreenNormal = exports.keepScreenOn = void 0;
|
|
4
|
+
var utills_1 = require("../utills");
|
|
5
|
+
/**
|
|
6
|
+
* Keeps the screen on (prevents screen from turning off)
|
|
7
|
+
*/
|
|
8
|
+
var keepScreenOn = function () {
|
|
9
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
10
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
11
|
+
utills_1.webToNativeIos.postMessage({
|
|
12
|
+
action: "keepScreenOn",
|
|
13
|
+
flag: true,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.keepScreenOn();
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
exports.keepScreenOn = keepScreenOn;
|
|
20
|
+
/**
|
|
21
|
+
* Returns screen to normal behavior (allows screen to turn off)
|
|
22
|
+
*/
|
|
23
|
+
var keepScreenNormal = function () {
|
|
24
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
25
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
26
|
+
utills_1.webToNativeIos.postMessage({
|
|
27
|
+
action: "keepScreenOn",
|
|
28
|
+
flag: false,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.keepScreenNormal();
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
exports.keepScreenNormal = keepScreenNormal;
|
package/Screen/types.js
ADDED
package/Siri/index.d.ts
ADDED
package/Siri/index.js
CHANGED
|
@@ -1 +1,25 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addToSiri = void 0;
|
|
4
|
+
var utills_1 = require("../utills");
|
|
5
|
+
/**
|
|
6
|
+
* Adds an action to Siri (iOS only)
|
|
7
|
+
* @param options - Options for adding to Siri
|
|
8
|
+
*/
|
|
9
|
+
var addToSiri = function (options) {
|
|
10
|
+
if (options === void 0) { options = {}; }
|
|
11
|
+
var actionUrl = options.actionUrl, suggestedPhrase = options.suggestedPhrase, title = options.title;
|
|
12
|
+
if (["IOS_APP"].includes(utills_1.platform)) {
|
|
13
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
14
|
+
utills_1.webToNativeIos.postMessage({
|
|
15
|
+
"action": "addToSiri",
|
|
16
|
+
"data": {
|
|
17
|
+
actionUrl: actionUrl,
|
|
18
|
+
suggestedPhrase: suggestedPhrase,
|
|
19
|
+
title: title
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
exports.addToSiri = addToSiri;
|
package/Siri/types.d.ts
ADDED
package/Siri/types.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SocialLoginOptions } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* This function handles native Apple login
|
|
4
|
+
* @param options - Options for Apple login
|
|
5
|
+
* @example wtn.socialLogin.apple.login({
|
|
6
|
+
* callback:(data)=>{
|
|
7
|
+
* console.log(data);
|
|
8
|
+
* }
|
|
9
|
+
* });
|
|
10
|
+
*/
|
|
11
|
+
export declare const login: (options: SocialLoginOptions) => void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.login = void 0;
|
|
4
|
+
var utills_1 = require("../../utills");
|
|
5
|
+
/**
|
|
6
|
+
* This function handles native Apple login
|
|
7
|
+
* @param options - Options for Apple login
|
|
8
|
+
* @example wtn.socialLogin.apple.login({
|
|
9
|
+
* callback:(data)=>{
|
|
10
|
+
* console.log(data);
|
|
11
|
+
* }
|
|
12
|
+
* });
|
|
13
|
+
*/
|
|
14
|
+
var login = function (options) {
|
|
15
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
16
|
+
var callback_1 = options.callback, scope = options.scope;
|
|
17
|
+
(0, utills_1.registerCb)(function (response) {
|
|
18
|
+
var type = response.type;
|
|
19
|
+
if (type === "appleLoginToken") {
|
|
20
|
+
callback_1 && callback_1(response);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
24
|
+
utills_1.webToNativeIos.postMessage({
|
|
25
|
+
action: "appleSignIn",
|
|
26
|
+
scope: scope,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
exports.login = login;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SocialLoginOptions } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* This function handles native facebook login
|
|
4
|
+
* @param options - Options for Facebook login
|
|
5
|
+
* @example wtn.socialLogin.facebook.login({
|
|
6
|
+
* callback:(data)=>{
|
|
7
|
+
* console.log(data);
|
|
8
|
+
* }
|
|
9
|
+
* });
|
|
10
|
+
*/
|
|
11
|
+
export declare const login: (options: SocialLoginOptions) => void;
|
|
12
|
+
/**
|
|
13
|
+
* This function handles native facebook logout
|
|
14
|
+
* @param options - Options for Facebook logout
|
|
15
|
+
* @example wtn.socialLogin.facebook.logout({
|
|
16
|
+
* callback:(data)=>{
|
|
17
|
+
* console.log(data);
|
|
18
|
+
* }
|
|
19
|
+
* });
|
|
20
|
+
*/
|
|
21
|
+
export declare const logout: (options: SocialLoginOptions) => void;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.logout = exports.login = void 0;
|
|
4
|
+
var utills_1 = require("../../utills");
|
|
5
|
+
/**
|
|
6
|
+
* This function handles native facebook login
|
|
7
|
+
* @param options - Options for Facebook login
|
|
8
|
+
* @example wtn.socialLogin.facebook.login({
|
|
9
|
+
* callback:(data)=>{
|
|
10
|
+
* console.log(data);
|
|
11
|
+
* }
|
|
12
|
+
* });
|
|
13
|
+
*/
|
|
14
|
+
var login = function (options) {
|
|
15
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
16
|
+
var callback_1 = options.callback, scope = options.scope;
|
|
17
|
+
(0, utills_1.registerCb)(function (response) {
|
|
18
|
+
var type = response.type;
|
|
19
|
+
if (type === "fbLoginToken") {
|
|
20
|
+
callback_1 && callback_1(response);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.loginWithFacebook();
|
|
24
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
25
|
+
utills_1.webToNativeIos.postMessage({
|
|
26
|
+
action: "fbSignIn",
|
|
27
|
+
scope: scope,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.login = login;
|
|
33
|
+
/**
|
|
34
|
+
* This function handles native facebook logout
|
|
35
|
+
* @param options - Options for Facebook logout
|
|
36
|
+
* @example wtn.socialLogin.facebook.logout({
|
|
37
|
+
* callback:(data)=>{
|
|
38
|
+
* console.log(data);
|
|
39
|
+
* }
|
|
40
|
+
* });
|
|
41
|
+
*/
|
|
42
|
+
var logout = function (options) {
|
|
43
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
44
|
+
var callback_2 = options.callback, scope = options.scope;
|
|
45
|
+
(0, utills_1.registerCb)(function (response) {
|
|
46
|
+
var type = response.type;
|
|
47
|
+
if (type === "fbLogOut") {
|
|
48
|
+
callback_2 && callback_2(response);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.logoutWithFacebook();
|
|
52
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
53
|
+
utills_1.webToNativeIos.postMessage({
|
|
54
|
+
action: "fbSignOut",
|
|
55
|
+
scope: scope,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
exports.logout = logout;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SocialLoginOptions } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* This function handles native Google login
|
|
4
|
+
* @param options - Options for Google login
|
|
5
|
+
* @example wtn.socialLogin.google.login({
|
|
6
|
+
* callback:(data)=>{
|
|
7
|
+
* console.log(data);
|
|
8
|
+
* }
|
|
9
|
+
* });
|
|
10
|
+
*/
|
|
11
|
+
export declare const login: (options: SocialLoginOptions) => void;
|
|
12
|
+
/**
|
|
13
|
+
* This function handles native Google logout
|
|
14
|
+
* @param options - Options for Google logout
|
|
15
|
+
* @example wtn.socialLogin.google.logout({
|
|
16
|
+
* callback:(data)=>{
|
|
17
|
+
* console.log(data);
|
|
18
|
+
* }
|
|
19
|
+
* });
|
|
20
|
+
*/
|
|
21
|
+
export declare const logout: (options: SocialLoginOptions) => void;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.logout = exports.login = void 0;
|
|
4
|
+
var utills_1 = require("../../utills");
|
|
5
|
+
/**
|
|
6
|
+
* This function handles native Google login
|
|
7
|
+
* @param options - Options for Google login
|
|
8
|
+
* @example wtn.socialLogin.google.login({
|
|
9
|
+
* callback:(data)=>{
|
|
10
|
+
* console.log(data);
|
|
11
|
+
* }
|
|
12
|
+
* });
|
|
13
|
+
*/
|
|
14
|
+
var login = function (options) {
|
|
15
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
16
|
+
var callback_1 = options.callback, scope = options.scope;
|
|
17
|
+
(0, utills_1.registerCb)(function (response) {
|
|
18
|
+
var type = response.type;
|
|
19
|
+
if (type === "googleLoginToken") {
|
|
20
|
+
callback_1 && callback_1(response);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.signInWithGoogle();
|
|
24
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
25
|
+
utills_1.webToNativeIos.postMessage({
|
|
26
|
+
action: "googleSignIn",
|
|
27
|
+
scope: scope,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.login = login;
|
|
33
|
+
/**
|
|
34
|
+
* This function handles native Google logout
|
|
35
|
+
* @param options - Options for Google logout
|
|
36
|
+
* @example wtn.socialLogin.google.logout({
|
|
37
|
+
* callback:(data)=>{
|
|
38
|
+
* console.log(data);
|
|
39
|
+
* }
|
|
40
|
+
* });
|
|
41
|
+
*/
|
|
42
|
+
var logout = function (options) {
|
|
43
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
44
|
+
var callback_2 = options.callback, scope = options.scope;
|
|
45
|
+
(0, utills_1.registerCb)(function (response) {
|
|
46
|
+
var type = response.type;
|
|
47
|
+
if (type === "googleLogOut") {
|
|
48
|
+
callback_2 && callback_2(response);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
utills_1.platform === "ANDROID_APP" && utills_1.webToNative.signOutWithGoogle();
|
|
52
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
53
|
+
utills_1.webToNativeIos.postMessage({
|
|
54
|
+
action: "googleSignOut",
|
|
55
|
+
scope: scope,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
exports.logout = logout;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Social login module for Facebook, Google, and Apple authentication
|
|
3
|
+
*/
|
|
4
|
+
export declare const socialLogin: {
|
|
5
|
+
facebook: {
|
|
6
|
+
login: (options: import("./types").SocialLoginOptions) => void;
|
|
7
|
+
logout: (options: import("./types").SocialLoginOptions) => void;
|
|
8
|
+
};
|
|
9
|
+
google: {
|
|
10
|
+
login: (options: import("./types").SocialLoginOptions) => void;
|
|
11
|
+
logout: (options: import("./types").SocialLoginOptions) => void;
|
|
12
|
+
};
|
|
13
|
+
apple: {
|
|
14
|
+
login: (options: import("./types").SocialLoginOptions) => void;
|
|
15
|
+
};
|
|
16
|
+
};
|
package/SocialLogin/index.js
CHANGED
|
@@ -1 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.socialLogin = void 0;
|
|
4
|
+
var facebook_1 = require("./facebook");
|
|
5
|
+
var apple_1 = require("./apple");
|
|
6
|
+
var google_1 = require("./google");
|
|
7
|
+
/**
|
|
8
|
+
* Social login module for Facebook, Google, and Apple authentication
|
|
9
|
+
*/
|
|
10
|
+
exports.socialLogin = {
|
|
11
|
+
facebook: {
|
|
12
|
+
login: facebook_1.login,
|
|
13
|
+
logout: facebook_1.logout,
|
|
14
|
+
},
|
|
15
|
+
google: {
|
|
16
|
+
login: google_1.login,
|
|
17
|
+
logout: google_1.logout,
|
|
18
|
+
},
|
|
19
|
+
apple: {
|
|
20
|
+
login: apple_1.login,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface SocialLoginResponse {
|
|
2
|
+
type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
export interface SocialLoginCallback {
|
|
6
|
+
(response: SocialLoginResponse): void;
|
|
7
|
+
}
|
|
8
|
+
export interface SocialLoginOptions {
|
|
9
|
+
callback?: SocialLoginCallback;
|
|
10
|
+
scope?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface FacebookLoginResponse extends SocialLoginResponse {
|
|
13
|
+
type: 'fbLoginToken';
|
|
14
|
+
}
|
|
15
|
+
export interface FacebookLogoutResponse extends SocialLoginResponse {
|
|
16
|
+
type: 'fbLogOut';
|
|
17
|
+
}
|
|
18
|
+
export interface FacebookIosMessage {
|
|
19
|
+
action: 'fbSignIn' | 'fbSignOut';
|
|
20
|
+
scope?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface GoogleLoginResponse extends SocialLoginResponse {
|
|
23
|
+
type: 'googleLoginToken';
|
|
24
|
+
}
|
|
25
|
+
export interface GoogleLogoutResponse extends SocialLoginResponse {
|
|
26
|
+
type: 'googleLogOut';
|
|
27
|
+
}
|
|
28
|
+
export interface GoogleIosMessage {
|
|
29
|
+
action: 'googleSignIn' | 'googleSignOut';
|
|
30
|
+
scope?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface AppleLoginResponse extends SocialLoginResponse {
|
|
33
|
+
type: 'appleLoginToken';
|
|
34
|
+
}
|
|
35
|
+
export interface AppleIosMessage {
|
|
36
|
+
action: 'appleSignIn';
|
|
37
|
+
scope?: string;
|
|
38
|
+
}
|
package/Stripe/index.js
CHANGED
|
@@ -1 +1,48 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.makeTapToPay = void 0;
|
|
15
|
+
var utills_1 = require("../utills");
|
|
16
|
+
var makeTapToPay = function (options) {
|
|
17
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
18
|
+
var callback_1 = options.callback, _a = options.apiUrl, apiUrl = _a === void 0 ? null : _a, amount = options.amount, currency = options.currency, _b = options.isSimulated, isSimulated = _b === void 0 ? false : _b, _c = options.captureMethod, captureMethod = _c === void 0 ? "automatic" : _c, connectionToken = options.connectionToken, stripeLocationId = options.stripeLocationId, _d = options.clientSecret, clientSecret = _d === void 0 ? null : _d;
|
|
19
|
+
(0, utills_1.registerCb)(function (response) {
|
|
20
|
+
var type = response.type;
|
|
21
|
+
if (type === "makeTapToPayStripePayment") {
|
|
22
|
+
callback_1 && callback_1(response);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var paymentData = {
|
|
26
|
+
secretToken: connectionToken,
|
|
27
|
+
amount: amount,
|
|
28
|
+
currency: currency,
|
|
29
|
+
isSimulated: isSimulated,
|
|
30
|
+
captureMethod: captureMethod,
|
|
31
|
+
locationId: stripeLocationId
|
|
32
|
+
};
|
|
33
|
+
if (apiUrl) {
|
|
34
|
+
paymentData.apiUrl = apiUrl;
|
|
35
|
+
}
|
|
36
|
+
if (clientSecret) {
|
|
37
|
+
paymentData.client_secret = clientSecret;
|
|
38
|
+
}
|
|
39
|
+
if (utills_1.platform === "ANDROID_APP") {
|
|
40
|
+
utills_1.webToNative.makeTapToPayStripePayment(JSON.stringify(paymentData));
|
|
41
|
+
}
|
|
42
|
+
if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
43
|
+
var iosMessage = __assign({ "action": "makeTapToPayStripePayment" }, paymentData);
|
|
44
|
+
utills_1.webToNativeIos.postMessage(iosMessage);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
exports.makeTapToPay = makeTapToPay;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BaseCallback, BaseResponse } from "../types";
|
|
2
|
+
export interface StripeResponse extends BaseResponse {
|
|
3
|
+
type: "makeTapToPayStripePayment";
|
|
4
|
+
}
|
|
5
|
+
export interface StripeCallback extends BaseCallback {
|
|
6
|
+
(response: StripeResponse): void;
|
|
7
|
+
}
|
|
8
|
+
export interface StripePaymentData {
|
|
9
|
+
secretToken: string;
|
|
10
|
+
amount: number;
|
|
11
|
+
currency: string;
|
|
12
|
+
isSimulated: boolean;
|
|
13
|
+
captureMethod: string;
|
|
14
|
+
locationId: string;
|
|
15
|
+
apiUrl?: string;
|
|
16
|
+
client_secret?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface StripeOptions {
|
|
19
|
+
callback?: StripeCallback;
|
|
20
|
+
apiUrl?: string;
|
|
21
|
+
amount: number;
|
|
22
|
+
currency: string;
|
|
23
|
+
isSimulated?: boolean;
|
|
24
|
+
captureMethod?: string;
|
|
25
|
+
connectionToken: string;
|
|
26
|
+
stripeLocationId: string;
|
|
27
|
+
clientSecret?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface StripeIosMessage extends StripePaymentData {
|
|
30
|
+
action: string;
|
|
31
|
+
}
|
package/Stripe/types.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VoiceSearchOptions } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* This function opens native voice search
|
|
4
|
+
* @param options Configuration options for voice search
|
|
5
|
+
* @example wtn.openVoiceSearch({
|
|
6
|
+
* onVoiceSearch:(value)=>{
|
|
7
|
+
* console.log(value);
|
|
8
|
+
* }
|
|
9
|
+
* });
|
|
10
|
+
*/
|
|
11
|
+
declare const openVoiceSearch: (options?: VoiceSearchOptions) => any;
|
|
12
|
+
export default openVoiceSearch;
|