Jitsi Android 应用程序,如何从带有参数的意图启动前往特定房间?

问题描述 投票:0回答:1

如果您在特定房间中启动带有 Jitsi url 的 Android 浏览器,Jitsi 页面将包含一个用于启动 Jitsi 应用程序的链接。如果您按下该链接,浏览器将在该特定房间中启动 Jitsi 应用程序。因此,必须有一种方法来启动带有意图参数的 Jitsi 应用程序,以在同一个房间中启动。 有谁知道如何设置带参数的启动意图?

我尝试使用添加与 URL 参数匹配的字符串来创建意图。

android android-intent launch jitsi-meet
1个回答
0
投票
 String cli  = SharedPref.teslaVehicleId + seeLocation;
    cli         = cli.replaceAll("\\s+", "");
    String url  = "https://meet.jit.si/"
                + cli
                + "#config.prejoinConfig.enabled=false"
                + "&config.prejoinpageenabled=false"
                + "&config.startAudioOnly=true"
                + "&config.disableAudioLevels=true"
                + "&config.deeplinking.disabled=true"
                + "&userInfo.displayName=" + seeLocation
                ;
    if(launchurl)    //browser but if the app is installed try the app first
    {
        Uri uri           = Uri.parse(url);
        Intent intent     = new Intent(Intent.ACTION_VIEW,uri);
        intent.setPackage   ("org.jitsi.meet");
        intent.setData      (Uri.parse(url));
        intent.putExtra     (Browser.EXTRA_APPLICATION_ID,"com.safeenv.seeLifeline");
        intent.setFlags     (Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK);
        // Start the Jitsi Meet Android app or fall back to a web browser
        try
        {
            startActivity(intent);
        }
        catch (ActivityNotFoundException e)
        {
            e.printStackTrace();
            // Handle the case where the app is not installed, e.g., open a web browser gpt original
            Intent urlIntent   = new Intent(Intent.ACTION_VIEW, Uri.parse( url));
            urlIntent.setFlags   (Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK);
            startActivity        (urlIntent);
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
        //moved to the try the app first try
        //Intent urlIntent   = new Intent(Intent.ACTION_VIEW, Uri.parse( url));
        //urlIntent.setFlags   (Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK);
        //startActivity        (urlIntent);
    }
© www.soinside.com 2019 - 2024. All rights reserved.