@ccos/ccsdk-lite 1.0.1 → 1.0.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/dist/bundle.js +7 -6
- package/dist/index.d.ts +2 -2
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -80,13 +80,14 @@ function unsetAppCommandCallback() {
|
|
|
80
80
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
81
81
|
let persistentCallbackId = []; // 持久化 callback-id 列表
|
|
82
82
|
function nativeCall(funcName, callbackId, params) {
|
|
83
|
-
if (window['
|
|
83
|
+
if (window['_liteNativeApi']) {
|
|
84
|
+
// 运行于 android 浏览器webview
|
|
84
85
|
var object1 = {
|
|
85
86
|
func: funcName,
|
|
86
87
|
id: callbackId,
|
|
87
88
|
params: params || {}
|
|
88
89
|
};
|
|
89
|
-
window['
|
|
90
|
+
window['_liteNativeApi'].exec(JSON.stringify(object1));
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
function nativeRequest(funcName, params, persistent, persistentIdName, persistentCallback) {
|
|
@@ -989,8 +990,8 @@ window['apkNativeCall'] = function apkNativeCall(str) {
|
|
|
989
990
|
}
|
|
990
991
|
}
|
|
991
992
|
};
|
|
992
|
-
function
|
|
993
|
-
return window['
|
|
993
|
+
function isRunInAppBrowser() {
|
|
994
|
+
return window['_liteNativeApi'] ? true : false;
|
|
994
995
|
}
|
|
995
996
|
var index = {
|
|
996
997
|
network,
|
|
@@ -1000,7 +1001,7 @@ var index = {
|
|
|
1000
1001
|
androidView,
|
|
1001
1002
|
audio,
|
|
1002
1003
|
file,
|
|
1003
|
-
|
|
1004
|
+
isRunInAppBrowser
|
|
1004
1005
|
};
|
|
1005
1006
|
|
|
1006
|
-
export { index as default,
|
|
1007
|
+
export { index as default, isRunInAppBrowser, setAppCommandCallback, unsetAppCommandCallback };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { setAppCommandCallback, unsetAppCommandCallback } from './core';
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function isRunInAppBrowser(): boolean;
|
|
3
3
|
declare const _default: {
|
|
4
4
|
network: {
|
|
5
5
|
simpleHttpRequest: typeof import("./network").simpleHttpRequest;
|
|
@@ -122,6 +122,6 @@ declare const _default: {
|
|
|
122
122
|
setLastModified: typeof import("./file").setLastModified;
|
|
123
123
|
list: typeof import("./file").list;
|
|
124
124
|
};
|
|
125
|
-
|
|
125
|
+
isRunInAppBrowser: typeof isRunInAppBrowser;
|
|
126
126
|
};
|
|
127
127
|
export default _default;
|