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

registerWxApi

...@@ -62,14 +62,14 @@ Before using`Fluwx`,you should init `FLuwx`: ...@@ -62,14 +62,14 @@ Before using`Fluwx`,you should init `FLuwx`:
```dart ```dart
import 'package:fluwx/fluwx.dart' as fluwx; import 'package:fluwx/fluwx.dart' as fluwx;
fluwx.register(appId:"wxd930ea5d5a258f4f",universalLink:""); fluwx.register(appId:"wxd930ea5d5a258f4f",universalLink:"https://your.univeral.link.com/placeholder/");
``` ```
Developers must provide `universalLink` if you want register WeChat via fluwx, otherwise, ignore. Developers must provide `universalLink` if you want register WeChat via fluwx, otherwise, ignore.
> NOTE:Although we can register WXApi via Fluwx,but there's still some work you have to do on the particular platform.For example, add URLSchema or universal link for iOS. > NOTE:Although we can register WXApi via Fluwx,but there's still some work you have to do on the particular platform.For example, add *URLSchema, LSApplicationQueriesSchemes or universal link* for iOS.
for detail, please read the official documents Please read the official documents for details.
### More ### More
* [Share](./doc/SHARE.md) * [Share](./doc/SHARE.md)
......
...@@ -58,12 +58,12 @@ dependencies: ...@@ -58,12 +58,12 @@ dependencies:
使用`Fluwx`前,需要进行初始化操作: 使用`Fluwx`前,需要进行初始化操作:
```dart ```dart
import 'package:fluwx/fluwx.dart' as fluwx; import 'package:fluwx/fluwx.dart' as fluwx;
fluwx.register(appId:"wxd930ea5d5a258f4f"); fluwx.register(appId:"wxd930ea5d5a258f4f",universalLink:"https://your.univeral.link.com/placeholder/");
``` ```
如果你想通过fluwx注册微信,请务必提供 `universalLink` ,否则无视这句话. 如果你想通过fluwx在iOS端注册微信,请务必提供 `universalLink` ,否则无视这句话.
> 注意:尽管可以通过Fluwx完成微信注册,但一些操作依然需要在对应平台进行设置,如配置iOS的URLSchema,universal link等。 > 注意:尽管可以通过Fluwx完成微信注册,但一些操作依然需要在对应平台进行设置,如配置iOS的*URLSchema,LSApplicationQueriesSchemes,universal link*等。
### 传送门 ### 传送门
* [分享](./doc/SHARE_CN.md) * [分享](./doc/SHARE_CN.md)
......
...@@ -122,6 +122,7 @@ Future<dynamic> _handler(MethodCall methodCall) { ...@@ -122,6 +122,7 @@ Future<dynamic> _handler(MethodCall methodCall) {
///if [doOnIOS] is true ,fluwx will register WXApi on iOS. ///if [doOnIOS] is true ,fluwx will register WXApi on iOS.
///if [doOnAndroid] is true, fluwx will register WXApi on Android. ///if [doOnAndroid] is true, fluwx will register WXApi on Android.
/// [universalLink] is required if you want to register on iOS. /// [universalLink] is required if you want to register on iOS.
@Deprecated("repleace with registerWxApi")
Future register( Future register(
{String appId, {String appId,
bool doOnIOS: true, bool doOnIOS: true,
...@@ -135,6 +136,23 @@ Future register( ...@@ -135,6 +136,23 @@ Future register(
}); });
} }
///[appId] is not necessary.
///if [doOnIOS] is true ,fluwx will register WXApi on iOS.
///if [doOnAndroid] is true, fluwx will register WXApi on Android.
/// [universalLink] is required if you want to register on iOS.
Future registerWxApi(
{String appId,
bool doOnIOS: true,
bool doOnAndroid: true,
String universalLink}) async {
return await _channel.invokeMethod("registerApp", {
"appId": appId,
"iOS": doOnIOS,
"android": doOnAndroid,
"universalLink": universalLink
});
}
///we don't need the response any longer if params are true. ///we don't need the response any longer if params are true.
void dispose({ void dispose({
shareResponse: true, shareResponse: true,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论