提交 84635370 authored 作者: JarvanMo's avatar JarvanMo

update doc

上级 3acd1188
......@@ -75,7 +75,7 @@ Before using`Fluwx`,you should init `FLuwx`:
* [Subscribe Message](./doc/SUBSCRIBE_MESSAGE.md)
* [Auth By QRCode](./doc/AUTH_BY_QR_CODE.md)
* [Sign Auto-Deduct](./doc/AUTO_DEDUCT.md)
* [Obtain response from WeChat](./doc/RESPONSE.md)
* [Obtain Response From WeChat](./doc/RESPONSE.md)
### Other
* [Having Questions?](./doc/QUESTIONS.md)
......
### Response From WeChat
There's some work we have to do on the particular platform(if you don't need this,just ignore).
### Flutter
We can get the reponse from WeChat after sharing and etc:
```dart
fluwx.responseFromShare.listen((response){
//do something
});
fluwx.responseFromAuth.listen((response){
//do something
});
fluwx.responseFromPayment.listen((response){
//do something
});
```
> NOTE:If the field starts with "android" or "iOS", it means that only android or iOS has the field.
The type of return value is `WeChatResponse`,and `type` is an enum:
```dart
enum WeChatResponseType {
SHARE,
AUTH,
PAYMENT }
```
`result` is the real response from WeChat,it's a `Map`, read the WeChat documents for more details.
Howver,there an addtional param `platform`,the value of `platform` is `android`or`iOS`.
### Android
Fluwx will create `WXEntryActivity`or`WXPayEntryActivity` by itself since *0.4.0*. So the following
code isn't necessary.
......@@ -100,27 +131,4 @@ don't override this since 1.0.0:
> NOTE:Don't forget to add URL Schema in order to go back to your app.
### Flutter
We can get the reponse from WeChat after sharing and etc:
```dart
fluwx.responseFromShare.listen((response){
//do something
});
fluwx.responseFromAuth.listen((response){
//do something
});
fluwx.responseFromPayment.listen((response){
//do something
});
```
> NOTE:If the field starts with "android" or "iOS", it means that only android or iOS has the field.
The type of return value is `WeChatResponse`,and `type` is an enum:
```dart
enum WeChatResponseType {
SHARE,
AUTH,
PAYMENT }
```
`result` is the real response from WeChat,it's a `Map`, read the WeChat documents for more details.
Howver,there an addtional param `platform`,the value of `platform` is `android`or`iOS`.
### 微信调回
微信的回调也要根据平台的不同进行差异化处理(如果你不需要回调,请忽略)。
### Flutter
```dart
fluwx.responseFromShare.listen((response){
//do something
});
fluwx.responseFromAuth.listen((response){
//do something
});
fluwx.responseFromPayment.listen((response){
//do something
});
```
> 注意:如果一个字段以*android*或者*iOS*开头,那么意味这个字段只存在于*android*或者*iOS*。
### Android
*0.4.0*开始,开发者不必手动添加`WXEntryActivity``WXPayEntryActivity`了,所以下面的不是必需要的了:
~~由于机制问题,`Android`端需要在`WXEntryActivity``WXPayEntryActivity`中添加如下代码:~~
......@@ -97,18 +115,3 @@
```
> 注意:为了能够返回你的app,请不要忘记添加URL Schema。
### Flutter
```dart
fluwx.responseFromShare.listen((response){
//do something
});
fluwx.responseFromAuth.listen((response){
//do something
});
fluwx.responseFromPayment.listen((response){
//do something
});
```
> 注意:如果一个字段以*android*或者*iOS*开头,那么意味这个字段只存在于*android*或者*iOS*。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论