提交 6d17d81a authored 作者: JarvanMo's avatar JarvanMo

fix bug

上级 bdf58bb4
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
*/ */
package com.jarvan.fluwx.handler package com.jarvan.fluwx.handler
import android.util.Log
import com.jarvan.fluwx.constant.WeChatPluginMethods import com.jarvan.fluwx.constant.WeChatPluginMethods
import com.jarvan.fluwx.constant.WechatPluginKeys import com.jarvan.fluwx.constant.WechatPluginKeys
import com.tencent.mm.opensdk.modelbase.BaseResp import com.tencent.mm.opensdk.modelbase.BaseResp
...@@ -39,6 +40,8 @@ object FluwxResponseHandler { ...@@ -39,6 +40,8 @@ object FluwxResponseHandler {
fun handleResponse(response: BaseResp) { fun handleResponse(response: BaseResp) {
Log.e("tag","heeeeee")
when (response) { when (response) {
is SendAuth.Resp -> handleAuthResponse(response) is SendAuth.Resp -> handleAuthResponse(response)
is SendMessageToWX.Resp -> handleSendMessageResp(response) is SendMessageToWX.Resp -> handleSendMessageResp(response)
...@@ -57,6 +60,8 @@ object FluwxResponseHandler { ...@@ -57,6 +60,8 @@ object FluwxResponseHandler {
WechatPluginKeys.PLATFORM to WechatPluginKeys.ANDROID WechatPluginKeys.PLATFORM to WechatPluginKeys.ANDROID
) )
response.extMsg?.let { response.extMsg?.let {
// "extMsg" to response.extMsg, // "extMsg" to response.extMsg,
result["extMsg"] = response.extMsg result["extMsg"] = response.extMsg
......
...@@ -24,6 +24,7 @@ import com.jarvan.fluwx.handler.WXAPiHandler ...@@ -24,6 +24,7 @@ import com.jarvan.fluwx.handler.WXAPiHandler
import com.tencent.mm.opensdk.modelbase.BaseReq import com.tencent.mm.opensdk.modelbase.BaseReq
import com.tencent.mm.opensdk.modelbase.BaseResp import com.tencent.mm.opensdk.modelbase.BaseResp
import com.tencent.mm.opensdk.openapi.IWXAPIEventHandler import com.tencent.mm.opensdk.openapi.IWXAPIEventHandler
import java.lang.Exception
open class FluwxWXEntryActivity : Activity(), IWXAPIEventHandler { open class FluwxWXEntryActivity : Activity(), IWXAPIEventHandler {
...@@ -35,15 +36,26 @@ open class FluwxWXEntryActivity : Activity(), IWXAPIEventHandler { ...@@ -35,15 +36,26 @@ open class FluwxWXEntryActivity : Activity(), IWXAPIEventHandler {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
try {
WXAPiHandler.wxApi?.handleIntent(intent, this) WXAPiHandler.wxApi?.handleIntent(intent, this)
}catch (e:Exception){
e.printStackTrace()
finish()
}
} }
override fun onNewIntent(intent: Intent) { override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent) super.onNewIntent(intent)
setIntent(intent) setIntent(intent)
try {
WXAPiHandler.wxApi?.handleIntent(intent, this) WXAPiHandler.wxApi?.handleIntent(intent, this)
}catch (e:Exception){
e.printStackTrace()
finish()
}
} }
...@@ -53,7 +65,6 @@ open class FluwxWXEntryActivity : Activity(), IWXAPIEventHandler { ...@@ -53,7 +65,6 @@ open class FluwxWXEntryActivity : Activity(), IWXAPIEventHandler {
// 第三方应用发送到微信的请求处理后的响应结果,会回调到该方法 // 第三方应用发送到微信的请求处理后的响应结果,会回调到该方法
override fun onResp(resp: BaseResp) { override fun onResp(resp: BaseResp) {
FluwxResponseHandler.handleResponse(resp) FluwxResponseHandler.handleResponse(resp)
finish() finish()
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论