webtonative 1.0.76 → 1.0.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ATTConsent/index.d.ts +16 -0
- package/ATTConsent/index.js +53 -1
- package/ATTConsent/types.d.ts +14 -0
- package/ATTConsent/types.js +2 -0
- package/AdMob/index.d.ts +30 -0
- package/AdMob/index.js +101 -1
- package/AdMob/types.d.ts +24 -0
- package/AdMob/types.js +3 -0
- package/AppReview/index.d.ts +6 -0
- package/AppReview/index.js +21 -1
- package/AppReview/types.d.ts +7 -0
- package/AppReview/types.js +3 -0
- package/AppsFlyer/index.d.ts +14 -0
- package/AppsFlyer/index.js +42 -4
- package/AppsFlyer/types.d.ts +9 -0
- package/AppsFlyer/types.js +2 -0
- package/BackgroundLocation/index.d.ts +11 -0
- package/BackgroundLocation/index.js +64 -4
- package/BackgroundLocation/types.d.ts +31 -0
- package/BackgroundLocation/types.js +2 -0
- package/Beacon/index.d.ts +6 -0
- package/Beacon/index.js +29 -1
- package/Beacon/types.d.ts +18 -0
- package/Beacon/types.js +2 -0
- package/Biometric/index.d.ts +26 -0
- package/Biometric/index.js +124 -1
- package/Biometric/types.d.ts +23 -0
- package/Biometric/types.js +2 -0
- package/Bluetooth/index.d.ts +16 -0
- package/Bluetooth/index.js +66 -1
- package/Bluetooth/types.d.ts +33 -0
- package/Bluetooth/types.js +2 -0
- package/BottomNavigation/index.d.ts +10 -0
- package/BottomNavigation/index.js +40 -4
- package/BottomNavigation/types.d.ts +8 -0
- package/BottomNavigation/types.js +2 -0
- package/Clipboard/index.d.ts +11 -0
- package/Clipboard/index.js +44 -4
- package/Clipboard/types.d.ts +19 -0
- package/Clipboard/types.js +3 -0
- package/Facebook/events.d.ts +12 -0
- package/Facebook/events.js +43 -4
- package/Facebook/index.d.ts +2 -0
- package/Facebook/index.js +28 -1
- package/Facebook/types.d.ts +21 -0
- package/Facebook/types.js +2 -0
- package/Firebase/Analytics/index.d.ts +31 -0
- package/Firebase/Analytics/index.js +109 -4
- package/Firebase/Messaging/index.d.ts +16 -0
- package/Firebase/Messaging/index.js +63 -4
- package/Firebase/index.d.ts +3 -0
- package/Firebase/index.js +30 -1
- package/Firebase/types.d.ts +57 -0
- package/Firebase/types.js +3 -0
- package/FirebaseAnalytics/index.d.ts +2 -0
- package/FirebaseAnalytics/index.js +28 -1
- package/Haptics/index.d.ts +6 -0
- package/Haptics/index.js +20 -1
- package/Haptics/types.d.ts +7 -0
- package/Haptics/types.js +2 -0
- package/InAppPurchase/index.d.ts +22 -0
- package/InAppPurchase/index.js +80 -1
- package/InAppPurchase/types.d.ts +33 -0
- package/InAppPurchase/types.js +2 -0
- package/InAppUpdate/index.d.ts +11 -0
- package/InAppUpdate/index.js +38 -1
- package/InAppUpdate/types.d.ts +14 -0
- package/InAppUpdate/types.js +2 -0
- package/MediaPlayer/index.d.ts +16 -0
- package/MediaPlayer/index.js +55 -7
- package/MediaPlayer/types.d.ts +13 -0
- package/MediaPlayer/types.js +2 -0
- package/NativeContacts/index.d.ts +11 -0
- package/NativeContacts/index.js +50 -6
- package/NativeContacts/types.d.ts +13 -0
- package/NativeContacts/types.js +2 -0
- package/NativeDatastore/index.d.ts +7 -0
- package/NativeDatastore/index.js +134 -1
- package/NativeDatastore/type.d.ts +23 -0
- package/NativeDatastore/type.js +2 -0
- package/Notification/index.d.ts +10 -0
- package/Notification/index.js +41 -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/Screen/index.d.ts +8 -0
- package/Screen/index.js +34 -4
- package/Screen/types.d.ts +5 -0
- package/Screen/types.js +3 -0
- package/Siri/index.d.ts +6 -0
- package/Siri/index.js +25 -1
- package/Siri/types.d.ts +13 -0
- package/Siri/types.js +2 -0
- package/SocialLogin/apple/index.d.ts +11 -0
- package/SocialLogin/apple/index.js +31 -0
- package/SocialLogin/facebook/index.d.ts +21 -0
- package/SocialLogin/facebook/index.js +60 -0
- package/SocialLogin/google/index.d.ts +21 -0
- package/SocialLogin/google/index.js +60 -0
- package/SocialLogin/index.d.ts +16 -0
- package/SocialLogin/index.js +22 -1
- package/SocialLogin/types.d.ts +38 -0
- package/SocialLogin/types.js +2 -0
- package/Stripe/index.d.ts +2 -0
- package/Stripe/index.js +48 -1
- package/Stripe/types.d.ts +31 -0
- package/Stripe/types.js +2 -0
- package/VoiceSearch/index.d.ts +12 -0
- package/VoiceSearch/index.js +33 -1
- package/VoiceSearch/types.d.ts +9 -0
- package/VoiceSearch/types.js +2 -0
- package/barcode/barcode-scan.d.ts +15 -0
- package/barcode/barcode-scan.js +39 -1
- package/barcode/barcode-types.d.ts +17 -0
- package/barcode/barcode-types.js +2 -0
- package/barcode/formats.d.ts +17 -0
- package/barcode/formats.js +22 -1
- package/barcode/index.d.ts +4 -0
- package/barcode/index.js +12 -1
- package/barcode/types.d.ts +16 -0
- package/barcode/types.js +21 -1
- package/index.d.ts +155 -0
- package/index.js +540 -2
- package/package.json +150 -3
- package/types/index.d.ts +49 -0
- package/types/index.js +3 -0
- package/utills.d.ts +11 -0
- package/utills.js +110 -1
- package/webtonative.min.js +1 -1
- package/SocialLogin/apple.js +0 -1
- package/SocialLogin/facebook.js +0 -9
- package/SocialLogin/google.js +0 -9
package/index.js
CHANGED
|
@@ -1,4 +1,542 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isNativeApp = exports.platform = exports.registerNotification = exports.showNativeComponents = exports.hideNativeComponents = exports.setOrientation = exports.checkPermission = exports.getAddOnStatus = exports.getSafeArea = exports.customBackHandling = exports.disableScreenshot = exports.updateAppIcon = exports.showPermission = exports.openAppSettingForPermission = exports.forceUpdateCookies = exports.appFirstLoad = exports.addToSiri = exports.loadOfferCard = exports.nfcSupported = exports.printFunction = exports.showDateTimePicker = exports.closeApp = exports.shareFile = exports.clearAppCache = exports.enablePullToRefresh = exports.openUrlInBrowser = exports.shareLink = exports.isDeviceGPSEnabled = exports.showInAppReview = exports.deviceInfo = exports.customFileDownload = exports.downloadBlobFile = exports.downloadFile = exports.statusBar = exports.hideSplashScreen = exports.isAndroidORIosApp = exports.isIosApp = exports.isAndroidApp = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Repository for webtonative javascript sdk. Build your android/ios app from https://webtonative.com.
|
|
6
|
+
* This is in beta phase.
|
|
7
|
+
* @example npm install webtonative
|
|
8
|
+
* import webtonative from "webtonative";
|
|
9
|
+
* const wtn = webtonative();
|
|
10
|
+
*/
|
|
11
|
+
var utills_1 = require("./utills");
|
|
12
|
+
Object.defineProperty(exports, "isNativeApp", { enumerable: true, get: function () { return utills_1.isNativeApp; } });
|
|
13
|
+
Object.defineProperty(exports, "platform", { enumerable: true, get: function () { return utills_1.platform; } });
|
|
14
|
+
exports.isAndroidApp = utills_1.platform === "ANDROID_APP";
|
|
15
|
+
exports.isIosApp = utills_1.platform === "IOS_APP";
|
|
16
|
+
exports.isAndroidORIosApp = ["ANDROID_APP", "IOS_APP"].includes(utills_1.platform);
|
|
17
|
+
/**
|
|
2
18
|
* This function hides splash screen
|
|
3
19
|
* @example wtn.hideSplashScreen()
|
|
4
|
-
*/exports.isAndroidORIosApp=isAndroidORIosApp;var hideSplashScreen=function(){_utills.isNativeApp&&_utills.webToNative.hideSplashScreen()};exports.hideSplashScreen=hideSplashScreen;var statusBar=function(a){_utills.isNativeApp&&(isAndroidApp?_utills.webToNative.statusBar(JSON.stringify(a)):isIosApp&&_utills.webToNativeIos.postMessage({action:"statusBar",color:a.color,style:a.style}))};exports.statusBar=statusBar;var downloadFile=function(a){_utills.isNativeApp&&(isAndroidApp||isIosApp&&_utills.webToNativeIos.postMessage({action:"downloadFile",downloadUrl:a}))};exports.downloadFile=downloadFile;var downloadBlobFile=function(a){var b=a.fileName,c=a.downloadUrl;["IOS_APP"].includes(_utills.platform)&&isIosApp&&_utills.webToNativeIos.postMessage({action:"downloadBlobFile",fileName:b,url:c})};exports.downloadBlobFile=downloadBlobFile;var customFileDownload=function(a){var b=a.downloadUrl,c=a.fileName,d=a.isBlob,e=a.mimeType,f=a.cookies,g=a.userAgent,h=a.openFileAfterDownload;["ANDROID_APP"].includes(_utills.platform)&&"ANDROID_APP"===_utills.platform&&_utills.webToNative.downloadFile(JSON.stringify({url:b,fileName:c,isBlob:d,mimeType:e,cookies:f,userAgent:g,openFileAfterDownload:h}))};exports.customFileDownload=customFileDownload;var deviceInfo=function(){return new Promise(function(a,b){(0,_utills.registerCb)(function(c){c?a(c):b({err:"Error getting device info"})},{key:"deviceInfo"}),"ANDROID_APP"===_utills.platform?_utills.webToNative.getDeviceInfo():"IOS_APP"===_utills.platform?_utills.webToNativeIos.postMessage({action:"deviceInfo"}):b("This function will work in Native App Powered By WebToNative")})};exports.deviceInfo=deviceInfo;var showInAppReview=function(){_utills.isNativeApp&&_utills.webToNative.showInAppReview()};exports.showInAppReview=showInAppReview;var isDeviceGPSEnabled=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;"isDeviceGPSEnabled"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.isLocationServiceEnabled())};exports.isDeviceGPSEnabled=isDeviceGPSEnabled;var shareLink=function(a){var b=a.url,c=void 0===b?"":b;if(c)isAndroidApp&&_utills.webToNative.openShareIntent(c),isIosApp&&_utills.webToNativeIos.postMessage({action:"share",url:c});else throw"url is mandatory"};exports.shareLink=shareLink;var openUrlInBrowser=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";if(a)isAndroidApp&&_utills.webToNative.openUrlInBrowser(a);else throw"url is mandatory"};exports.openUrlInBrowser=openUrlInBrowser;var enablePullToRefresh=function(a){isAndroidApp&&_utills.webToNative.enableSwipeRefresh(a)};exports.enablePullToRefresh=enablePullToRefresh;var clearAppCache=function(a){isAndroidApp&&_utills.webToNative.clearWebViewCache(JSON.stringify({reload:a}))};exports.clearAppCache=clearAppCache;var shareFile=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null,b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:null,c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;isAndroidApp&&_utills.webToNative.shareFile(a,b,c)};exports.shareFile=shareFile;var closeApp=function(){isAndroidApp&&_utills.webToNative.closeApp(),isIosApp&&_utills.webToNativeIos.postMessage({action:"closeApp"})};exports.closeApp=closeApp;var showDateTimePicker=function(a){if(["ANDROID_APP"].includes(_utills.platform)){var b=a.callback,c=a.showDate,d=a.showTime;(0,_utills.registerCb)(function(a){var c=a.type;"DATE_TIME_PICKER"===c&&b&&b(a)}),isAndroidApp&&_utills.webToNative.pickDateTime(JSON.stringify({showDate:c,showTime:d}))}};exports.showDateTimePicker=showDateTimePicker;var printFunction=function(a){if(["ANDROID_APP"].includes(_utills.platform)){var b=a.type,c=void 0===b?"url":b,d=a.url,e=void 0===d?"":d;isAndroidApp&&_utills.webToNative.print(JSON.stringify({type:c,url:e}))}};exports.printFunction=printFunction;var nfcSupported=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.callback;(0,_utills.registerCb)(function(a){var c=a.type;"nfcSupported"===c&&b&&b(a)}),isAndroidApp&&_utills.webToNative.nfcSupported(),isIosApp&&_utills.webToNativeIos.postMessage({action:"nfcSupported"})}};exports.nfcSupported=nfcSupported;var loadOfferCard=function(a){["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&(isAndroidApp&&_utills.webToNative.showOfferCard(JSON.stringify(a)),a.data&&(a.data=JSON.stringify(a.data)),isIosApp&&_utills.webToNativeIos.postMessage(a))};exports.loadOfferCard=loadOfferCard;var addToSiri=function(a){["IOS_APP"].includes(_utills.platform)&&(a.data&&(a.data=JSON.stringify(a.data)),isIosApp&&_utills.webToNativeIos.postMessage(a))};exports.addToSiri=addToSiri;var appFirstLoad=function(){return new Promise(function(a,b){(0,_utills.registerCb)(function(c){var d=c.type;"firstCallWhenAppStarted"===d&&(c?a(c):b({err:"Error getting request"}))},{key:"firstCallWhenAppStarted"}),"ANDROID_APP"===_utills.platform?_utills.webToNative.firstCallWhenAppStarted():"IOS_APP"===_utills.platform?_utills.webToNativeIos.postMessage({action:"firstCallWhenAppStarted"}):b("This function will work in Native App Powered By WebToNative")})};exports.appFirstLoad=appFirstLoad;var forceUpdateCookies=function(){["ANDROID_APP"].includes(_utills.platform)&&isAndroidApp&&_utills.webToNative.forceUpdateCookies()};exports.forceUpdateCookies=forceUpdateCookies;var openAppSettingForPermission=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.callback,c=a.values;(0,_utills.registerCb)(function(a){var c=a.type,d=a.typeValue;"openAppSettingForPermission"===c&&b&&b(a)}),isAndroidApp&&_utills.webToNative.openAppSettingForPermission(c),isIosApp&&_utills.webToNativeIos.postMessage({action:"openAppSettingForPermission",values:c})}};exports.openAppSettingForPermission=openAppSettingForPermission;var showPermission=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.callback,c=a.permission,d=a.openAppSetting,e=void 0!==d&&d,f=a.alertDialogStyle;(0,_utills.registerCb)(function(a){var c=a.type,d=a.typeValue;("showPermission"===c||"showPermission"===d)&&b&&b(a)}),isAndroidApp&&_utills.webToNative.showPermission(JSON.stringify({permission:c,openAppSetting:e,alertDialogStyle:f})),isIosApp&&_utills.webToNativeIos.postMessage({action:"showPermission",permission:c,openAppSetting:e,alertDialogStyle:f})}};exports.showPermission=showPermission;var updateAppIcon=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.active,c=void 0!==b&&b,d=a.iconName,e=void 0===d?null:d;isAndroidApp&&_utills.webToNative.updateAppIcon(JSON.stringify({active:c,iconName:e})),isIosApp&&_utills.webToNativeIos.postMessage({action:"updateAppIcon",iconName:e,active:c})}};exports.updateAppIcon=updateAppIcon;var disableScreenshot=function(a){if(["IOS_APP"].includes(_utills.platform)){var b=a.ssKey;isIosApp&&_utills.webToNativeIos.postMessage({action:"disableScreenshotForPage",ssKey:void 0!==b&&b})}};exports.disableScreenshot=disableScreenshot;var customBackHandling=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.enable,c=void 0!==b&&b;isAndroidApp&&_utills.webToNative.customBackHandling(JSON.stringify({enable:c})),isIosApp&&_utills.webToNativeIos.postMessage({action:"customBackHandling",enable:c})}};exports.customBackHandling=customBackHandling;var getSafeArea=function(a){if(["IOS_APP"].includes(_utills.platform)){var b=a.callback;(0,_utills.registerCb)(function(a){var c=a.type;"getSafeArea"===c&&b&&b(a)}),isIosApp&&_utills.webToNativeIos.postMessage({action:"getSafeArea"})}};exports.getSafeArea=getSafeArea;var getAddOnStatus=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.callback,c=a.addOnName;(0,_utills.registerCb)(function(a){var c=a.type;"getAddOnStatus"===c&&b&&b(a)}),isAndroidApp&&_utills.webToNative.getAddOnStatus(JSON.stringify({addOnName:c})),isIosApp&&_utills.webToNativeIos.postMessage({action:"getAddOnStatus",addOnName:c})}};exports.getAddOnStatus=getAddOnStatus;var checkPermission=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.callback,c=a.permissionName;(0,_utills.registerCb)(function(a){var c=a.type;"checkPermission"===c&&b&&b(a)}),isAndroidApp&&_utills.webToNative.checkPermission(JSON.stringify(c)),isIosApp&&_utills.webToNativeIos.postMessage({action:"checkPermission",permissionName:c})}};exports.checkPermission=checkPermission;var setOrientation=function(a){if(["ANDROID_APP"].includes(_utills.platform)){var b=a.orientation,c=a.forceOrientation;isAndroidApp&&_utills.webToNative.setOrientation(JSON.stringify({orientation:b,forceOrientation:void 0!==c&&c}))}};exports.setOrientation=setOrientation;var hideNativeComponents=function(a){if(isAndroidORIosApp){var b=(a||{}).components;isAndroidApp&&_utills.webToNative.hideNativeComponents(JSON.stringify(a)),isIosApp&&_utills.webToNativeIos.postMessage({action:"hideNativeComponents",components:b})}};exports.hideNativeComponents=hideNativeComponents;var showNativeComponents=function(a){if(isAndroidORIosApp){var b=(a||{}).components;isAndroidApp&&_utills.webToNative.checkPermission(JSON.stringify(a)),isIosApp&&_utills.webToNativeIos.postMessage({action:"showNativeComponents",components:b})}};exports.showNativeComponents=showNativeComponents;var registerNotification=function(a){if(isAndroidORIosApp){var b=(a||{}).callback;(0,_utills.registerCb)(function(a){var c=a.type;"registerNotification"===c&&b&&b(a)}),isAndroidApp&&_utills.webToNative.registerNotification(),isIosApp&&_utills.webToNativeIos.postMessage({action:"registerNotification"})}};exports.registerNotification=registerNotification;var _default={isAndroidApp:isAndroidApp,isIosApp:isIosApp,hideSplashScreen:hideSplashScreen,statusBar:statusBar,deviceInfo:deviceInfo,showInAppReview:showInAppReview,shareLink:shareLink,platform:_utills.platform,isNativeApp:_utills.isNativeApp,isDeviceGPSEnabled:isDeviceGPSEnabled,openUrlInBrowser:openUrlInBrowser,enablePullToRefresh:enablePullToRefresh,shareFile:shareFile,clearAppCache:clearAppCache,closeApp:closeApp,showDateTimePicker:showDateTimePicker,downloadBlobFile:downloadBlobFile,customFileDownload:customFileDownload,printFunction:printFunction,loadOfferCard:loadOfferCard,appFirstLoad:appFirstLoad,addToSiri:addToSiri,showPermission:showPermission,forceUpdateCookies:forceUpdateCookies,updateAppIcon:updateAppIcon,disableScreenshot:disableScreenshot,getSafeArea:getSafeArea,getAddOnStatus:getAddOnStatus,setOrientation:setOrientation,checkPermission:checkPermission,openAppSettingForPermission:openAppSettingForPermission,customBackHandling:customBackHandling,hideNativeComponents:hideNativeComponents,showNativeComponents:showNativeComponents,registerNotification:registerNotification};exports["default"]=_default;
|
|
20
|
+
*/
|
|
21
|
+
var hideSplashScreen = function () {
|
|
22
|
+
utills_1.isNativeApp && utills_1.webToNative.hideSplashScreen && utills_1.webToNative.hideSplashScreen();
|
|
23
|
+
};
|
|
24
|
+
exports.hideSplashScreen = hideSplashScreen;
|
|
25
|
+
var statusBar = function (options) {
|
|
26
|
+
if (utills_1.isNativeApp) {
|
|
27
|
+
if (exports.isAndroidApp) {
|
|
28
|
+
utills_1.webToNative.statusBar && utills_1.webToNative.statusBar(JSON.stringify(options));
|
|
29
|
+
}
|
|
30
|
+
else if (exports.isIosApp) {
|
|
31
|
+
utills_1.webToNativeIos &&
|
|
32
|
+
utills_1.webToNativeIos.postMessage({
|
|
33
|
+
action: "statusBar",
|
|
34
|
+
color: options.color,
|
|
35
|
+
style: options.style,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.statusBar = statusBar;
|
|
41
|
+
var downloadFile = function (downloadUrl) {
|
|
42
|
+
if (utills_1.isNativeApp) {
|
|
43
|
+
if (exports.isAndroidApp) {
|
|
44
|
+
// Android implementation
|
|
45
|
+
}
|
|
46
|
+
else if (exports.isIosApp) {
|
|
47
|
+
utills_1.webToNativeIos &&
|
|
48
|
+
utills_1.webToNativeIos.postMessage({
|
|
49
|
+
action: "downloadFile",
|
|
50
|
+
downloadUrl: downloadUrl,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
exports.downloadFile = downloadFile;
|
|
56
|
+
var downloadBlobFile = function (_a) {
|
|
57
|
+
var fileName = _a.fileName, downloadUrl = _a.downloadUrl;
|
|
58
|
+
if (["IOS_APP"].includes(utills_1.platform)) {
|
|
59
|
+
exports.isIosApp &&
|
|
60
|
+
utills_1.webToNativeIos &&
|
|
61
|
+
utills_1.webToNativeIos.postMessage({
|
|
62
|
+
action: "downloadBlobFile",
|
|
63
|
+
fileName: fileName,
|
|
64
|
+
url: downloadUrl,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
exports.downloadBlobFile = downloadBlobFile;
|
|
69
|
+
var customFileDownload = function (_a) {
|
|
70
|
+
var downloadUrl = _a.downloadUrl, fileName = _a.fileName, isBlob = _a.isBlob, mimeType = _a.mimeType, cookies = _a.cookies, userAgent = _a.userAgent, openFileAfterDownload = _a.openFileAfterDownload;
|
|
71
|
+
if (["ANDROID_APP"].includes(utills_1.platform)) {
|
|
72
|
+
utills_1.platform === "ANDROID_APP" &&
|
|
73
|
+
utills_1.webToNative.downloadFile &&
|
|
74
|
+
utills_1.webToNative.downloadFile(JSON.stringify({
|
|
75
|
+
url: downloadUrl,
|
|
76
|
+
fileName: fileName,
|
|
77
|
+
isBlob: isBlob,
|
|
78
|
+
mimeType: mimeType,
|
|
79
|
+
cookies: cookies,
|
|
80
|
+
userAgent: userAgent,
|
|
81
|
+
openFileAfterDownload: openFileAfterDownload,
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
exports.customFileDownload = customFileDownload;
|
|
86
|
+
var deviceInfo = function () {
|
|
87
|
+
return new Promise(function (resolve, reject) {
|
|
88
|
+
(0, utills_1.registerCb)(function (results) {
|
|
89
|
+
if (results) {
|
|
90
|
+
resolve(results);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
reject({
|
|
94
|
+
err: "Error getting device info",
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}, {
|
|
98
|
+
key: "deviceInfo",
|
|
99
|
+
});
|
|
100
|
+
if (utills_1.platform === "ANDROID_APP") {
|
|
101
|
+
utills_1.webToNative.getDeviceInfo && utills_1.webToNative.getDeviceInfo();
|
|
102
|
+
}
|
|
103
|
+
else if (utills_1.platform === "IOS_APP") {
|
|
104
|
+
utills_1.webToNativeIos &&
|
|
105
|
+
utills_1.webToNativeIos.postMessage({
|
|
106
|
+
action: "deviceInfo",
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
reject("This function will work in Native App Powered By WebToNative");
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
exports.deviceInfo = deviceInfo;
|
|
115
|
+
var showInAppReview = function () {
|
|
116
|
+
utills_1.isNativeApp && utills_1.webToNative.showInAppReview && utills_1.webToNative.showInAppReview();
|
|
117
|
+
};
|
|
118
|
+
exports.showInAppReview = showInAppReview;
|
|
119
|
+
var isDeviceGPSEnabled = function (options) {
|
|
120
|
+
if (options === void 0) { options = {}; }
|
|
121
|
+
var callback = options.callback;
|
|
122
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
123
|
+
(0, utills_1.registerCb)(function (response) {
|
|
124
|
+
var type = response.type;
|
|
125
|
+
if (type === "isDeviceGPSEnabled") {
|
|
126
|
+
callback && callback(response);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
utills_1.platform === "ANDROID_APP" &&
|
|
130
|
+
utills_1.webToNative.isLocationServiceEnabled &&
|
|
131
|
+
utills_1.webToNative.isLocationServiceEnabled();
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
exports.isDeviceGPSEnabled = isDeviceGPSEnabled;
|
|
135
|
+
var shareLink = function (_a) {
|
|
136
|
+
var _b = _a.url, url = _b === void 0 ? "" : _b;
|
|
137
|
+
if (url) {
|
|
138
|
+
exports.isAndroidApp && utills_1.webToNative.openShareIntent && utills_1.webToNative.openShareIntent(url);
|
|
139
|
+
exports.isIosApp &&
|
|
140
|
+
utills_1.webToNativeIos &&
|
|
141
|
+
utills_1.webToNativeIos.postMessage({
|
|
142
|
+
action: "share",
|
|
143
|
+
url: url,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
throw "url is mandatory";
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
exports.shareLink = shareLink;
|
|
151
|
+
var openUrlInBrowser = function (url) {
|
|
152
|
+
if (url === void 0) { url = ""; }
|
|
153
|
+
if (url) {
|
|
154
|
+
exports.isAndroidApp && utills_1.webToNative.openUrlInBrowser && utills_1.webToNative.openUrlInBrowser(url);
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
throw "url is mandatory";
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
exports.openUrlInBrowser = openUrlInBrowser;
|
|
161
|
+
var enablePullToRefresh = function (status) {
|
|
162
|
+
exports.isAndroidApp && utills_1.webToNative.enableSwipeRefresh && utills_1.webToNative.enableSwipeRefresh(status);
|
|
163
|
+
};
|
|
164
|
+
exports.enablePullToRefresh = enablePullToRefresh;
|
|
165
|
+
var clearAppCache = function (reload) {
|
|
166
|
+
exports.isAndroidApp &&
|
|
167
|
+
utills_1.webToNative.clearWebViewCache &&
|
|
168
|
+
utills_1.webToNative.clearWebViewCache(JSON.stringify({ reload: reload }));
|
|
169
|
+
};
|
|
170
|
+
exports.clearAppCache = clearAppCache;
|
|
171
|
+
var shareFile = function (fileUrl, fileExtension, text) {
|
|
172
|
+
if (fileUrl === void 0) { fileUrl = null; }
|
|
173
|
+
if (fileExtension === void 0) { fileExtension = null; }
|
|
174
|
+
if (text === void 0) { text = null; }
|
|
175
|
+
exports.isAndroidApp && utills_1.webToNative.shareFile && utills_1.webToNative.shareFile(fileUrl, fileExtension, text);
|
|
176
|
+
};
|
|
177
|
+
exports.shareFile = shareFile;
|
|
178
|
+
var closeApp = function () {
|
|
179
|
+
exports.isAndroidApp && utills_1.webToNative.closeApp && utills_1.webToNative.closeApp();
|
|
180
|
+
exports.isIosApp &&
|
|
181
|
+
utills_1.webToNativeIos &&
|
|
182
|
+
utills_1.webToNativeIos.postMessage({
|
|
183
|
+
action: "closeApp",
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
exports.closeApp = closeApp;
|
|
187
|
+
var showDateTimePicker = function (options) {
|
|
188
|
+
if (["ANDROID_APP"].includes(utills_1.platform)) {
|
|
189
|
+
var callback_1 = options.callback, showDate = options.showDate, showTime = options.showTime;
|
|
190
|
+
(0, utills_1.registerCb)(function (response) {
|
|
191
|
+
var type = response.type;
|
|
192
|
+
if (type === "DATE_TIME_PICKER") {
|
|
193
|
+
callback_1 && callback_1(response);
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
exports.isAndroidApp &&
|
|
197
|
+
utills_1.webToNative.pickDateTime &&
|
|
198
|
+
utills_1.webToNative.pickDateTime(JSON.stringify({
|
|
199
|
+
showDate: showDate,
|
|
200
|
+
showTime: showTime,
|
|
201
|
+
}));
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
exports.showDateTimePicker = showDateTimePicker;
|
|
205
|
+
var printFunction = function (options) {
|
|
206
|
+
if (["ANDROID_APP"].includes(utills_1.platform)) {
|
|
207
|
+
var _a = options.type, type = _a === void 0 ? "url" : _a, _b = options.url, url = _b === void 0 ? "" : _b;
|
|
208
|
+
exports.isAndroidApp &&
|
|
209
|
+
utills_1.webToNative.print &&
|
|
210
|
+
utills_1.webToNative.print(JSON.stringify({
|
|
211
|
+
type: type,
|
|
212
|
+
url: url,
|
|
213
|
+
}));
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
exports.printFunction = printFunction;
|
|
217
|
+
var nfcSupported = function (options) {
|
|
218
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
219
|
+
var callback_2 = options.callback;
|
|
220
|
+
(0, utills_1.registerCb)(function (response) {
|
|
221
|
+
var type = response.type;
|
|
222
|
+
if (type === "nfcSupported") {
|
|
223
|
+
callback_2 && callback_2(response);
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
exports.isAndroidApp && utills_1.webToNative.nfcSupported && utills_1.webToNative.nfcSupported();
|
|
227
|
+
exports.isIosApp &&
|
|
228
|
+
utills_1.webToNativeIos &&
|
|
229
|
+
utills_1.webToNativeIos.postMessage({
|
|
230
|
+
action: "nfcSupported",
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
exports.nfcSupported = nfcSupported;
|
|
235
|
+
var loadOfferCard = function (options) {
|
|
236
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
237
|
+
exports.isAndroidApp && utills_1.webToNative.showOfferCard && utills_1.webToNative.showOfferCard(JSON.stringify(options));
|
|
238
|
+
if (options.data) {
|
|
239
|
+
options.data = JSON.stringify(options.data);
|
|
240
|
+
}
|
|
241
|
+
exports.isIosApp && utills_1.webToNativeIos && utills_1.webToNativeIos.postMessage(options);
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
exports.loadOfferCard = loadOfferCard;
|
|
245
|
+
var addToSiri = function (options) {
|
|
246
|
+
if (["IOS_APP"].includes(utills_1.platform)) {
|
|
247
|
+
if (options.data)
|
|
248
|
+
options.data = JSON.stringify(options.data);
|
|
249
|
+
exports.isIosApp && utills_1.webToNativeIos && utills_1.webToNativeIos.postMessage(options);
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
exports.addToSiri = addToSiri;
|
|
253
|
+
var appFirstLoad = function () {
|
|
254
|
+
return new Promise(function (resolve, reject) {
|
|
255
|
+
(0, utills_1.registerCb)(function (results) {
|
|
256
|
+
var type = results.type;
|
|
257
|
+
if (type === "firstCallWhenAppStarted") {
|
|
258
|
+
if (results) {
|
|
259
|
+
resolve(results);
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
reject({
|
|
263
|
+
err: "Error getting request",
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}, {
|
|
268
|
+
key: "firstCallWhenAppStarted",
|
|
269
|
+
});
|
|
270
|
+
if (utills_1.platform === "ANDROID_APP") {
|
|
271
|
+
utills_1.webToNative.firstCallWhenAppStarted && utills_1.webToNative.firstCallWhenAppStarted();
|
|
272
|
+
}
|
|
273
|
+
else if (utills_1.platform === "IOS_APP") {
|
|
274
|
+
utills_1.webToNativeIos &&
|
|
275
|
+
utills_1.webToNativeIos.postMessage({
|
|
276
|
+
action: "firstCallWhenAppStarted",
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
reject("This function will work in Native App Powered By WebToNative");
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
};
|
|
284
|
+
exports.appFirstLoad = appFirstLoad;
|
|
285
|
+
var forceUpdateCookies = function () {
|
|
286
|
+
if (["ANDROID_APP"].includes(utills_1.platform)) {
|
|
287
|
+
exports.isAndroidApp && utills_1.webToNative.forceUpdateCookies && utills_1.webToNative.forceUpdateCookies();
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
exports.forceUpdateCookies = forceUpdateCookies;
|
|
291
|
+
var openAppSettingForPermission = function (options) {
|
|
292
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
293
|
+
var callback_3 = options.callback, values = options.values;
|
|
294
|
+
(0, utills_1.registerCb)(function (response) {
|
|
295
|
+
var type = response.type, typeValue = response.typeValue;
|
|
296
|
+
if (type === "openAppSettingForPermission") {
|
|
297
|
+
callback_3 && callback_3(response);
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
exports.isAndroidApp &&
|
|
301
|
+
utills_1.webToNative.openAppSettingForPermission &&
|
|
302
|
+
utills_1.webToNative.openAppSettingForPermission(values);
|
|
303
|
+
exports.isIosApp &&
|
|
304
|
+
utills_1.webToNativeIos &&
|
|
305
|
+
utills_1.webToNativeIos.postMessage({
|
|
306
|
+
action: "openAppSettingForPermission",
|
|
307
|
+
values: values,
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
exports.openAppSettingForPermission = openAppSettingForPermission;
|
|
312
|
+
var showPermission = function (options) {
|
|
313
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
314
|
+
var callback_4 = options.callback, permission = options.permission, _a = options.openAppSetting, openAppSetting = _a === void 0 ? false : _a, alertDialogStyle = options.alertDialogStyle;
|
|
315
|
+
(0, utills_1.registerCb)(function (response) {
|
|
316
|
+
var type = response.type, typeValue = response.typeValue;
|
|
317
|
+
if (type === "showPermission" || typeValue === "showPermission") {
|
|
318
|
+
callback_4 && callback_4(response);
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
exports.isAndroidApp &&
|
|
322
|
+
utills_1.webToNative.showPermission &&
|
|
323
|
+
utills_1.webToNative.showPermission(JSON.stringify({
|
|
324
|
+
permission: permission,
|
|
325
|
+
openAppSetting: openAppSetting,
|
|
326
|
+
alertDialogStyle: alertDialogStyle,
|
|
327
|
+
}));
|
|
328
|
+
exports.isIosApp &&
|
|
329
|
+
utills_1.webToNativeIos &&
|
|
330
|
+
utills_1.webToNativeIos.postMessage({
|
|
331
|
+
action: "showPermission",
|
|
332
|
+
permission: permission,
|
|
333
|
+
openAppSetting: openAppSetting,
|
|
334
|
+
alertDialogStyle: alertDialogStyle,
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
exports.showPermission = showPermission;
|
|
339
|
+
var updateAppIcon = function (options) {
|
|
340
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
341
|
+
var _a = options.active, active = _a === void 0 ? false : _a, _b = options.iconName, iconName = _b === void 0 ? null : _b;
|
|
342
|
+
exports.isAndroidApp &&
|
|
343
|
+
utills_1.webToNative.updateAppIcon &&
|
|
344
|
+
utills_1.webToNative.updateAppIcon(JSON.stringify({
|
|
345
|
+
active: active,
|
|
346
|
+
iconName: iconName,
|
|
347
|
+
}));
|
|
348
|
+
exports.isIosApp &&
|
|
349
|
+
utills_1.webToNativeIos &&
|
|
350
|
+
utills_1.webToNativeIos.postMessage({
|
|
351
|
+
action: "updateAppIcon",
|
|
352
|
+
iconName: iconName,
|
|
353
|
+
active: active,
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
exports.updateAppIcon = updateAppIcon;
|
|
358
|
+
var disableScreenshot = function (options) {
|
|
359
|
+
if (["IOS_APP"].includes(utills_1.platform)) {
|
|
360
|
+
var _a = options.ssKey, ssKey = _a === void 0 ? false : _a;
|
|
361
|
+
exports.isIosApp &&
|
|
362
|
+
utills_1.webToNativeIos &&
|
|
363
|
+
utills_1.webToNativeIos.postMessage({
|
|
364
|
+
action: "disableScreenshotForPage",
|
|
365
|
+
ssKey: ssKey,
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
exports.disableScreenshot = disableScreenshot;
|
|
370
|
+
var customBackHandling = function (options) {
|
|
371
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
372
|
+
var _a = options.enable, enable = _a === void 0 ? false : _a;
|
|
373
|
+
exports.isAndroidApp &&
|
|
374
|
+
utills_1.webToNative.customBackHandling &&
|
|
375
|
+
utills_1.webToNative.customBackHandling(JSON.stringify({ enable: enable }));
|
|
376
|
+
exports.isIosApp &&
|
|
377
|
+
utills_1.webToNativeIos &&
|
|
378
|
+
(utills_1.webToNativeIos === null || utills_1.webToNativeIos === void 0 ? void 0 : utills_1.webToNativeIos.postMessage({
|
|
379
|
+
action: "customBackHandling",
|
|
380
|
+
enable: enable,
|
|
381
|
+
}));
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
exports.customBackHandling = customBackHandling;
|
|
385
|
+
var getSafeArea = function (options) {
|
|
386
|
+
if (["IOS_APP"].includes(utills_1.platform)) {
|
|
387
|
+
var callback_5 = options.callback;
|
|
388
|
+
(0, utills_1.registerCb)(function (response) {
|
|
389
|
+
var type = response.type;
|
|
390
|
+
if (type === "getSafeArea") {
|
|
391
|
+
callback_5 && callback_5(response);
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
exports.isIosApp &&
|
|
395
|
+
utills_1.webToNativeIos &&
|
|
396
|
+
utills_1.webToNativeIos.postMessage({
|
|
397
|
+
action: "getSafeArea",
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
};
|
|
401
|
+
exports.getSafeArea = getSafeArea;
|
|
402
|
+
var getAddOnStatus = function (options) {
|
|
403
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
404
|
+
var callback_6 = options.callback, addOnName = options.addOnName;
|
|
405
|
+
(0, utills_1.registerCb)(function (response) {
|
|
406
|
+
var type = response.type;
|
|
407
|
+
if (type === "getAddOnStatus") {
|
|
408
|
+
callback_6 && callback_6(response);
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
exports.isAndroidApp &&
|
|
412
|
+
utills_1.webToNative.getAddOnStatus &&
|
|
413
|
+
utills_1.webToNative.getAddOnStatus(JSON.stringify({
|
|
414
|
+
addOnName: addOnName,
|
|
415
|
+
}));
|
|
416
|
+
exports.isIosApp &&
|
|
417
|
+
utills_1.webToNativeIos &&
|
|
418
|
+
utills_1.webToNativeIos.postMessage({
|
|
419
|
+
action: "getAddOnStatus",
|
|
420
|
+
addOnName: addOnName,
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
};
|
|
424
|
+
exports.getAddOnStatus = getAddOnStatus;
|
|
425
|
+
var checkPermission = function (options) {
|
|
426
|
+
if (["ANDROID_APP", "IOS_APP"].includes(utills_1.platform)) {
|
|
427
|
+
var callback_7 = options.callback, permissionName = options.permissionName;
|
|
428
|
+
(0, utills_1.registerCb)(function (response) {
|
|
429
|
+
var type = response.type;
|
|
430
|
+
if (type === "checkPermission") {
|
|
431
|
+
callback_7 && callback_7(response);
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
exports.isAndroidApp &&
|
|
435
|
+
utills_1.webToNative.checkPermission &&
|
|
436
|
+
utills_1.webToNative.checkPermission(JSON.stringify(permissionName));
|
|
437
|
+
exports.isIosApp &&
|
|
438
|
+
utills_1.webToNativeIos &&
|
|
439
|
+
utills_1.webToNativeIos.postMessage({
|
|
440
|
+
action: "checkPermission",
|
|
441
|
+
permissionName: permissionName,
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
exports.checkPermission = checkPermission;
|
|
446
|
+
var setOrientation = function (options) {
|
|
447
|
+
if (["ANDROID_APP"].includes(utills_1.platform)) {
|
|
448
|
+
var orientation_1 = options.orientation, _a = options.forceOrientation, forceOrientation = _a === void 0 ? false : _a;
|
|
449
|
+
exports.isAndroidApp &&
|
|
450
|
+
utills_1.webToNative.setOrientation &&
|
|
451
|
+
utills_1.webToNative.setOrientation(JSON.stringify({
|
|
452
|
+
orientation: orientation_1,
|
|
453
|
+
forceOrientation: forceOrientation,
|
|
454
|
+
}));
|
|
455
|
+
}
|
|
456
|
+
};
|
|
457
|
+
exports.setOrientation = setOrientation;
|
|
458
|
+
var hideNativeComponents = function (options) {
|
|
459
|
+
if (exports.isAndroidORIosApp) {
|
|
460
|
+
var components = (options || {}).components;
|
|
461
|
+
exports.isAndroidApp &&
|
|
462
|
+
utills_1.webToNative.hideNativeComponents &&
|
|
463
|
+
utills_1.webToNative.hideNativeComponents(JSON.stringify(options));
|
|
464
|
+
exports.isIosApp &&
|
|
465
|
+
utills_1.webToNativeIos &&
|
|
466
|
+
utills_1.webToNativeIos.postMessage({
|
|
467
|
+
action: "hideNativeComponents",
|
|
468
|
+
components: components,
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
};
|
|
472
|
+
exports.hideNativeComponents = hideNativeComponents;
|
|
473
|
+
var showNativeComponents = function (options) {
|
|
474
|
+
if (exports.isAndroidORIosApp) {
|
|
475
|
+
var components = (options || {}).components;
|
|
476
|
+
exports.isAndroidApp &&
|
|
477
|
+
utills_1.webToNative.showNativeComponents &&
|
|
478
|
+
utills_1.webToNative.showNativeComponents(JSON.stringify(options));
|
|
479
|
+
exports.isIosApp &&
|
|
480
|
+
utills_1.webToNativeIos &&
|
|
481
|
+
utills_1.webToNativeIos.postMessage({
|
|
482
|
+
action: "showNativeComponents",
|
|
483
|
+
components: components,
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
};
|
|
487
|
+
exports.showNativeComponents = showNativeComponents;
|
|
488
|
+
var registerNotification = function (options) {
|
|
489
|
+
if (exports.isAndroidORIosApp) {
|
|
490
|
+
var callback_8 = (options || {}).callback;
|
|
491
|
+
(0, utills_1.registerCb)(function (response) {
|
|
492
|
+
var type = response.type;
|
|
493
|
+
if (type === "registerNotification") {
|
|
494
|
+
callback_8 && callback_8(response);
|
|
495
|
+
}
|
|
496
|
+
});
|
|
497
|
+
exports.isAndroidApp && utills_1.webToNative.registerNotification && utills_1.webToNative.registerNotification();
|
|
498
|
+
exports.isIosApp &&
|
|
499
|
+
utills_1.webToNativeIos &&
|
|
500
|
+
utills_1.webToNativeIos.postMessage({
|
|
501
|
+
action: "registerNotification",
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
};
|
|
505
|
+
exports.registerNotification = registerNotification;
|
|
506
|
+
exports.default = {
|
|
507
|
+
isAndroidApp: exports.isAndroidApp,
|
|
508
|
+
isIosApp: exports.isIosApp,
|
|
509
|
+
hideSplashScreen: exports.hideSplashScreen,
|
|
510
|
+
statusBar: exports.statusBar,
|
|
511
|
+
deviceInfo: exports.deviceInfo,
|
|
512
|
+
showInAppReview: exports.showInAppReview,
|
|
513
|
+
shareLink: exports.shareLink,
|
|
514
|
+
platform: utills_1.platform,
|
|
515
|
+
isNativeApp: utills_1.isNativeApp,
|
|
516
|
+
isDeviceGPSEnabled: exports.isDeviceGPSEnabled,
|
|
517
|
+
openUrlInBrowser: exports.openUrlInBrowser,
|
|
518
|
+
enablePullToRefresh: exports.enablePullToRefresh,
|
|
519
|
+
shareFile: exports.shareFile,
|
|
520
|
+
clearAppCache: exports.clearAppCache,
|
|
521
|
+
closeApp: exports.closeApp,
|
|
522
|
+
showDateTimePicker: exports.showDateTimePicker,
|
|
523
|
+
downloadBlobFile: exports.downloadBlobFile,
|
|
524
|
+
customFileDownload: exports.customFileDownload,
|
|
525
|
+
printFunction: exports.printFunction,
|
|
526
|
+
loadOfferCard: exports.loadOfferCard,
|
|
527
|
+
appFirstLoad: exports.appFirstLoad,
|
|
528
|
+
addToSiri: exports.addToSiri,
|
|
529
|
+
showPermission: exports.showPermission,
|
|
530
|
+
forceUpdateCookies: exports.forceUpdateCookies,
|
|
531
|
+
updateAppIcon: exports.updateAppIcon,
|
|
532
|
+
disableScreenshot: exports.disableScreenshot,
|
|
533
|
+
getSafeArea: exports.getSafeArea,
|
|
534
|
+
getAddOnStatus: exports.getAddOnStatus,
|
|
535
|
+
setOrientation: exports.setOrientation,
|
|
536
|
+
checkPermission: exports.checkPermission,
|
|
537
|
+
openAppSettingForPermission: exports.openAppSettingForPermission,
|
|
538
|
+
customBackHandling: exports.customBackHandling,
|
|
539
|
+
hideNativeComponents: exports.hideNativeComponents,
|
|
540
|
+
showNativeComponents: exports.showNativeComponents,
|
|
541
|
+
registerNotification: exports.registerNotification,
|
|
542
|
+
};
|