Skip to content

Commit b3a4a32

Browse files
committed
chore: Update example.
1 parent ae9cf92 commit b3a4a32

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<br />
2+
<br />
23
<p align="center">
34
<a href="https://uiwjs.github.io/react-native-wechat/">
45
<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
8889

8990
## 相关连接
9091

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)
9394
- [@uiw/react-native-alipay](https://github.com/uiwjs/react-native-alipay) 支付宝支付。

example/App.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,30 @@ import Wechat from '@uiw/react-native-wechat';
44

55
export default class App extends Component {
66
state = {
7-
message: '--'
7+
isInstall: false,
8+
isWXAppSupportApi: false,
89
};
910
async componentDidMount() {
1011
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+
});
1716
}
1817
render() {
18+
const { isInstall, isWXAppSupportApi } = this.state;
1919
return (
2020
<SafeAreaView style={{ flex: 1 }}>
2121
<View style={styles.container}>
2222
<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>
2431
</View>
2532
</SafeAreaView>
2633
);

0 commit comments

Comments
 (0)