1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

chore: Update example.

This commit is contained in:
jaywcjlove
2020-08-01 19:59:12 +08:00
parent ae9cf92755
commit b3a4a328cc
2 changed files with 18 additions and 10 deletions

View File

@@ -1,4 +1,5 @@
<br />
<br />
<p align="center">
<a href="https://uiwjs.github.io/react-native-wechat/">
<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
## 相关连接
- [微信SDKiOS SDK v1.8.7.1](https://developers.weixin.qq.com/doc/oplatform/Downloads/iOS_Resource.html)
- [微信SDKiOS 接入指南](https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Access_Guide/iOS.html)
- [微信(SDK)iOS SDK v1.8.7.1](https://developers.weixin.qq.com/doc/oplatform/Downloads/iOS_Resource.html)
- [微信(SDK)iOS 接入指南](https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Access_Guide/iOS.html)
- [@uiw/react-native-alipay](https://github.com/uiwjs/react-native-alipay) 支付宝支付。

View File

@@ -4,23 +4,30 @@ import Wechat from '@uiw/react-native-wechat';
export default class App extends Component {
state = {
message: '--'
isInstall: false,
isWXAppSupportApi: false,
};
async componentDidMount() {
const isInstall = await Wechat.isWXAppInstalled();
console.log(':isInstall:', isInstall);
// RNWechat.sampleMethod('Testing', 123, (message) => {
// this.setState({
// message
// });
// });
const isWXAppSupportApi = await Wechat.isWXAppSupportApi();
this.setState({
isInstall, isWXAppSupportApi
});
}
render() {
const { isInstall, isWXAppSupportApi } = this.state;
return (
<SafeAreaView style={{ flex: 1 }}>
<View style={styles.container}>
<Text style={styles.welcome}>Wechat Example</Text>
<Text style={styles.instructions}>{this.state.message}</Text>
<Text>
<Text style={styles.instructions}>
<Text style={{color: isInstall ? 'green' : 'red'}}>{isInstall ? '有' : '没有'}</Text>
</Text>
<Text style={styles.instructions}>
当前微信的版本<Text style={{color: isWXAppSupportApi ? 'green' : 'red'}}>{isWXAppSupportApi ? '支持' : '不支持'}</Text> OpenApi
</Text>
</Text>
</View>
</SafeAreaView>
);