Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-fluwx
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
openSourceLibrary
clx-fluwx
Commits
60a79cc6
提交
60a79cc6
authored
4月 09, 2021
作者:
Charley
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复冷启动问题
上级
ca58ed2b
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
29 行增加
和
3 行删除
+29
-3
FluwxRequestHandler.kt
...n/kotlin/com/jarvan/fluwx/handlers/FluwxRequestHandler.kt
+3
-2
WXAPiHandler.kt
...src/main/kotlin/com/jarvan/fluwx/handlers/WXAPiHandler.kt
+8
-0
FluwxWXEntryActivity.kt
...ain/kotlin/com/jarvan/fluwx/wxapi/FluwxWXEntryActivity.kt
+13
-0
AndroidManifest.xml
example/android/app/src/main/AndroidManifest.xml
+4
-0
pubspec.yaml
pubspec.yaml
+1
-1
没有找到文件。
android/src/main/kotlin/com/jarvan/fluwx/handlers/FluwxRequestHandler.kt
浏览文件 @
60a79cc6
...
...
@@ -61,7 +61,7 @@ object FluwxRequestHandler {
// 稳定复现场景:微信版本为7.0.5,小程序SDK为2.7.7
if
(
baseReq
.
type
==
4
)
{
// com.tencent.mm.opensdk.constants.ConstantsAPI.COMMAND_SHOWMESSAGE_FROM_WX = 4
if
(
WXAPiHandler
.
wxApiRegistered
)
{
if
(
!
WXAPiHandler
.
isCoolBoot
)
{
handleRequest
(
baseReq
)
startSpecifiedActivity
(
defaultFlutterActivityAction
(
activity
),
activity
=
activity
)
}
else
{
...
...
@@ -102,5 +102,5 @@ object FluwxRequestHandler {
}
}
private
fun
defaultFlutterActivityAction
(
context
:
Context
):
String
=
"$
context.packageName
.FlutterActivity"
private
fun
defaultFlutterActivityAction
(
context
:
Context
):
String
=
"$
{context.packageName}
.FlutterActivity"
}
\ No newline at end of file
android/src/main/kotlin/com/jarvan/fluwx/handlers/WXAPiHandler.kt
浏览文件 @
60a79cc6
...
...
@@ -34,6 +34,14 @@ object WXAPiHandler {
val
wxApiRegistered
get
()
=
registered
//是否为冷启动
private
var
coolBoot
:
Boolean
=
false
val
isCoolBoot
get
()
=
coolBoot
fun
setCoolBool
(
isCoolBoot
:
Boolean
)
{
coolBoot
=
isCoolBoot
}
fun
setupWxApi
(
appId
:
String
,
context
:
Context
,
force
:
Boolean
=
true
):
Boolean
{
if
(
force
||
!
registered
)
{
setContext
(
context
)
...
...
android/src/main/kotlin/com/jarvan/fluwx/wxapi/FluwxWXEntryActivity.kt
浏览文件 @
60a79cc6
...
...
@@ -17,6 +17,7 @@ package com.jarvan.fluwx.wxapi
import
android.app.Activity
import
android.content.Intent
import
android.content.pm.PackageManager
import
android.os.Bundle
import
com.jarvan.fluwx.handlers.FluwxResponseHandler
import
com.jarvan.fluwx.handlers.FluwxRequestHandler
...
...
@@ -24,6 +25,7 @@ import com.jarvan.fluwx.handlers.WXAPiHandler
import
com.tencent.mm.opensdk.modelbase.BaseReq
import
com.tencent.mm.opensdk.modelbase.BaseResp
import
com.tencent.mm.opensdk.openapi.IWXAPIEventHandler
import
io.flutter.Log
open
class
FluwxWXEntryActivity
:
Activity
(),
IWXAPIEventHandler
{
...
...
@@ -34,6 +36,17 @@ open class FluwxWXEntryActivity : Activity(), IWXAPIEventHandler {
super
.
onCreate
(
savedInstanceState
)
try
{
if
(!
WXAPiHandler
.
wxApiRegistered
)
{
var
appInfo
=
packageManager
.
getApplicationInfo
(
packageName
,
PackageManager
.
GET_META_DATA
)
val
wechatAppId
=
appInfo
.
metaData
.
getString
(
"weChatAppId"
)
if
(
wechatAppId
!=
null
){
WXAPiHandler
.
setupWxApi
(
wechatAppId
,
this
)
WXAPiHandler
.
setCoolBool
(
true
)
Log
.
d
(
"fluwx"
,
"weChatAppId:"
+
wechatAppId
)
}
else
{
Log
.
e
(
"fluwx"
,
"can't load meta-data weChatAppId"
)
}
}
WXAPiHandler
.
wxApi
?.
handleIntent
(
intent
,
this
)
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
...
...
example/android/app/src/main/AndroidManifest.xml
浏览文件 @
60a79cc6
...
...
@@ -10,6 +10,10 @@
android:name=
"io.flutter.app.FlutterApplication"
android:icon=
"@mipmap/ic_launcher"
android:label=
"fluwx_example"
>
<meta-data
android:name=
"weChatAppId"
android:value=
"12345678"
/>
<meta-data
android:name=
"handleWeChatRequestByFluwx"
...
...
pubspec.yaml
浏览文件 @
60a79cc6
name
:
fluwx
description
:
The capability of implementing WeChat SDKs in Flutter. With Fluwx, developers can use WeChatSDK easily, such as sharing, payment, lanuch mini program and etc.
version
:
2.6.
2
version
:
2.6.
3
homepage
:
https://github.com/JarvanMo/fluwx
environment
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论