Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-fluwx
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
openSourceLibrary
clx-fluwx
Commits
6ca413dc
提交
6ca413dc
authored
4月 09, 2021
作者:
JarvanMo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update docs
上级
73db95bd
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
44 行增加
和
13 行删除
+44
-13
LAUNCH_APP_FROM_H5.md
doc/LAUNCH_APP_FROM_H5.md
+20
-6
LAUNCH_APP_FROM_H5_CN.md
doc/LAUNCH_APP_FROM_H5_CN.md
+20
-5
AndroidManifest.xml
example/android/app/src/main/AndroidManifest.xml
+4
-2
没有找到文件。
doc/LAUNCH_APP_FROM_H5.md
浏览文件 @
6ca413dc
...
...
@@ -2,22 +2,36 @@
Fluwx supports launch app from
`<wx-open-launch-app>`
, and pass
`extInfo`
to your app.
For Android side, you need add the following action for your FlutterActivity in
`AndroidManifest.xml`
:
```
<action android:name="${applicationId}.FlutterActivity" />
<intent-filter>
<action android:name="${applicationId}.FlutterActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
```
At the same time, you also need to add
`<meta-data>`
in application which used to store your WeChat AppId:
```
xml
<meta-data
android:name=
"weChatAppId"
android:value=
"12345678"
/>
```
If you want to pass
`extInfo`
to Flutter, you need to add the following code in
`MainActivity.kt`
:
```
kotlin
override
fun
configureFlutterEngine
(
@NonNull
flutterEngine
:
FlutterEngine
)
{
GeneratedPluginRegistrant
.
registerWith
(
flutterEngine
);
override
fun
onCreate
(
savedInstanceState
:
Bundle
?
)
{
super
.
onCreate
(
savedInstanceState
)
//If you didn't configure WxAPI, add the following code
WXAPiHandler
.
setupWxApi
(
"wxd930ea5d5a258f4f"
,
this
)
//Get Ext-Info from Intent.
FluwxRequestHandler
.
handleRequestInfoFromIntent
(
intent
)
}
```
If you want to custom your request logic, you need add the
`<meta-data>`
in
host activity
:
If you want to custom your request logic, you need add the
`<meta-data>`
in
application
:
```
xml
<meta-data
android:name=
"handleWeChatRequestByFluwx"
android:value=
"flase"
/>
```
And then, set
`FluwxRequestHandler.customOnReqDelegate`
on your own.
\ No newline at end of file
And then, set
`FluwxRequestHandler.customOnReqDelegate`
on your own.
> For details, please read the example.
\ No newline at end of file
doc/LAUNCH_APP_FROM_H5_CN.md
浏览文件 @
6ca413dc
## 从H5启动app
Fluwx 支持从
`<wx-open-launch-app>`
启动你的app, 并且支持传递
`extInfo`
给你的app.
对于Android来说,你要在
`AndroidManifest.xml`
中给你的
`
application
`
加上一个标签:
对于Android来说,你要在
`AndroidManifest.xml`
中给你的
`
Activity
`
加上一个标签:
```
<intent-filter>
<action android:name="${applicationId}.FlutterActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
```
与此同时,你还需要在需要在application中加上
`<meta-data>`
,把你的appId放进去:
```
xml
<meta-data
android:name=
"weChatAppId"
android:value=
"12345678"
/>
```
如果你想把
`extInfo`
传给Flutter, 你要在
`MainActivity`
加上如下代码:
```
kotlin
override
fun
configureFlutterEngine
(
@NonNull
flutterEngine
:
FlutterEngine
)
{
GeneratedPluginRegistrant
.
registerWith
(
flutterEngine
);
override
fun
onCreate
(
savedInstanceState
:
Bundle
?
)
{
super
.
onCreate
(
savedInstanceState
)
//If you didn't configure WxAPI, add the following code
WXAPiHandler
.
setupWxApi
(
"wxd930ea5d5a258f4f"
,
this
)
//Get Ext-Info from Intent.
...
...
@@ -20,4 +33,6 @@ Fluwx 支持从`<wx-open-launch-app>`启动你的app, 并且支持传递`extInfo
android:name=
"handleWeChatRequestByFluwx"
android:value=
"flase"
/>
```
然后, 自己实现
`FluwxRequestHandler.customOnReqDelegate`
.
\ No newline at end of file
然后, 自己实现
`FluwxRequestHandler.customOnReqDelegate`
.
> 更多信息请参考example.
\ No newline at end of file
example/android/app/src/main/AndroidManifest.xml
浏览文件 @
6ca413dc
...
...
@@ -28,9 +28,11 @@
android:windowSoftInputMode=
"adjustResize"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"${applicationId}.FlutterActivity"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
<intent-filter>
<action
android:name=
"${applicationId}.FlutterActivity"
/>
<category
android:name=
"android.intent.category.DEFAULT"
/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论