Skip to content

Commit 973a80c

Browse files
committed
chore(iOS): 添加微信 SDK v1.8.7.1
1 parent 15c37db commit 973a80c

File tree

18 files changed

+1660
-137
lines changed

18 files changed

+1660
-137
lines changed

README.md

Lines changed: 56 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,64 @@
1-
# @uiw/react-native-wechat
1+
@uiw/react-native-wechat
2+
-----
23

3-
## Getting started
4+
React Native 包使用微信分享、登录、收藏、支付等功能。
45

5-
`$ npm install @uiw/react-native-wechat --save`
6+
## 注意事项
67

7-
### Mostly automatic installation
8+
<details>
9+
<summary>iOS: 微信授权登录 Universal Link(通用链接)</summary>
810

9-
`$ react-native link @uiw/react-native-wechat`
11+
> Universal Link(通用链接)是苹果在 iOS9 推出的,一种能够方便的通过传统 HTTPS 链接来启动 APP 的功能,可以使用相同的网址打开网址和 APP。
12+
> 看起来就是一条普通的 https 链接,当然是我们在该链接域名根目录配置过的一个链接,也可以在该链接中放置对应的H5页面。当用户的点击该链接,只要手机中安装了支持该链接的 APP 就会直接进入到 APP 中。如果没有安装APP则会跳转到 Safari 浏览器中,展示 H5 页面。对用户来说则是一个无缝跳转的过程。
1013
11-
## Usage
12-
```javascript
13-
import RNWechat from '@uiw/react-native-wechat';
14+
创建一个名为 `apple-app-site-association` 的文件,如下:
1415

15-
// TODO: What to do with the module?
16-
RNWechat;
16+
```json
17+
{
18+
"applinks": {
19+
"apps": [],
20+
"details": [
21+
{
22+
"appID": "Team ID.com.uiwjs.XXX",
23+
"paths": ["/uiwjs/*"]
24+
},
25+
{
26+
"appID": "Team ID.com.uiwjs.XXX",
27+
"paths": ["/uiwjstest/*"]
28+
}
29+
]
30+
}
31+
}
1732
```
1833

34+
上传该文件到你的域名所对应的`根目录``xxx目录`下,`apple-app-site-association` 文件不需要扩展名。
35+
36+
**注意:** 苹果提供了一个[网页来验证](https://search.developer.apple.com/appsearch-validation-tool/)我们编写的这个 [apple-app-site-association](https://search.developer.apple.com/appsearch-validation-tool/) 是否合法有效。
37+
38+
```
39+
根目录
40+
https://uiwjs.github.io/apple-app-site-association
41+
42+
xxx目录
43+
https://uiwjs.github.io/react-native-wechat/apple-app-site-association
44+
```
45+
46+
</details>
47+
48+
## 安装依赖
49+
50+
```bash
51+
yarn add @uiw/react-native-alipay
52+
# react-native version >= 0.60+
53+
$ cd ios && pod install
54+
```
55+
56+
## 使用
57+
58+
```js
59+
import Wechat from '@uiw/react-native-wechat';
60+
61+
```
1962

2063
## 开发
2164

@@ -37,4 +80,6 @@ npx create-react-native-module --package-identifier com.uiwjs.react.wechat --obj
3780

3881
## 相关连接
3982

40-
- [微信(SDK):iOS定位SDK v1.8.7.1](https://developers.weixin.qq.com/doc/oplatform/Downloads/iOS_Resource.html)
83+
- [微信(SDK):iOS SDK v1.8.7.1](https://developers.weixin.qq.com/doc/oplatform/Downloads/iOS_Resource.html)
84+
- [微信(SDK):iOS 接入指南](https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Access_Guide/iOS.html)
85+
- [@uiw/react-native-alipay](https://github.com/uiwjs/react-native-alipay) 支付宝支付。

example/App.js

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,36 @@
99
*/
1010

1111
import React, { Component } from 'react';
12-
import { Platform, StyleSheet, Text, View } from 'react-native';
12+
import { Platform, SafeAreaView, StyleSheet, Text, View } from 'react-native';
1313
import RNWechat from '@uiw/react-native-wechat';
1414

15-
export default class App extends Component<{}> {
15+
export default class App extends Component {
1616
state = {
17-
status: 'starting',
1817
message: '--'
1918
};
2019
componentDidMount() {
21-
RNWechat.sampleMethod('Testing', 123, (message) => {
22-
this.setState({
23-
status: 'native callback received',
24-
message
25-
});
26-
});
20+
// RNWechat.sampleMethod('Testing', 123, (message) => {
21+
// this.setState({
22+
// message
23+
// });
24+
// });
2725
}
2826
render() {
2927
return (
30-
<View style={styles.container}>
31-
<Text style={styles.welcome}>☆RNWechat example☆</Text>
32-
<Text style={styles.instructions}>STATUS: {this.state.status}</Text>
33-
<Text style={styles.welcome}>☆NATIVE CALLBACK MESSAGE☆</Text>
34-
<Text style={styles.instructions}>{this.state.message}</Text>
35-
</View>
28+
<SafeAreaView style={{ flex: 1 }}>
29+
<View style={styles.container}>
30+
<Text style={styles.welcome}>☆Wechat Example☆</Text>
31+
<Text style={styles.instructions}>{this.state.message}</Text>
32+
</View>
33+
</SafeAreaView>
3634
);
3735
}
3836
}
3937

4038
const styles = StyleSheet.create({
4139
container: {
4240
flex: 1,
43-
justifyContent: 'center',
41+
// justifyContent: 'center',
4442
alignItems: 'center',
4543
backgroundColor: '#F5FCFF',
4644
},

example/apple-app-site-association

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"applinks": {
3+
"apps": [],
4+
"details": [
5+
{
6+
"appID": "Team ID.com.uiwjs.XXX",
7+
"paths": ["/react-native-wechat/*"]
8+
}
9+
]
10+
}
11+
}

example/ios/Podfile.lock

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ PODS:
6767
- DoubleConversion
6868
- glog
6969
- glog (0.3.5)
70+
- libWeChatSDK (1.7.5)
7071
- OpenSSL-Universal (1.0.2.19):
7172
- OpenSSL-Universal/Static (= 1.0.2.19)
7273
- OpenSSL-Universal/Static (1.0.2.19)
@@ -296,6 +297,9 @@ PODS:
296297
- React-Core (= 0.63.2)
297298
- React-cxxreact (= 0.63.2)
298299
- React-jsi (= 0.63.2)
300+
- RNWechat (1.0.0):
301+
- libWeChatSDK
302+
- React
299303
- Yoga (1.14.0)
300304
- YogaKit (1.18.1):
301305
- Yoga (~> 1.14)
@@ -347,6 +351,7 @@ DEPENDENCIES:
347351
- React-RCTText (from `../node_modules/react-native/Libraries/Text`)
348352
- React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
349353
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
354+
- RNWechat (from `../../ios`)
350355
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
351356

352357
SPEC REPOS:
@@ -361,6 +366,7 @@ SPEC REPOS:
361366
- Flipper-PeerTalk
362367
- Flipper-RSocket
363368
- FlipperKit
369+
- libWeChatSDK
364370
- OpenSSL-Universal
365371
- YogaKit
366372

@@ -415,6 +421,8 @@ EXTERNAL SOURCES:
415421
:path: "../node_modules/react-native/Libraries/Vibration"
416422
ReactCommon:
417423
:path: "../node_modules/react-native/ReactCommon"
424+
RNWechat:
425+
:path: "../../ios"
418426
Yoga:
419427
:path: "../node_modules/react-native/ReactCommon/yoga"
420428

@@ -434,6 +442,7 @@ SPEC CHECKSUMS:
434442
FlipperKit: bc68102cd4952a258a23c9c1b316c7bec1fecf83
435443
Folly: b73c3869541e86821df3c387eb0af5f65addfab4
436444
glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3
445+
libWeChatSDK: e34a813bccc704856a33943bde8279be4e4c82a0
437446
OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355
438447
RCTRequired: f13f25e7b12f925f1f6a6a8c69d929a03c0129fe
439448
RCTTypeSafety: 44982c5c8e43ff4141eb519a8ddc88059acd1f3a
@@ -455,6 +464,7 @@ SPEC CHECKSUMS:
455464
React-RCTText: 1b6773e776e4b33f90468c20fe3b16ca3e224bb8
456465
React-RCTVibration: 4d2e726957f4087449739b595f107c0d4b6c2d2d
457466
ReactCommon: a0a1edbebcac5e91338371b72ffc66aa822792ce
467+
RNWechat: 13905ec89041c708f753131d23edb6543de8d5ed
458468
Yoga: 7740b94929bbacbddda59bf115b5317e9a161598
459469
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
460470

0 commit comments

Comments
 (0)