提交 38206605 authored 作者: JarvanMo's avatar JarvanMo

fix:passing a null path while launching mini-program doesn't lauch the home page…

fix:passing a null path while launching mini-program doesn't lauch the home page of the mini-program on Android
上级 11160bf2
package com.jarvan.fluwx.handler package com.jarvan.fluwx.handler
import android.util.Log
import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel import io.flutter.plugin.common.MethodChannel
import com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram import com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram
...@@ -11,7 +12,7 @@ internal class FluwxLaunchMiniProgramHandler { ...@@ -11,7 +12,7 @@ internal class FluwxLaunchMiniProgramHandler {
fun launchMiniProgram(call: MethodCall,result: MethodChannel.Result){ fun launchMiniProgram(call: MethodCall,result: MethodChannel.Result){
val req = WXLaunchMiniProgram.Req() val req = WXLaunchMiniProgram.Req()
req.userName = call.argument<String?>("userName") // 填小程序原始id req.userName = call.argument<String?>("userName") // 填小程序原始id
req.path = call.argument<String?>("path") //拉起小程序页面的可带参路径,不填默认拉起小程序首页 req.path = call.argument<String?>("path")?:"" //拉起小程序页面的可带参路径,不填默认拉起小程序首页
val type = call.argument("miniProgramType")?:0 val type = call.argument("miniProgramType")?:0
req.miniprogramType = when(type){ req.miniprogramType = when(type){
1 -> WXLaunchMiniProgram.Req.MINIPROGRAM_TYPE_TEST 1 -> WXLaunchMiniProgram.Req.MINIPROGRAM_TYPE_TEST
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论