收藏
回答

手机APP显示签名错误 能帮我看一下有没有问题吗?

package com.almightydr.android.meditravel
import android.os.Bundle
import com.tencent.mm.opensdk.modelmsg.SendAuth
import com.tencent.mm.opensdk.openapi.IWXAPI
import com.tencent.mm.opensdk.openapi.WXAPIFactory
import io.flutter.embedding.android.FlutterActivity
import androidx.annotation.NonNull
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodChannel
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import com.tencent.mm.opensdk.constants.ConstantsAPI


class MainActivity: FlutterActivity() {
    private lateinit var api: IWXAPI
    private val APP_ID = "wx92c4efd1665e5755"
    private val APP_SECRET = 这部分出于安全考虑会遮挡的 // 
    private val CHANNEL = "com.almightydr.meditravel/wxapi"


    override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
        super.configureFlutterEngine(flutterEngine)
        MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL).setMethodCallHandler { call, result ->
            if (call.method == "wechatLogin") {
                sendAuthRequest()
            }
        }
    }


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
         regToWx()
    }


     private fun sendAuthRequest() {
        print("sendAuthRequest")
        val req = SendAuth.Req()
        req.scope = "snsapi_userinfo"  // Scope of the request
        req.state = "wechat_android"  // A unique identifier for the request
        api.sendReq(req)
    }




    private fun regToWx() {
        api = WXAPIFactory.createWXAPI(this, APP_ID, true)
        api.registerApp(APP_ID)


        // Suggest dynamic monitoring WeChat start broadcasting to register WeChat
        registerReceiver(object : BroadcastReceiver() {
            override fun onReceive(context: Context, intent: Intent) {
                api.registerApp(APP_ID)
            }
        }, IntentFilter(ConstantsAPI.ACTION_REFRESH_WXAPP))
    }
}


这是目前适用的手机应用程序代码

问题是APP签名不正确。

请告诉我是什么问题,非常感谢。


尝试登录时

无效的签名。 请确认签名与开放平台上的名字是否相同。




回答关注问题邀请回答
收藏
登录 后发表内容