提交 9a13715e 编写于 作者: 雪洛's avatar 雪洛

fix: API兼容性检查

上级 3e9f229b
// 不支持的 API 列表
const todos = [
'saveImageToPhotosAlbum',
'getRecorderManager',
'getBackgroundAudioManager',
'createInnerAudioContext',
'createVideoContext',
'createCameraContext',
'createLivePlayerContext',
'openDocument',
'onMemoryWarning',
'startAccelerometer',
'startCompass',
'addPhoneContact',
'authorize',
'chooseAddress',
'chooseInvoiceTitle',
'addTemplate',
'deleteTemplate',
......@@ -25,8 +22,7 @@ const todos = [
'getExtConfig',
'getExtConfigSync',
'onWindowResize',
'offWindowResize',
'saveVideoToPhotosAlbum'
'offWindowResize'
]
// 存在兼容性的 API 列表
......@@ -45,7 +41,11 @@ const canIUses = [
'createIntersectionObserver',
'getUpdateManager',
'setBackgroundColor',
'setBackgroundTextStyle'
'setBackgroundTextStyle',
'checkIsSupportSoterAuthentication',
'startSoterAuthentication',
'checkIsSoterEnrolledInDevice',
'openDocument'
]
function _handleNetworkInfo (result) {
......@@ -402,6 +402,29 @@ const protocols = { // 需要做转换的 API 列表
},
hideHomeButton: {
name: 'hideBackHome'
},
saveImageToPhotosAlbum: {
name: 'saveImage',
args: {
filePath: 'url'
}
},
saveVideoToPhotosAlbum: {
args: {
filePath: 'src'
}
},
chooseAddress: {
name: 'getAddress',
returnValue (result) {
let info = result.result || {}
result.userName = info.fullname
result.provinceName = info.prov
result.cityName = info.city
result.detailInfo = info.address
result.telNumber = info.mobilePhone
result.errMsg = result.resultStatus
}
}
}
......
......@@ -3,11 +3,6 @@ export const protocols = {
previewImage
}
export const todos = [
'createLivePlayerContext',
'createLivePusherContext',
'loadFontFace',
'onMemoryWarning',
'onNetworkStatusChange',
'startBeaconDiscovery',
'stopBeaconDiscovery',
'getBeacons',
......@@ -27,10 +22,7 @@ export const todos = [
'setWifiList',
'onWifiConnected',
'getConnectedWifi',
'setNavigationBarColor',
'setTopBarText',
'getExtConfig',
'getExtConfigSync',
'getPhoneNumber',
'chooseAddress',
'addCard',
......@@ -40,10 +32,7 @@ export const todos = [
'chooseInvoiceTitle',
'checkIsSupportSoterAuthentication',
'startSoterAuthentication',
'checkIsSoterEnrolledInDevice',
'reportMonitor',
'getLogManager',
'reportAnalytics',
'checkIsSoterEnrolledInDevice',
'vibrate'
]
export const canIUses = [
......@@ -69,5 +58,16 @@ export const canIUses = [
'onSocketClose',
'openDocument',
'updateShareMenu',
'getShareInfo'
'getShareInfo',
'createLivePlayerContext',
'createLivePusherContext',
'setNavigationBarColor',
'loadFontFace',
'onMemoryWarning',
'onNetworkStatusChange',
'getExtConfig',
'getExtConfigSync',
'reportMonitor',
'getLogManager',
'reportAnalytics'
]
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册