File tree Expand file tree Collapse file tree 2 files changed +18
-10
lines changed Expand file tree Collapse file tree 2 files changed +18
-10
lines changed Original file line number Diff line number Diff line change 1
1
<br />
2
+ <br />
2
3
<p align =" center " >
3
4
<a href =" https://uiwjs.github.io/react-native-wechat/ " >
4
5
<img src="https://user-images.githubusercontent.com/1680273/89100258-46cf6a00-d428-11ea-96dc-8b07a0ee277c.png" height="100" />
@@ -88,6 +89,6 @@ npx create-react-native-module --package-identifier com.uiwjs.react.wechat --obj
88
89
89
90
## 相关连接
90
91
91
- - [ 微信( SDK) :iOS SDK v1.8.7.1] ( https://developers.weixin.qq.com/doc/oplatform/Downloads/iOS_Resource.html )
92
- - [ 微信( SDK) :iOS 接入指南] ( https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Access_Guide/iOS.html )
92
+ - [ 微信( SDK) :iOS SDK v1.8.7.1] ( https://developers.weixin.qq.com/doc/oplatform/Downloads/iOS_Resource.html )
93
+ - [ 微信( SDK) :iOS 接入指南] ( https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Access_Guide/iOS.html )
93
94
- [ @uiw/react-native-alipay ] ( https://github.com/uiwjs/react-native-alipay ) 支付宝支付。
Original file line number Diff line number Diff line change @@ -4,23 +4,30 @@ import Wechat from '@uiw/react-native-wechat';
4
4
5
5
export default class App extends Component {
6
6
state = {
7
- message : '--'
7
+ isInstall : false ,
8
+ isWXAppSupportApi : false ,
8
9
} ;
9
10
async componentDidMount ( ) {
10
11
const isInstall = await Wechat . isWXAppInstalled ( ) ;
11
- console . log ( ':isInstall:' , isInstall ) ;
12
- // RNWechat.sampleMethod('Testing', 123, (message) => {
13
- // this.setState({
14
- // message
15
- // });
16
- // });
12
+ const isWXAppSupportApi = await Wechat . isWXAppSupportApi ( ) ;
13
+ this . setState ( {
14
+ isInstall, isWXAppSupportApi
15
+ } ) ;
17
16
}
18
17
render ( ) {
18
+ const { isInstall, isWXAppSupportApi } = this . state ;
19
19
return (
20
20
< SafeAreaView style = { { flex : 1 } } >
21
21
< View style = { styles . container } >
22
22
< Text style = { styles . welcome } > ☆Wechat Example☆</ Text >
23
- < Text style = { styles . instructions } > { this . state . message } </ Text >
23
+ < Text >
24
+ < Text style = { styles . instructions } >
25
+ < Text style = { { color : isInstall ? 'green' : 'red' } } > { isInstall ? '有' : '没有' } </ Text > 安装微信,
26
+ </ Text >
27
+ < Text style = { styles . instructions } >
28
+ 当前微信的版本< Text style = { { color : isWXAppSupportApi ? 'green' : 'red' } } > { isWXAppSupportApi ? '支持' : '不支持' } </ Text > OpenApi
29
+ </ Text >
30
+ </ Text >
24
31
</ View >
25
32
</ SafeAreaView >
26
33
) ;
You can’t perform that action at this time.
0 commit comments