webtonative 1.0.75-beta.6 → 1.0.76
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.js +1 -54
- package/AdMob/index.js +1 -102
- package/AppReview/index.js +1 -22
- package/AppsFlyer/index.js +4 -43
- package/BackgroundLocation/index.js +4 -65
- package/Beacon/index.js +1 -30
- package/Biometric/index.js +1 -125
- package/Bluetooth/index.js +1 -67
- package/BottomNavigation/index.js +4 -41
- package/Clipboard/index.js +4 -45
- package/Facebook/events.js +4 -44
- package/Facebook/index.js +1 -29
- package/Firebase/Analytics/index.js +4 -110
- package/Firebase/Messaging/index.js +4 -64
- package/Firebase/index.js +1 -31
- package/FirebaseAnalytics/index.js +1 -29
- package/Haptics/index.js +1 -21
- package/InAppPurchase/index.js +1 -81
- package/InAppUpdate/index.js +1 -39
- package/MediaPlayer/index.js +7 -56
- package/NativeContacts/index.js +6 -51
- package/NativeDatastore/index.js +1 -0
- package/Notification/index.js +5 -42
- package/OneSignal/index.js +1 -265
- package/Printing/index.js +1 -20
- package/README.md +2 -31
- package/Screen/index.js +4 -35
- package/Siri/index.js +1 -26
- package/SocialLogin/apple.js +1 -32
- package/SocialLogin/facebook.js +3 -55
- package/SocialLogin/google.js +4 -56
- package/SocialLogin/index.js +1 -23
- package/Stripe/index.js +1 -49
- package/VoiceSearch/index.js +1 -34
- package/barcode/barcode-scan.js +1 -40
- package/barcode/formats.js +1 -23
- package/barcode/index.js +1 -13
- package/barcode/types.js +1 -22
- package/index.js +2 -535
- package/package.json +3 -134
- package/utills.js +1 -111
- package/webtonative.min.js +1 -1
- package/ATTConsent/index.d.ts +0 -17
- package/ATTConsent/index.d.ts.map +0 -1
- package/ATTConsent/index.js.map +0 -1
- package/ATTConsent/types.d.ts +0 -15
- package/ATTConsent/types.d.ts.map +0 -1
- package/ATTConsent/types.js +0 -3
- package/ATTConsent/types.js.map +0 -1
- package/AdMob/index.d.ts +0 -31
- package/AdMob/index.d.ts.map +0 -1
- package/AdMob/index.js.map +0 -1
- package/AdMob/types.d.ts +0 -25
- package/AdMob/types.d.ts.map +0 -1
- package/AdMob/types.js +0 -4
- package/AdMob/types.js.map +0 -1
- package/AppReview/index.d.ts +0 -7
- package/AppReview/index.d.ts.map +0 -1
- package/AppReview/index.js.map +0 -1
- package/AppReview/types.d.ts +0 -8
- package/AppReview/types.d.ts.map +0 -1
- package/AppReview/types.js +0 -4
- package/AppReview/types.js.map +0 -1
- package/AppsFlyer/index.d.ts +0 -15
- package/AppsFlyer/index.d.ts.map +0 -1
- package/AppsFlyer/index.js.map +0 -1
- package/AppsFlyer/types.d.ts +0 -10
- package/AppsFlyer/types.d.ts.map +0 -1
- package/AppsFlyer/types.js +0 -3
- package/AppsFlyer/types.js.map +0 -1
- package/BackgroundLocation/index.d.ts +0 -12
- package/BackgroundLocation/index.d.ts.map +0 -1
- package/BackgroundLocation/index.js.map +0 -1
- package/BackgroundLocation/types.d.ts +0 -32
- package/BackgroundLocation/types.d.ts.map +0 -1
- package/BackgroundLocation/types.js +0 -3
- package/BackgroundLocation/types.js.map +0 -1
- package/Beacon/index.d.ts +0 -7
- package/Beacon/index.d.ts.map +0 -1
- package/Beacon/index.js.map +0 -1
- package/Beacon/types.d.ts +0 -19
- package/Beacon/types.d.ts.map +0 -1
- package/Beacon/types.js +0 -3
- package/Beacon/types.js.map +0 -1
- package/Biometric/index.d.ts +0 -27
- package/Biometric/index.d.ts.map +0 -1
- package/Biometric/index.js.map +0 -1
- package/Biometric/types.d.ts +0 -24
- package/Biometric/types.d.ts.map +0 -1
- package/Biometric/types.js +0 -3
- package/Biometric/types.js.map +0 -1
- package/Bluetooth/index.d.ts +0 -17
- package/Bluetooth/index.d.ts.map +0 -1
- package/Bluetooth/index.js.map +0 -1
- package/Bluetooth/types.d.ts +0 -34
- package/Bluetooth/types.d.ts.map +0 -1
- package/Bluetooth/types.js +0 -3
- package/Bluetooth/types.js.map +0 -1
- package/BottomNavigation/index.d.ts +0 -11
- package/BottomNavigation/index.d.ts.map +0 -1
- package/BottomNavigation/index.js.map +0 -1
- package/BottomNavigation/types.d.ts +0 -9
- package/BottomNavigation/types.d.ts.map +0 -1
- package/BottomNavigation/types.js +0 -3
- package/BottomNavigation/types.js.map +0 -1
- package/Clipboard/index.d.ts +0 -12
- package/Clipboard/index.d.ts.map +0 -1
- package/Clipboard/index.js.map +0 -1
- package/Clipboard/types.d.ts +0 -20
- package/Clipboard/types.d.ts.map +0 -1
- package/Clipboard/types.js +0 -4
- package/Clipboard/types.js.map +0 -1
- package/Facebook/events.d.ts +0 -13
- package/Facebook/events.d.ts.map +0 -1
- package/Facebook/events.js.map +0 -1
- package/Facebook/index.d.ts +0 -3
- package/Facebook/index.d.ts.map +0 -1
- package/Facebook/index.js.map +0 -1
- package/Facebook/types.d.ts +0 -22
- package/Facebook/types.d.ts.map +0 -1
- package/Facebook/types.js +0 -3
- package/Facebook/types.js.map +0 -1
- package/Firebase/Analytics/index.d.ts +0 -32
- package/Firebase/Analytics/index.d.ts.map +0 -1
- package/Firebase/Analytics/index.js.map +0 -1
- package/Firebase/Messaging/index.d.ts +0 -17
- package/Firebase/Messaging/index.d.ts.map +0 -1
- package/Firebase/Messaging/index.js.map +0 -1
- package/Firebase/index.d.ts +0 -4
- package/Firebase/index.d.ts.map +0 -1
- package/Firebase/index.js.map +0 -1
- package/Firebase/types.d.ts +0 -58
- package/Firebase/types.d.ts.map +0 -1
- package/Firebase/types.js +0 -4
- package/Firebase/types.js.map +0 -1
- package/FirebaseAnalytics/index.d.ts +0 -3
- package/FirebaseAnalytics/index.d.ts.map +0 -1
- package/FirebaseAnalytics/index.js.map +0 -1
- package/Haptics/index.d.ts +0 -7
- package/Haptics/index.d.ts.map +0 -1
- package/Haptics/index.js.map +0 -1
- package/Haptics/types.d.ts +0 -8
- package/Haptics/types.d.ts.map +0 -1
- package/Haptics/types.js +0 -3
- package/Haptics/types.js.map +0 -1
- package/InAppPurchase/index.d.ts +0 -23
- package/InAppPurchase/index.d.ts.map +0 -1
- package/InAppPurchase/index.js.map +0 -1
- package/InAppPurchase/types.d.ts +0 -34
- package/InAppPurchase/types.d.ts.map +0 -1
- package/InAppPurchase/types.js +0 -3
- package/InAppPurchase/types.js.map +0 -1
- package/InAppUpdate/index.d.ts +0 -12
- package/InAppUpdate/index.d.ts.map +0 -1
- package/InAppUpdate/index.js.map +0 -1
- package/InAppUpdate/types.d.ts +0 -15
- package/InAppUpdate/types.d.ts.map +0 -1
- package/InAppUpdate/types.js +0 -3
- package/InAppUpdate/types.js.map +0 -1
- package/MediaPlayer/index.d.ts +0 -17
- package/MediaPlayer/index.d.ts.map +0 -1
- package/MediaPlayer/index.js.map +0 -1
- package/MediaPlayer/types.d.ts +0 -14
- package/MediaPlayer/types.d.ts.map +0 -1
- package/MediaPlayer/types.js +0 -3
- package/MediaPlayer/types.js.map +0 -1
- package/NativeContacts/index.d.ts +0 -12
- package/NativeContacts/index.d.ts.map +0 -1
- package/NativeContacts/index.js.map +0 -1
- package/NativeContacts/types.d.ts +0 -14
- package/NativeContacts/types.d.ts.map +0 -1
- package/NativeContacts/types.js +0 -3
- package/NativeContacts/types.js.map +0 -1
- package/Notification/index.d.ts +0 -11
- package/Notification/index.d.ts.map +0 -1
- package/Notification/index.js.map +0 -1
- package/Notification/types.d.ts +0 -14
- package/Notification/types.d.ts.map +0 -1
- package/Notification/types.js +0 -3
- package/Notification/types.js.map +0 -1
- package/OneSignal/index.d.ts +0 -18
- package/OneSignal/index.d.ts.map +0 -1
- package/OneSignal/index.js.map +0 -1
- package/OneSignal/types.d.ts +0 -41
- package/OneSignal/types.d.ts.map +0 -1
- package/OneSignal/types.js +0 -4
- package/OneSignal/types.js.map +0 -1
- package/Printing/index.d.ts +0 -7
- package/Printing/index.d.ts.map +0 -1
- package/Printing/index.js.map +0 -1
- package/Printing/types.d.ts +0 -9
- package/Printing/types.d.ts.map +0 -1
- package/Printing/types.js +0 -3
- package/Printing/types.js.map +0 -1
- package/Screen/index.d.ts +0 -9
- package/Screen/index.d.ts.map +0 -1
- package/Screen/index.js.map +0 -1
- package/Screen/types.d.ts +0 -6
- package/Screen/types.d.ts.map +0 -1
- package/Screen/types.js +0 -4
- package/Screen/types.js.map +0 -1
- package/Siri/index.d.ts +0 -7
- package/Siri/index.d.ts.map +0 -1
- package/Siri/index.js.map +0 -1
- package/Siri/types.d.ts +0 -14
- package/Siri/types.d.ts.map +0 -1
- package/Siri/types.js +0 -3
- package/Siri/types.js.map +0 -1
- package/SocialLogin/apple.d.ts +0 -12
- package/SocialLogin/apple.d.ts.map +0 -1
- package/SocialLogin/apple.js.map +0 -1
- package/SocialLogin/facebook.d.ts +0 -22
- package/SocialLogin/facebook.d.ts.map +0 -1
- package/SocialLogin/facebook.js.map +0 -1
- package/SocialLogin/google.d.ts +0 -22
- package/SocialLogin/google.d.ts.map +0 -1
- package/SocialLogin/google.js.map +0 -1
- package/SocialLogin/index.d.ts +0 -17
- package/SocialLogin/index.d.ts.map +0 -1
- package/SocialLogin/index.js.map +0 -1
- package/SocialLogin/types.d.ts +0 -39
- package/SocialLogin/types.d.ts.map +0 -1
- package/SocialLogin/types.js +0 -3
- package/SocialLogin/types.js.map +0 -1
- package/Stripe/index.d.ts +0 -3
- package/Stripe/index.d.ts.map +0 -1
- package/Stripe/index.js.map +0 -1
- package/Stripe/types.d.ts +0 -32
- package/Stripe/types.d.ts.map +0 -1
- package/Stripe/types.js +0 -3
- package/Stripe/types.js.map +0 -1
- package/VoiceSearch/index.d.ts +0 -13
- package/VoiceSearch/index.d.ts.map +0 -1
- package/VoiceSearch/index.js.map +0 -1
- package/VoiceSearch/types.d.ts +0 -10
- package/VoiceSearch/types.d.ts.map +0 -1
- package/VoiceSearch/types.js +0 -3
- package/VoiceSearch/types.js.map +0 -1
- package/barcode/barcode-scan.d.ts +0 -16
- package/barcode/barcode-scan.d.ts.map +0 -1
- package/barcode/barcode-scan.js.map +0 -1
- package/barcode/barcode-types.d.ts +0 -18
- package/barcode/barcode-types.d.ts.map +0 -1
- package/barcode/barcode-types.js +0 -3
- package/barcode/barcode-types.js.map +0 -1
- package/barcode/formats.d.ts +0 -18
- package/barcode/formats.d.ts.map +0 -1
- package/barcode/formats.js.map +0 -1
- package/barcode/index.d.ts +0 -5
- package/barcode/index.d.ts.map +0 -1
- package/barcode/index.js.map +0 -1
- package/barcode/types.d.ts +0 -17
- package/barcode/types.d.ts.map +0 -1
- package/barcode/types.js.map +0 -1
- package/index.d.ts +0 -156
- package/index.d.ts.map +0 -1
- package/index.js.map +0 -1
- package/types/index.d.ts +0 -50
- package/types/index.d.ts.map +0 -1
- package/types/index.js +0 -4
- package/types/index.js.map +0 -1
- package/utills.d.ts +0 -12
- package/utills.d.ts.map +0 -1
- package/utills.js.map +0 -1
package/Notification/index.js
CHANGED
|
@@ -1,42 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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;
|
|
42
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.openAppNotificationPage=exports.checkNotificationPermission=void 0;var _utills=require("../utills"),checkNotificationPermission=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.callback;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.registerCb)(function(a){//console.log(response);
|
|
2
|
+
var c=a.type;"checkNotificationPermission"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.checkNotificationPermission(),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"checkNotificationPermission"}))};exports.checkNotificationPermission=checkNotificationPermission;/**
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
*/var openAppNotificationPage=function(){["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&("ANDROID_APP"===_utills.platform&&_utills.webToNative.openAppNotificationPage(),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"openAppNotificationPage"}))};exports.openAppNotificationPage=openAppNotificationPage;
|
package/OneSignal/index.js
CHANGED
|
@@ -1,265 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.optOutUser = exports.optInUser = exports.logoutSMSNumber = exports.logoutEmail = exports.setSMSNumber = exports.setEmail = exports.getTriggers = exports.getTriggerValue = exports.removeTriggers = exports.removeTrigger = exports.addTriggers = exports.addTrigger = exports.setTags = exports.removeExternalUserId = exports.setExternalUserId = exports.getPlayerId = void 0;
|
|
4
|
-
var utills_1 = require("../utills");
|
|
5
|
-
var getPlayerId = function () {
|
|
6
|
-
return new Promise(function (resolve, reject) {
|
|
7
|
-
(0, utills_1.registerCb)(function (results) {
|
|
8
|
-
if (results.isSuccess) {
|
|
9
|
-
resolve(results.playerId);
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
reject(results);
|
|
13
|
-
}
|
|
14
|
-
}, {
|
|
15
|
-
key: "getPlayerId",
|
|
16
|
-
});
|
|
17
|
-
if (utills_1.platform === "ANDROID_APP") {
|
|
18
|
-
utills_1.webToNative.getOneSignalId();
|
|
19
|
-
}
|
|
20
|
-
else if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
21
|
-
utills_1.webToNativeIos.postMessage({
|
|
22
|
-
action: "getPlayerId",
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
reject("This function will work in Native App Powered By WebToNative");
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
exports.getPlayerId = getPlayerId;
|
|
31
|
-
var setExternalUserId = function (userId) {
|
|
32
|
-
if (userId) {
|
|
33
|
-
if (utills_1.platform === "ANDROID_APP") {
|
|
34
|
-
return utills_1.isNativeApp && utills_1.webToNative.setExternalUserId(userId);
|
|
35
|
-
}
|
|
36
|
-
else if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
37
|
-
utills_1.webToNativeIos.postMessage({
|
|
38
|
-
action: "setExternalUserId",
|
|
39
|
-
userId: userId,
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
throw "userId is required";
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
exports.setExternalUserId = setExternalUserId;
|
|
48
|
-
var removeExternalUserId = function () {
|
|
49
|
-
if (utills_1.platform === "ANDROID_APP") {
|
|
50
|
-
return utills_1.isNativeApp && utills_1.webToNative.removeExternalUserId();
|
|
51
|
-
}
|
|
52
|
-
else if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
53
|
-
utills_1.webToNativeIos.postMessage({
|
|
54
|
-
action: "removeExternalUserId",
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
exports.removeExternalUserId = removeExternalUserId;
|
|
59
|
-
var setTags = function (_a) {
|
|
60
|
-
var tags = _a.tags;
|
|
61
|
-
if (tags) {
|
|
62
|
-
if (utills_1.platform === "ANDROID_APP") {
|
|
63
|
-
return utills_1.isNativeApp && utills_1.webToNative.setUserTags(JSON.stringify(tags));
|
|
64
|
-
}
|
|
65
|
-
else if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
66
|
-
utills_1.webToNativeIos.postMessage({
|
|
67
|
-
action: "setUserTags",
|
|
68
|
-
tags: tags,
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
exports.setTags = setTags;
|
|
74
|
-
var addTrigger = function (options) {
|
|
75
|
-
if (options === void 0) { options = {}; }
|
|
76
|
-
var key = options.key, value = options.value;
|
|
77
|
-
if (utills_1.platform === "ANDROID_APP") {
|
|
78
|
-
utills_1.webToNative.addTrigger(JSON.stringify({
|
|
79
|
-
key: key,
|
|
80
|
-
value: value,
|
|
81
|
-
}));
|
|
82
|
-
}
|
|
83
|
-
else if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
84
|
-
utills_1.webToNativeIos.postMessage({
|
|
85
|
-
action: "addTrigger",
|
|
86
|
-
key: key,
|
|
87
|
-
value: value,
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
exports.addTrigger = addTrigger;
|
|
92
|
-
var addTriggers = function (options) {
|
|
93
|
-
if (options === void 0) { options = {}; }
|
|
94
|
-
var triggers = options.triggers;
|
|
95
|
-
if (utills_1.platform === "ANDROID_APP") {
|
|
96
|
-
utills_1.webToNative.addTriggers(JSON.stringify({
|
|
97
|
-
triggers: triggers,
|
|
98
|
-
}));
|
|
99
|
-
}
|
|
100
|
-
else if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
101
|
-
utills_1.webToNativeIos.postMessage({
|
|
102
|
-
action: "addTriggers",
|
|
103
|
-
triggers: triggers,
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
exports.addTriggers = addTriggers;
|
|
108
|
-
var removeTrigger = function (options) {
|
|
109
|
-
if (options === void 0) { options = {}; }
|
|
110
|
-
var key = options.key;
|
|
111
|
-
if (utills_1.platform === "ANDROID_APP") {
|
|
112
|
-
utills_1.webToNative.removeTriggerForKey(key);
|
|
113
|
-
}
|
|
114
|
-
else if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
115
|
-
utills_1.webToNativeIos.postMessage({
|
|
116
|
-
action: "removeTrigger",
|
|
117
|
-
key: key,
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
exports.removeTrigger = removeTrigger;
|
|
122
|
-
var removeTriggers = function (options) {
|
|
123
|
-
if (options === void 0) { options = {}; }
|
|
124
|
-
var keys = options.keys;
|
|
125
|
-
if (utills_1.platform === "ANDROID_APP") {
|
|
126
|
-
utills_1.webToNative.removeTriggersForKeys(JSON.stringify({ keys: keys }));
|
|
127
|
-
}
|
|
128
|
-
else if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
129
|
-
utills_1.webToNativeIos.postMessage({
|
|
130
|
-
action: "removeTriggers",
|
|
131
|
-
keys: keys,
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
exports.removeTriggers = removeTriggers;
|
|
136
|
-
var getTriggerValue = function (options) {
|
|
137
|
-
if (options === void 0) { options = {}; }
|
|
138
|
-
var key = options.key, callback = options.callback;
|
|
139
|
-
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
140
|
-
(0, utills_1.registerCb)(function (response) {
|
|
141
|
-
var type = response.type;
|
|
142
|
-
if (type === "getTriggerValue") {
|
|
143
|
-
callback && callback(response);
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
if (utills_1.platform === "ANDROID_APP") {
|
|
147
|
-
utills_1.webToNative.getTriggerValueForKey(key);
|
|
148
|
-
}
|
|
149
|
-
else if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
150
|
-
utills_1.webToNativeIos.postMessage({
|
|
151
|
-
action: "getTriggerValue",
|
|
152
|
-
key: key,
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
exports.getTriggerValue = getTriggerValue;
|
|
158
|
-
var getTriggers = function (options) {
|
|
159
|
-
if (options === void 0) { options = {}; }
|
|
160
|
-
var callback = options.callback;
|
|
161
|
-
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
162
|
-
(0, utills_1.registerCb)(function (response) {
|
|
163
|
-
var type = response.type;
|
|
164
|
-
if (type === "getTriggers") {
|
|
165
|
-
callback && callback(response);
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
if (utills_1.platform === "ANDROID_APP") {
|
|
169
|
-
utills_1.webToNative.getTriggers();
|
|
170
|
-
}
|
|
171
|
-
else if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
172
|
-
utills_1.webToNativeIos.postMessage({
|
|
173
|
-
action: "getTriggers",
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
|
-
exports.getTriggers = getTriggers;
|
|
179
|
-
var setEmail = function (options) {
|
|
180
|
-
if (options === void 0) { options = {}; }
|
|
181
|
-
var emailId = options.emailId;
|
|
182
|
-
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
183
|
-
if (utills_1.platform === "ANDROID_APP") {
|
|
184
|
-
utills_1.webToNative.setEmail(emailId);
|
|
185
|
-
}
|
|
186
|
-
else if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
187
|
-
utills_1.webToNativeIos.postMessage({
|
|
188
|
-
action: "setEmail",
|
|
189
|
-
emailId: emailId,
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
exports.setEmail = setEmail;
|
|
195
|
-
var setSMSNumber = function (options) {
|
|
196
|
-
if (options === void 0) { options = {}; }
|
|
197
|
-
var smsNumber = options.smsNumber;
|
|
198
|
-
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
199
|
-
if (utills_1.platform === "ANDROID_APP") {
|
|
200
|
-
utills_1.webToNative.setSMSNumber(smsNumber);
|
|
201
|
-
}
|
|
202
|
-
else if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
203
|
-
utills_1.webToNativeIos.postMessage({
|
|
204
|
-
action: "setSMSNumber",
|
|
205
|
-
smsNumber: smsNumber,
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
exports.setSMSNumber = setSMSNumber;
|
|
211
|
-
var logoutEmail = function (options) {
|
|
212
|
-
if (options === void 0) { options = {}; }
|
|
213
|
-
var emailId = options.emailId;
|
|
214
|
-
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
215
|
-
if (utills_1.platform === "ANDROID_APP") {
|
|
216
|
-
utills_1.webToNative.logoutEmail(emailId);
|
|
217
|
-
}
|
|
218
|
-
else if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
219
|
-
utills_1.webToNativeIos.postMessage({
|
|
220
|
-
action: "logoutEmail",
|
|
221
|
-
emailId: emailId,
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
};
|
|
226
|
-
exports.logoutEmail = logoutEmail;
|
|
227
|
-
var logoutSMSNumber = function (options) {
|
|
228
|
-
if (options === void 0) { options = {}; }
|
|
229
|
-
var smsNumber = options.smsNumber;
|
|
230
|
-
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
231
|
-
if (utills_1.platform === "ANDROID_APP") {
|
|
232
|
-
utills_1.webToNative.logoutSMSNumber(smsNumber);
|
|
233
|
-
}
|
|
234
|
-
else if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
235
|
-
utills_1.webToNativeIos.postMessage({
|
|
236
|
-
action: "logoutSMSNumber",
|
|
237
|
-
smsNumber: smsNumber,
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
|
-
exports.logoutSMSNumber = logoutSMSNumber;
|
|
243
|
-
var optInUser = function () {
|
|
244
|
-
if (utills_1.platform === "ANDROID_APP") {
|
|
245
|
-
utills_1.webToNative.optInOneSignalPermissionDialog();
|
|
246
|
-
}
|
|
247
|
-
else if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
248
|
-
utills_1.webToNativeIos.postMessage({
|
|
249
|
-
action: "optInOneSignalPermissionDialog",
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
};
|
|
253
|
-
exports.optInUser = optInUser;
|
|
254
|
-
var optOutUser = function () {
|
|
255
|
-
if (utills_1.platform === "ANDROID_APP") {
|
|
256
|
-
utills_1.webToNative.optOutOneSignalPermissionDialog();
|
|
257
|
-
}
|
|
258
|
-
else if (utills_1.platform === "IOS_APP" && utills_1.webToNativeIos) {
|
|
259
|
-
utills_1.webToNativeIos.postMessage({
|
|
260
|
-
action: "optOutOneSignalPermissionDialog",
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
};
|
|
264
|
-
exports.optOutUser = optOutUser;
|
|
265
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.setTags=exports.setSMSNumber=exports.setExternalUserId=exports.setEmail=exports.removeTriggers=exports.removeTrigger=exports.removeExternalUserId=exports.optOutUser=exports.optInUser=exports.logoutSMSNumber=exports.logoutEmail=exports.getTriggers=exports.getTriggerValue=exports.getPlayerId=exports.addTriggers=exports.addTrigger=void 0;var _utills=require("../utills"),getPlayerId=function(){return new Promise(function(a,b){(0,_utills.registerCb)(function(c){c.isSuccess?a(c.playerId):b(c)},{key:"getPlayerId"}),"ANDROID_APP"===_utills.platform?_utills.webToNative.getOneSignalId():"IOS_APP"===_utills.platform?_utills.webToNativeIos.postMessage({action:"getPlayerId"}):b("This function will work in Native App Powered By WebToNative")})};exports.getPlayerId=getPlayerId;var setExternalUserId=function(a){if(a){if("ANDROID_APP"===_utills.platform)return _utills.isNativeApp&&_utills.webToNative.setExternalUserId(a);"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"setExternalUserId",userId:a})}else throw"userId is required"};exports.setExternalUserId=setExternalUserId;var removeExternalUserId=function(){return"ANDROID_APP"===_utills.platform?_utills.isNativeApp&&_utills.webToNative.removeExternalUserId():void("IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"removeExternalUserId"}))};exports.removeExternalUserId=removeExternalUserId;var setTags=function(a){var b=a.tags;if(b){if("ANDROID_APP"===_utills.platform)return _utills.isNativeApp&&_utills.webToNative.setUserTags(JSON.stringify(b));"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"setUserTags",tags:b})}};exports.setTags=setTags;var addTrigger=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.key,c=a.value;"ANDROID_APP"===_utills.platform?_utills.webToNative.addTrigger(JSON.stringify({key:b,value:c})):"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"addTrigger",key:b,value:c})};exports.addTrigger=addTrigger;var addTriggers=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.triggers;"ANDROID_APP"===_utills.platform?_utills.webToNative.addTriggers(JSON.stringify({triggers:b})):"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"addTriggers",triggers:b})};exports.addTriggers=addTriggers;var removeTrigger=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.key;"ANDROID_APP"===_utills.platform?_utills.webToNative.removeTriggerForKey(b):"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"removeTrigger",key:b})};exports.removeTrigger=removeTrigger;var removeTriggers=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.keys;"ANDROID_APP"===_utills.platform?_utills.webToNative.removeTriggersForKeys(JSON.stringify({keys:b})):"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"removeTriggers",keys:b})};exports.removeTriggers=removeTriggers;var getTriggerValue=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.key,c=a.callback;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.registerCb)(function(a){var b=a.type;"getTriggerValue"===b&&c&&c(a)}),"ANDROID_APP"===_utills.platform?_utills.webToNative.getTriggerValueForKey(b):"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"getTriggerValue",key:b}))};exports.getTriggerValue=getTriggerValue;var getTriggers=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.callback;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.registerCb)(function(a){var c=a.type;"getTriggers"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform?_utills.webToNative.getTriggers():"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"getTriggers"}))};exports.getTriggers=getTriggers;var setEmail=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.emailId;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&"ANDROID_APP"===_utills.platform&&_utills.webToNative.setEmail(b)};exports.setEmail=setEmail;var setSMSNumber=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.smsNumber;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&"ANDROID_APP"===_utills.platform&&_utills.webToNative.setSMSNumber(b)};exports.setSMSNumber=setSMSNumber;var logoutEmail=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.emailId;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&"ANDROID_APP"===_utills.platform&&_utills.webToNative.logoutEmail(b)};exports.logoutEmail=logoutEmail;var logoutSMSNumber=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.smsNumber;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&"ANDROID_APP"===_utills.platform&&_utills.webToNative.logoutSMSNumber(b)};exports.logoutSMSNumber=logoutSMSNumber;var optInUser=function(){"ANDROID_APP"===_utills.platform?_utills.webToNative.optInOneSignalPermissionDialog():"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"optInOneSignalPermissionDialog"})};exports.optInUser=optInUser;var optOutUser=function(){0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};"ANDROID_APP"===_utills.platform?_utills.webToNative.optOutOneSignalPermissionDialog():"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"optOutOneSignalPermissionDialog"})};exports.optOutUser=optOutUser;
|
package/Printing/index.js
CHANGED
|
@@ -1,20 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setPrintSize = void 0;
|
|
4
|
-
var utills_1 = require("../utills");
|
|
5
|
-
/**
|
|
6
|
-
* Sets the print size for Android printing
|
|
7
|
-
* @param options - Options for setting print size
|
|
8
|
-
*/
|
|
9
|
-
var setPrintSize = function (options) {
|
|
10
|
-
if (["ANDROID_APP"].includes(utills_1.platform)) {
|
|
11
|
-
var _a = options.printSize, printSize = _a === void 0 ? "ISO_A4" : _a, _b = options.label, label = _b === void 0 ? "" : _b;
|
|
12
|
-
utills_1.platform === "ANDROID_APP" &&
|
|
13
|
-
utills_1.webToNative.setPrintSize(JSON.stringify({
|
|
14
|
-
printSize: printSize,
|
|
15
|
-
label: label
|
|
16
|
-
}));
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
exports.setPrintSize = setPrintSize;
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.setPrintSize=void 0;var _utills=require("../utills"),setPrintSize=function(a){if(["ANDROID_APP"].includes(_utills.platform)){var b=a.printSize,c=void 0===b?"ISO_A4":b,d=a.label,e=void 0===d?"":d;"ANDROID_APP"===_utills.platform&&_utills.webToNative.setPrintSize(JSON.stringify({printSize:c,label:e}))}};exports.setPrintSize=setPrintSize;
|
package/README.md
CHANGED
|
@@ -1,33 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
Repository for webtonative javascript sdk. Build your android/ios app from https://webtonative.com
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install webtonative
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## TypeScript Support
|
|
12
|
-
|
|
13
|
-
This package includes TypeScript type definitions. You can use it in your TypeScript projects with full type checking and autocompletion support.
|
|
14
|
-
|
|
15
|
-
```typescript
|
|
16
|
-
import webtonative from 'webtonative';
|
|
17
|
-
|
|
18
|
-
// Initialize the SDK
|
|
19
|
-
const wtn = webtonative();
|
|
20
|
-
|
|
21
|
-
// Use with TypeScript type checking
|
|
22
|
-
wtn.statusBar({ color: '#FFFFFF', style: 'dark' });
|
|
23
|
-
|
|
24
|
-
// Access device information with typed response
|
|
25
|
-
wtn.deviceInfo().then(info => {
|
|
26
|
-
console.log(info);
|
|
27
|
-
});
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Documentation
|
|
31
|
-
|
|
32
|
-
For complete documentation, visit:
|
|
3
|
+
Looking for the documentation?
|
|
33
4
|
https://docs.webtonative.com
|
package/Screen/index.js
CHANGED
|
@@ -1,35 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
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;
|
|
35
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.keepScreenOn=exports.keepScreenNormal=void 0;var _utills=require("../utills"),keepScreenOn=function(){["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&("IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"keepScreenOn",flag:!0}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.keepScreenOn())};exports.keepScreenOn=keepScreenOn;/**
|
|
2
|
+
*
|
|
3
|
+
*
|
|
4
|
+
*/var keepScreenNormal=function(){["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&("IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"keepScreenOn",flag:!1}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.keepScreenNormal())};exports.keepScreenNormal=keepScreenNormal;
|
package/Siri/index.js
CHANGED
|
@@ -1,26 +1 @@
|
|
|
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;
|
|
26
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addToSiri=void 0;var _utills=require("../utills"),addToSiri=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.actionUrl,c=a.suggestedPhrase,d=a.title;["IOS_APP"].includes(_utills.platform)&&"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"addToSiri",data:{actionUrl:b,suggestedPhrase:c,title:d}})};exports.addToSiri=addToSiri;
|
package/SocialLogin/apple.js
CHANGED
|
@@ -1,32 +1 @@
|
|
|
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;
|
|
32
|
-
//# sourceMappingURL=apple.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.login=void 0;var _utills=require("../utills"),login=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.callback,c=a.scope;(0,_utills.registerCb)(function(a){var c=a.type;"appleLoginToken"===c&&b&&b(a)}),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"appleSignIn",scope:c})}};exports.login=login;
|
package/SocialLogin/facebook.js
CHANGED
|
@@ -1,61 +1,9 @@
|
|
|
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
|
-
/**
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.logout=exports.login=void 0;var _utills=require("../utills"),login=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.callback,c=a.scope;(0,_utills.registerCb)(function(a){var c=a.type;"fbLoginToken"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.loginWithFacebook(),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"fbSignIn",scope:c})}};exports.login=login;/**
|
|
34
2
|
* This function handles native facebook logout
|
|
35
|
-
* @param options
|
|
3
|
+
* @param {object} options
|
|
36
4
|
* @example wtn.socialLogin.facebook.logout({
|
|
37
5
|
* callback:(data)=>{
|
|
38
6
|
* console.log(data);
|
|
39
7
|
* }
|
|
40
8
|
* });
|
|
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;
|
|
61
|
-
//# sourceMappingURL=facebook.js.map
|
|
9
|
+
*/var logout=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.callback,c=a.scope;(0,_utills.registerCb)(function(a){var c=a.type;"fbLogOut"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.logoutWithFacebook(),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"fbSignOut",scope:c})}};exports.logout=logout;
|
package/SocialLogin/google.js
CHANGED
|
@@ -1,61 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
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
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.logout=exports.login=void 0;var _utills=require("../utills"),login=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.callback,c=a.scope;(0,_utills.registerCb)(function(a){var c=a.type;"googleLoginToken"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.signInWithGoogle(),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"googleSignIn",scope:c})}};exports.login=login;/**
|
|
2
|
+
* This function handles native google logout
|
|
3
|
+
* @param {object} options
|
|
36
4
|
* @example wtn.socialLogin.google.logout({
|
|
37
5
|
* callback:(data)=>{
|
|
38
6
|
* console.log(data);
|
|
39
7
|
* }
|
|
40
8
|
* });
|
|
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;
|
|
61
|
-
//# sourceMappingURL=google.js.map
|
|
9
|
+
*/var logout=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.callback,c=a.scope;(0,_utills.registerCb)(function(a){var c=a.type;"googleLogOut"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.signOutWithGoogle(),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"googleSignOut",scope:c})}};exports.logout=logout;
|
package/SocialLogin/index.js
CHANGED
|
@@ -1,23 +1 @@
|
|
|
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
|
-
};
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.socialLogin=void 0;var _facebook=require("./facebook"),_apple=require("./apple"),_google=require("./google"),socialLogin={facebook:{login:_facebook.login,logout:_facebook.logout},google:{login:_google.login,logout:_google.logout},apple:{login:_apple.login}};exports.socialLogin=socialLogin;
|