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

update demo

上级 304eafc4
...@@ -50,7 +50,7 @@ class FluwxPlugin : FlutterPlugin, MethodCallHandler, ActivityAware,PluginRegist ...@@ -50,7 +50,7 @@ class FluwxPlugin : FlutterPlugin, MethodCallHandler, ActivityAware,PluginRegist
private fun handelIntent(intent:Intent?){ private fun handelIntent(intent:Intent?){
val action = intent?.action val action = intent?.action
val dataString = intent?.dataString val dataString = intent?.dataString
if (Intent.ACTION_VIEW.equals(action)) { if (Intent.ACTION_VIEW == action) {
extMsg = dataString extMsg = dataString
} }
} }
......
...@@ -6,6 +6,14 @@ For Android side, you need add the following action for your FlutterActivity in ...@@ -6,6 +6,14 @@ For Android side, you need add the following action for your FlutterActivity in
<action android:name="${applicationId}.FlutterActivity" /> <action android:name="${applicationId}.FlutterActivity" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
</intent-filter> </intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="${applicationId}"
android:path="/"
android:scheme="wechatextmsg" />
</intent-filter>
``` ```
At the same time, you also need to add `<meta-data>` in application which used to store your WeChat AppId: At the same time, you also need to add `<meta-data>` in application which used to store your WeChat AppId:
...@@ -45,5 +53,15 @@ Please add the following queries in your app's `AndroidManifest.xml`: ...@@ -45,5 +53,15 @@ Please add the following queries in your app's `AndroidManifest.xml`:
</intent> </intent>
</queries> </queries>
``` ```
## IOS
Please register your WXApi in your `AppDelegate`:
```oc
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//向微信注册
[WXApi registerApp:APP_ID
universalLink:UNIVERSAL_LINK];
return YES;
}
```
> For details, please read the example. > If you want to get ext from website, please call ``fluwx.getExtMsg()`。`For details, please read the example.
\ No newline at end of file \ No newline at end of file
...@@ -2,9 +2,17 @@ ...@@ -2,9 +2,17 @@
Fluwx 支持从`<wx-open-launch-app>`启动你的app, 并且支持传递`extInfo`给你的app. Fluwx 支持从`<wx-open-launch-app>`启动你的app, 并且支持传递`extInfo`给你的app.
对于Android来说,你要在`AndroidManifest.xml`中给你的`Activity`加上一个标签: 对于Android来说,你要在`AndroidManifest.xml`中给你的`Activity`加上一个标签:
``` ```
<intent-filter>
<action android:name="${applicationId}.FlutterActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter> <intent-filter>
<action android:name="${applicationId}.FlutterActivity" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data
android:host="${applicationId}"
android:path="/"
android:scheme="wechatextmsg" />
</intent-filter> </intent-filter>
``` ```
...@@ -46,4 +54,16 @@ Fluwx 支持从`<wx-open-launch-app>`启动你的app, 并且支持传递`extInfo ...@@ -46,4 +54,16 @@ Fluwx 支持从`<wx-open-launch-app>`启动你的app, 并且支持传递`extInfo
</queries> </queries>
``` ```
> 更多信息请参考example. ## IOS
\ No newline at end of file 请在你的`AppDelegate`中主动注册`WXApi`
```oc
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//向微信注册
[WXApi registerApp:APP_ID
universalLink:UNIVERSAL_LINK];
return YES;
}
```
> 如你想主动获取从网页传进来的值 ,请主动调用`fluwx.getExtMsg()`。更多信息请参考example.
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<action android:name="${applicationId}.FlutterActivity" /> <action android:name="${applicationId}.FlutterActivity" />
</intent> </intent>
</queries> </queries>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application <application
android:name="io.flutter.app.FlutterApplication" android:name="io.flutter.app.FlutterApplication"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
android:value="12345678" /> android:value="12345678" />
<meta-data <meta-data
android:name="handleWeChatRequestByFluwx" android:name="handleWeChatRequestByFluwx"
android:value="true" /> android:value="true" />
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
...@@ -39,6 +39,14 @@ ...@@ -39,6 +39,14 @@
<action android:name="${applicationId}.FlutterActivity" /> <action android:name="${applicationId}.FlutterActivity" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
</intent-filter> </intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="${applicationId}"
android:path="/"
android:scheme="wechatextmsg" />
</intent-filter>
</activity> </activity>
<!-- Don't delete the meta-data below. <!-- Don't delete the meta-data below.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论