-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1495 from didi/feat-react-template-doc
Feat react template doc
- Loading branch information
Showing
5 changed files
with
1,388 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
# API支持列表 | ||
|
||
mpx转RN的对标微信api目前支持及部分的api转换,目前支持的能力可以参考下表: | ||
|
||
| 支持方法 | | ||
|------------------------| | ||
| getSystemInfo | | ||
| getSystemInfoSync | | ||
| getDeviceInfo | | ||
| getWindowInfo | | ||
| request | | ||
| setStorage | | ||
| removeStorage | | ||
| removeStorageSync | | ||
| getStorage | | ||
| getStorageInfo | | ||
| clearStorage | | ||
| clearStorageSync | | ||
| setClipboardData | | ||
| getClipboardData | | ||
| makePhoneCall | | ||
| onWindowResize | | ||
| offWindowResize | | ||
| arrayBufferToBase64 | | ||
| base64ToArrayBuffer | | ||
| connectSocket | | ||
| getNetworkType | | ||
| onNetworkStatusChange | | ||
| offNetworkStatusChange | | ||
|
||
# 使用说明 | ||
|
||
对于一些api-proxy中没有提供的能力,用户可以搭配mpx对象方式传入custom使用即可示例如下: | ||
|
||
```js | ||
import mpx from '@mpxjs/core' | ||
import apiProxy from '@mpxjs/api-proxy' | ||
import { showModal } from '@test/showModal' | ||
|
||
mpx.use(apiProxy, { | ||
custom: { | ||
ios: { | ||
showModal | ||
}, | ||
android: { | ||
showModal | ||
} | ||
} | ||
}) | ||
|
||
mpx.showModal({ | ||
title: '标题', | ||
content: '这是一个弹窗', | ||
success (res) { | ||
console.log('弹框展示成功') | ||
} | ||
}) | ||
``` | ||
|
||
# API抹平差异详情 | ||
|
||
对于一些微信独有的返回结果,或者RN目前不能支持的入参/返回结果,在下面会有详细说明: | ||
|
||
### getSystemInfo/getSystemInfoSync | ||
|
||
| 不支持返回值 | | ||
|------------------------| | ||
| language | | ||
| version | | ||
| SDKVersion | | ||
| benchmarkLevel | | ||
| albumAuthorized | | ||
| cameraAuthorized | | ||
| locationAuthorized | | ||
| microphoneAuthorized | | ||
| notificationAuthorized | | ||
| phoneCalendarAuthorized | | ||
| host | | ||
| enableDebug | | ||
| notificationAlertAuthorized | | ||
| notificationBadgeAuthorized | | ||
| notificationSoundAuthorized | | ||
| bluetoothEnabled | | ||
| locationEnabled | | ||
| wifiEnabled | | ||
| locationReducedAccuracy | | ||
| theme | | ||
|
||
### getDeviceInfo | ||
|
||
| 不支持返回值 | | ||
|------------------------| | ||
| benchmarkLevel | | ||
| abi | | ||
| cpuType | | ||
|
||
### getWindowInfo | ||
|
||
| 不支持返回值 | | ||
|------------------------| | ||
| screenTop | | ||
|
||
### request | ||
|
||
| 不支持入参 | | ||
|-----------| | ||
| useHighPerformanceMode | | ||
| enableHttp2 | | ||
| enableProfile | | ||
| enableQuic | | ||
| enableCache | | ||
| enableHttpDNS | | ||
| httpDNSServiceId | | ||
| enableChunked | | ||
| forceCellularNetwork | | ||
| redirect | | ||
|
||
|
||
| 不支持返回值 | | ||
|------------------------| | ||
| cookies | | ||
| profile | | ||
| exception | | ||
|
||
### setStorage/getStorage | ||
|
||
| 不支持入参 | | ||
|-----------| | ||
| encrypt | | ||
|
||
### getStorageInfo | ||
|
||
| 不支持返回值 | | ||
|-----------| | ||
| currentSize | | ||
| limitSize | | ||
|
||
### connectSocket | ||
|
||
| 不支持入参 | | ||
|-----------| | ||
| tcpNoDelay | | ||
| perMessageDeflate | | ||
| timeout | | ||
| forceCellularNetwork | | ||
|
||
### getNetworkType | ||
|
||
| 不支持返回值 | | ||
|----------------------| | ||
| signalStrength | | ||
| hasSystemProxy | |
Oops, something went wrong.