chore: Update example.
This commit is contained in:
@@ -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
|
||||
|
||||
## 相关连接
|
||||
|
||||
- [微信(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)
|
||||
- [微信(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) 支付宝支付。
|
||||
|
@@ -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>
|
||||
);
|
||||
|
Reference in New Issue
Block a user