Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-fluwx
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
openSourceLibrary
clx-fluwx
Commits
202c225d
提交
202c225d
authored
3月 03, 2021
作者:
JarvanMo
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
https://github.com/OpenFlutter/fluwx
into dev
上级
fe3a2f01
f9ae39c3
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
23 行增加
和
31 行删除
+23
-31
CHANGELOG.md
CHANGELOG.md
+3
-0
FluwxPlugin.kt
android/src/main/kotlin/com/jarvan/fluwx/FluwxPlugin.kt
+9
-11
FluwxRequestHandler.kt
...n/kotlin/com/jarvan/fluwx/handlers/FluwxRequestHandler.kt
+2
-8
FluwxResponseHandler.kt
.../kotlin/com/jarvan/fluwx/handlers/FluwxResponseHandler.kt
+8
-11
pubspec.yaml
pubspec.yaml
+1
-1
没有找到文件。
CHANGELOG.md
浏览文件 @
202c225d
## 2.6.2
*
Fix #338 on Android
## 2.6.1
*
Fix #338
...
...
android/src/main/kotlin/com/jarvan/fluwx/FluwxPlugin.kt
浏览文件 @
202c225d
...
...
@@ -19,14 +19,16 @@ import io.flutter.plugin.common.PluginRegistry
class
FluwxPlugin
:
FlutterPlugin
,
MethodCallHandler
,
ActivityAware
{
companion
object
{
var
callingChannel
:
MethodChannel
?
=
null
@JvmStatic
fun
registerWith
(
registrar
:
PluginRegistry
.
Registrar
)
{
val
channel
=
MethodChannel
(
registrar
.
messenger
(),
"com.jarvanmo/fluwx"
)
val
authHandler
=
FluwxAuthHandler
(
channel
)
FluwxResponseHandler
.
setMethodChannel
(
channel
)
FluwxRequestHandler
.
setMethodChannel
(
channel
)
WXAPiHandler
.
setContext
(
registrar
.
activity
().
applicationContext
)
channel
.
setMethodCallHandler
(
FluwxPlugin
().
apply
{
this
.
fluwxChannel
=
channel
this
.
authHandler
=
authHandler
this
.
shareHandler
=
FluwxShareHandlerCompat
(
registrar
).
apply
{
permissionHandler
=
PermissionHandler
(
registrar
.
activity
())
...
...
@@ -42,19 +44,15 @@ class FluwxPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
private
var
fluwxChannel
:
MethodChannel
?
=
null
override
fun
onAttachedToEngine
(
@NonNull
flutterPluginBinding
:
FlutterPlugin
.
FlutterPluginBinding
)
{
if
(
fluwxChannel
==
null
)
{
fluwxChannel
=
MethodChannel
(
flutterPluginBinding
.
binaryMessenger
,
"com.jarvanmo/fluwx"
)
fluwxChannel
?.
setMethodCallHandler
(
this
)
}
fluwxChannel
?.
let
{
FluwxResponseHandler
.
setMethodChannel
(
it
)
FluwxRequestHandler
.
setMethodChannel
(
it
)
authHandler
=
FluwxAuthHandler
(
it
)
}
val
channel
=
MethodChannel
(
flutterPluginBinding
.
binaryMessenger
,
"com.jarvanmo/fluwx"
)
channel
.
setMethodCallHandler
(
this
)
fluwxChannel
=
channel
authHandler
=
FluwxAuthHandler
(
channel
)
shareHandler
=
FluwxShareHandlerEmbedding
(
flutterPluginBinding
.
flutterAssets
,
flutterPluginBinding
.
applicationContext
)
}
override
fun
onMethodCall
(
@NonNull
call
:
MethodCall
,
@NonNull
result
:
Result
)
{
FluwxPlugin
.
callingChannel
=
fluwxChannel
when
{
call
.
method
==
"registerApp"
->
WXAPiHandler
.
registerApp
(
call
,
result
)
call
.
method
==
"sendAuth"
->
authHandler
?.
sendAuth
(
call
,
result
)
...
...
android/src/main/kotlin/com/jarvan/fluwx/handlers/FluwxRequestHandler.kt
浏览文件 @
202c225d
...
...
@@ -21,6 +21,7 @@ import android.content.Intent
import
android.content.pm.PackageManager
import
android.os.Bundle
import
android.util.Log
import
com.jarvan.fluwx.FluwxPlugin
import
com.tencent.mm.opensdk.modelmsg.ShowMessageFromWX
import
io.flutter.plugin.common.MethodChannel
import
com.tencent.mm.opensdk.modelbase.BaseReq
...
...
@@ -31,13 +32,6 @@ object FluwxRequestHandler {
var
customOnReqDelegate
:
((
baseReq
:
BaseReq
,
activity
:
Activity
)
->
Unit
)?
=
null
private
var
channel
:
MethodChannel
?
=
null
fun
setMethodChannel
(
channel
:
MethodChannel
)
{
FluwxRequestHandler
.
channel
=
channel
}
fun
handleRequestInfoFromIntent
(
intent
:
Intent
)
{
intent
.
getBundleExtra
(
KEY_FLUWX_REQUEST_INFO_BUNDLE
)
?.
run
{
val
type
=
getInt
(
"_wxapi_command_type"
,
-
9999
)
...
...
@@ -59,7 +53,7 @@ object FluwxRequestHandler {
val
result
=
mapOf
(
"extMsg"
to
req
.
message
.
messageExt
)
c
hannel
?.
invokeMethod
(
"onWXShowMessageFromWX"
,
result
)
FluwxPlugin
.
callingC
hannel
?.
invokeMethod
(
"onWXShowMessageFromWX"
,
result
)
}
private
fun
defaultOnReqDelegate
(
baseReq
:
BaseReq
,
activity
:
Activity
)
{
...
...
android/src/main/kotlin/com/jarvan/fluwx/handlers/FluwxResponseHandler.kt
浏览文件 @
202c225d
...
...
@@ -15,6 +15,7 @@
*/
package
com.jarvan.fluwx.handlers
import
com.jarvan.fluwx.FluwxPlugin
import
com.tencent.mm.opensdk.modelbase.BaseResp
import
com.tencent.mm.opensdk.modelbiz.SubscribeMessage
import
com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram
...
...
@@ -25,17 +26,12 @@ import com.tencent.mm.opensdk.modelpay.PayResp
import
io.flutter.plugin.common.MethodChannel
object
FluwxResponseHandler
{
private
var
channel
:
MethodChannel
?
=
null
private
const
val
errStr
=
"errStr"
private
const
val
errCode
=
"errCode"
private
const
val
openId
=
"openId"
private
const
val
type
=
"type"
fun
setMethodChannel
(
channel
:
MethodChannel
)
{
FluwxResponseHandler
.
channel
=
channel
}
fun
handleResponse
(
response
:
BaseResp
)
{
when
(
response
)
{
is
SendAuth
.
Resp
->
handleAuthResponse
(
response
)
...
...
@@ -56,7 +52,7 @@ object FluwxResponseHandler {
"scene"
to
response
.
scene
,
type
to
response
.
type
)
c
hannel
?.
invokeMethod
(
"onSubscribeMsgResp"
,
result
)
FluwxPlugin
.
callingC
hannel
?.
invokeMethod
(
"onSubscribeMsgResp"
,
result
)
}
private
fun
handleLaunchMiniProgramResponse
(
response
:
WXLaunchMiniProgram
.
Resp
)
{
...
...
@@ -71,7 +67,7 @@ object FluwxResponseHandler {
result
[
"extMsg"
]
=
response
.
extMsg
}
c
hannel
?.
invokeMethod
(
"onLaunchMiniProgramResponse"
,
result
)
FluwxPlugin
.
callingC
hannel
?.
invokeMethod
(
"onLaunchMiniProgramResponse"
,
result
)
}
private
fun
handlePayResp
(
response
:
PayResp
)
{
...
...
@@ -83,7 +79,7 @@ object FluwxResponseHandler {
type
to
response
.
type
,
errCode
to
response
.
errCode
)
c
hannel
?.
invokeMethod
(
"onPayResponse"
,
result
)
FluwxPlugin
.
callingC
hannel
?.
invokeMethod
(
"onPayResponse"
,
result
)
}
private
fun
handleSendMessageResp
(
response
:
SendMessageToWX
.
Resp
)
{
...
...
@@ -93,7 +89,7 @@ object FluwxResponseHandler {
errCode
to
response
.
errCode
,
openId
to
response
.
openId
)
c
hannel
?.
invokeMethod
(
"onShareResponse"
,
result
)
FluwxPlugin
.
callingC
hannel
?.
invokeMethod
(
"onShareResponse"
,
result
)
}
private
fun
handleAuthResponse
(
response
:
SendAuth
.
Resp
)
{
...
...
@@ -108,7 +104,7 @@ object FluwxResponseHandler {
"url"
to
response
.
url
,
type
to
response
.
type
)
c
hannel
?.
invokeMethod
(
"onAuthResponse"
,
result
)
FluwxPlugin
.
callingC
hannel
?.
invokeMethod
(
"onAuthResponse"
,
result
)
}
...
...
@@ -121,6 +117,6 @@ object FluwxResponseHandler {
openId
to
response
.
openId
,
type
to
response
.
type
)
c
hannel
?.
invokeMethod
(
"onWXOpenBusinessWebviewResponse"
,
result
)
FluwxPlugin
.
callingC
hannel
?.
invokeMethod
(
"onWXOpenBusinessWebviewResponse"
,
result
)
}
}
\ No newline at end of file
pubspec.yaml
浏览文件 @
202c225d
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.
1
version
:
2.6.
2
homepage
:
https://github.com/JarvanMo/fluwx
environment
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论