Skip to content

Commit

Permalink
0.3.0 released
Browse files Browse the repository at this point in the history
  • Loading branch information
JarvanMo committed Sep 30, 2018
1 parent 9654399 commit 86d8a0d
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 82 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
## 0.2.2
## 0.3.0
* 回调方式发生变化,由Map变更为实体类。
* iOS的SDK更换为'OpenWeChatSDK',并升级到了1.8.3。
* iOS的WeChatSDK更换为内部依赖,并升级到了1.8.3。
* 修复iOS支付返回结果缺少*returnKey*的问题。
* API现在更加友善了。
* 对swift支持更友好了。

## 0.2.1
* 修复在Android处理网络图片后缀不对的问题。
Expand Down
28 changes: 7 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@
implementation 'top.zibin:Luban:1.1.8'
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
```
For iOS:
```podspec
s.dependency 'WechatOpenSDK','~> 1.8.2'
```

For Flutter:<br>
Flutter 0.8.2 • channel beta • https://github.com/flutter/flutter.git<br>
Framework • revision 5ab9e70727 (11 days ago) • 2018-09-07 12:33:05 -0700<br>
Expand All @@ -42,30 +39,19 @@
add the following in your `pubspec.yaml` file:
```yaml
dependencies:
fluwx: ^0.2.1
fluwx: ^0.3.0
```
## Init Fluwx
## Register WeChatSDK via Fluwx
Before using`Fluwx`,you should init `FLuwx`:
```dart
Fluwx.register(appId:"wxd930ea5d5a258f4f",doOnAndroid: true,doOnIOS: true,enableMTA: false);
```
- `appId`:the appId you applied from WeChat.
- `doOnAndroid`:whether init for Android.
- `doOnIOS`:whether init for iOS

Each param isn't necessary.However,if `appId`is blank, or `doOnAndroid: false`, or `doOnIOS: false`,you must register your `WXApi` on the particular platform in order to ensure `Fluwx` can work.
After tha,add the following code before using `Fluwx` on the particular platform:
For Android:
```kotlin
FluwxShareHandler.setWXApi(wxapi)
```
For iOS:
```objective-c
isWeChatRegistered = YES;
import 'package:fluwx/fluwx.dart' as fluwx;
fluwx.register(appId:"wxd930ea5d5a258f4f");
```



> NOTE:Although we can register WXApi via Fluwx,but there's still some work you have to do on the particular platform.For example, creat a `WXEntryActivity` for android and add a URLSchema for iOS.

### More
Expand Down
24 changes: 5 additions & 19 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ QQ群:892398530。
implementation 'top.zibin:Luban:1.1.8'
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
```
iOS部分涉及到的技术:
```podspec
s.dependency 'WechatOpenSDK','~> 1.8.2'
```

Flutter版本信息<br>
Flutter 0.8.2 • channel beta • https://github.com/flutter/flutter.git<br>
Framework • revision 5ab9e70727 (11 days ago) • 2018-09-07 12:33:05 -0700<br>
Expand All @@ -44,29 +41,18 @@ QQ群:892398530。
`pubspec.yaml`文件中添加如下代码:
```yaml
dependencies:
fluwx: ^0.2.1
fluwx: ^0.3.0
```
## 初始化
使用`Fluwx`前,需要进行初始化操作:
```dart
Fluwx.register(appId:"wxd930ea5d5a258f4f",doOnAndroid: true,doOnIOS: true,enableMTA: false);
```
- `appId`:在微信平台申请的appId。
- `doOnAndroid`:是否在android平台上执行此操作。
- `doOnIOS`:是否在iOS平台上执行此操作。</br>
每一个字段都是非必须的,但是如果不传`appId`或`doOnAndroid: false`或者`doOnIOS: false`,请务必手动注册`WXApi`以保证`Fluwx`正常工作。
注册完成后,请在使用`Fluwx`前在对应平台添加如下代码:
Android上:
```kotlin
FluwxShareHandler.setWXApi(wxapi)
```
iOS上:
```objective-c
isWeChatRegistered = YES;
import 'package:fluwx/fluwx.dart' as fluwx;
fluwx.register(appId:"wxd930ea5d5a258f4f");
```


> 注意:尽管可以通过Fluwx完成微信注册,但一些操作依然需要在对应平台进行设置,如配置iOS的URLSchema,Android上的WXEntryActivity等。

### 传送门
Expand Down
14 changes: 11 additions & 3 deletions doc/RESPONSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,18 @@ override the following function in`AppDelegate.m`:
### Flutter
We can get the reponse from WeChat after sharing and etc:
```dart
_fluwx.response.listen((response){
//do something
});
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 {
Expand Down
23 changes: 11 additions & 12 deletions doc/RESPONSE_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,15 @@
### Flutter
```dart
_fluwx.response.listen((response){
//do something
});
fluwx.responseFromShare.listen((response){
//do something
});
fluwx.responseFromAuth.listen((response){
//do something
});
fluwx.responseFromPayment.listen((response){
//do something
});
```
从微信回调的值为`WeChatResponse`,其实`type`字段为枚举:
```dart
enum WeChatResponseType {
SHARE,
AUTH,
PAYMENT }
```
`result`为微信回传的值,其类型为`Map`,具体返回值请参阅微信官方文档,但均额外包含一个
`platform`字段,其值为`android`或者`iOS`,以便开发者作差异化处理。

> 注意:如果一个字段以*android*或者*iOS*开头,那么意味这个字段只存在于*android*或者*iOS*
1 change: 1 addition & 0 deletions doc/SEND_AUTH.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Send Auth
We'll get a `code` by sending auth:
```dart
import 'package:fluwx/fluwx.dart' as fluwx;
fluwx.sendAuth(WeChatSendAuthModel(
scope: "snsapi_userinfo",
state:"wechat_sdk_demo_test",
Expand Down
1 change: 1 addition & 0 deletions doc/SEND_AUTH_CN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 发送Auth验证
`Fluwx`目前只支持获取`code`,若要获取`access_token`请在服务器端完成。
```dart
import 'package:fluwx/fluwx.dart' as fluwx;
fluwx.sendAuth(WeChatSendAuthModel(
scope: "snsapi_userinfo",
state:"wechat_sdk_demo_test",
Expand Down
13 changes: 1 addition & 12 deletions doc/USING_SWIFT.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
## Using Swift?
`fluwx` supports `swift` since 2.0.0. However,before using swift, there's still a little work to do.
If anyone has better solutions, tell me please or open a PR.

## Allow Non-modular Includes

There is an exception called `include non-modular headers` if compiling `fluwx` directly.

We have to allow non-modular includes to support swift,open your target and allow non-modular :

![allow_non_modular_includes](../arts/allow_non_modular_includes.png)


`fluwx` supports `swift` since 2.0.0.


## Response
Expand Down
11 changes: 1 addition & 10 deletions doc/USING_SWIFT_CN.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
## 使用Swift?
`fluwx`*2.0.0*开始支持 `swift`。 但是在使用swift之前, 我们还有一些工作要做。
如果有人知道更好的方式,请告诉我或者提一个PR。

## Allow Non-modular Includes

当我们使用swift编译`fluwx`的时候会报一个错误: `include non-modular headers`
为了支持swift,我们不得不允许*non-modular includes*,打开你的target设置:

![allow_non_modular_includes](../arts/allow_non_modular_includes.png)

`fluwx`*2.0.0*开始支持 `swift`



Expand Down
2 changes: 1 addition & 1 deletion doc/WXPay.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### Pay

```dart
Fluwx fluwx = new Fluwx();
import 'package:fluwx/fluwx.dart' as fluwx;
fluwx.pay(WeChatPayModel(
appId: 'wxd930ea5d5a258f4f',
partnerId: '1900000109',
Expand Down
2 changes: 1 addition & 1 deletion doc/WXPay_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
### 拉起支付

```dart
Fluwx fluwx = new Fluwx();
import 'package:fluwx/fluwx.dart' as fluwx;
fluwx.pay(WeChatPayModel(
appId: 'wxd930ea5d5a258f4f',
partnerId: '1900000109',
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: fluwx
description: A implement of WeChatSDK on Flutter.Let's make it easier with Fluwx.
version: 0.2.1
version: 0.3.0
author: JarvanMo <[email protected]>
homepage: https://github.com/JarvanMo/fluwx

Expand Down

0 comments on commit 86d8a0d

Please sign in to comment.