chore: Update example.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
<br />
|
<br />
|
||||||
|
<br />
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://uiwjs.github.io/react-native-wechat/">
|
<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" />
|
<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 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 接入指南](https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Access_Guide/iOS.html)
|
||||||
- [@uiw/react-native-alipay](https://github.com/uiwjs/react-native-alipay) 支付宝支付。
|
- [@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 {
|
export default class App extends Component {
|
||||||
state = {
|
state = {
|
||||||
message: '--'
|
isInstall: false,
|
||||||
|
isWXAppSupportApi: false,
|
||||||
};
|
};
|
||||||
async componentDidMount() {
|
async componentDidMount() {
|
||||||
const isInstall = await Wechat.isWXAppInstalled();
|
const isInstall = await Wechat.isWXAppInstalled();
|
||||||
console.log(':isInstall:', isInstall);
|
const isWXAppSupportApi = await Wechat.isWXAppSupportApi();
|
||||||
// RNWechat.sampleMethod('Testing', 123, (message) => {
|
this.setState({
|
||||||
// this.setState({
|
isInstall, isWXAppSupportApi
|
||||||
// message
|
});
|
||||||
// });
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
|
const { isInstall, isWXAppSupportApi } = this.state;
|
||||||
return (
|
return (
|
||||||
<SafeAreaView style={{ flex: 1 }}>
|
<SafeAreaView style={{ flex: 1 }}>
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<Text style={styles.welcome}>☆Wechat Example☆</Text>
|
<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>
|
</View>
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user