doc: Update README.md
This commit is contained in:
parent
b8b5b3e6e5
commit
cdc5ca58d9
@ -53,6 +53,8 @@ alipay_sdk=alipay-sdk-java-dynamicVersionNo&app_id=xxxxxxxxxxxxxxxx&biz_content=
|
||||
|
||||
### 支付宝返回应用 iOS 设置
|
||||
|
||||
> ⚠️ 如果用户从 `支付宝App` 跳转到 `商家APP`,是通过系统功能切换,而不是通过 `支付宝APP` 功能键返回 `商家APP`,回调函数是不起作用的,可通过 [`AppState.addEventListener`](https://github.com/uiwjs/react-native-uiwjs-alipay/blob/b8b5b3e6e53bb23d1503cd9c565ad8f2132e2404/example/App.js#L6-L24) 监听事件来请求后台 API,来优化这一用户体验。
|
||||
|
||||
1. 在代码中设置支付宝 `URL Schemes`,下面实例为 `ap2021001172656340` 为定义的 `scheme`
|
||||
|
||||
```js
|
||||
|
@ -10,10 +10,10 @@ export default class App extends Component {
|
||||
componentWillUnmount(){
|
||||
AppState.removeEventListener('change', this._handleAppStateChange)
|
||||
}
|
||||
// 2020-07-08 20:56:14.081 [info][tid:com.facebook.react.JavaScript] 'nextAppState:', 'inactive'
|
||||
// 2020-07-08 20:56:14.947 [info][tid:com.facebook.react.JavaScript] 'nextAppState:', 'background'
|
||||
// 2020-07-08 20:56:42.580 [info][tid:com.facebook.react.JavaScript] 'nextAppState:', 'active'
|
||||
// 2020-07-08 20:56:42.633 [info][tid:com.facebook.react.JavaScript] 'nextAppState:res:', null
|
||||
// [info][tid:com.facebook.react.JavaScript] 'nextAppState:', 'inactive'
|
||||
// [info][tid:com.facebook.react.JavaScript] 'nextAppState:', 'background'
|
||||
// [info][tid:com.facebook.react.JavaScript] 'nextAppState:', 'active'
|
||||
// [info][tid:com.facebook.react.JavaScript] 'nextAppState:res:', null
|
||||
_handleAppStateChange = (nextAppState) => {
|
||||
console.log('nextAppState:', nextAppState)
|
||||
if(nextAppState==='active'){
|
||||
|
Loading…
Reference in New Issue
Block a user