业精于勤荒于嬉
业精于勤荒于嬉
  • 发布:2022-08-23 17:24
  • 更新:2022-08-26 11:39
  • 阅读:1736

【报Bug】plus.runtime.openURL配置了urlschemewhitelist为什么还是报不支持该功能

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: window11

HBuilderX类型: 正式

HBuilderX版本号: 3.5.3

手机系统: iOS

手机系统版本号: iOS 13.4

手机厂商: 苹果

手机机型: 苹果8

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

部分代码:

let url = 'snssdk1128://lynxview?surl=https://lf-dy-sourcecdn-tos.bytegecko.com/obj/byte-gurd-source/1325/gecko/resource/alliance_lynx_live_room_middle_page/app/template.js&fallback_url=https://alliance.jinritemai.com/lynx/pages/live-room-middle-page/app/template/index.html&hide_nav_bar=1&dynamic=2&live_room_schema=snssdk1128://webcast_room?room_id=7130368027991739166&enter_method=cps_open_deeplink&enter_from_merge=cps_open_deeplink&ecom_live_params=%7B%22cps_track%22%3A%22Cj0InqLk-8ICEOgIGihkeV8xMDcwOTg1ODU0Mjg4MTU5NzA1NjRfOTA3Nl8xMjE3MDQwNjIzIgUxXzFfMUgAEgwInpaAkpf-ifpiEAE%22%7D'  
                        // #ifdef APP-PLUS  
                        plus.runtime.openURL(url, function(res) {  
                                console.log('打开了吗', res);  
                                uni.showToast({  
                                    title: res.message,  
                                    icon: 'none'  
                                })  
                        });  
                        // #endif
//manifest.json配置  
/* 应用发布信息 */  
        "distribute" : {  
            /* android打包配置 */  
            "android" : {  
                "permissions" : [  
                    "<uses-feature android:name=\"android.hardware.camera\"/>",  
                    "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",  
                    "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",  
                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",  
                    "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",  
                    "<uses-permission android:name=\"android.permission.ACCESS_MOCK_LOCATION\"/>",  
                    "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",  
                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",  
                    "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",  
                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",  
                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",  
                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",  
                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",  
                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",  
                    "<uses-permission android:name=\"android.permission.GET_TASKS\"/>",  
                    "<uses-permission android:name=\"android.permission.INTERNET\"/>",  
                    "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",  
                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",  
                    "<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",  
                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",  
                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",  
                    "<uses-permission android:name=\"android.permission.READ_SMS\"/>",  
                    "<uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\"/>",  
                    "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",  
                    "<uses-permission android:name=\"android.permission.SEND_SMS\"/>",  
                    "<uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\"/>",  
                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",  
                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",  
                    "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",  
                    "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",  
                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",  
                    "<uses-permission android:name=\"android.permission.WRITE_SMS\"/>",  
                    "<uses-permission android:name=\"android.permission.RECEIVE_USER_PRESENT\"/>"  
                ]  
            },  
            /* ios打包配置 */  
            "ios" : {  
                "UIBackgroundModes" : [ "audio" ],  
                "urlschemewhitelist" : [ "baidumap", "iosamap", "snssdk1128", "snssdk32" ]  
            },  
            /* SDK配置 */  
            "sdkConfigs" : {  
                "speech" : {  
                    "ifly" : {}  
                },  
                "ad" : {},  
                "maps" : {  
                    "amap" : {  
                        "appkey_ios" : "ad02ce0ef0f1d0f7ccd5a65e31c2d495",  
                        "appkey_android" : "ad02ce0ef0f1d0f7ccd5a65e31c2d495"  
                    }  
                },  
                "geolocation" : {  
                    "system" : {  
                        "__platform__" : [ "ios", "android" ]  
                    }  
                },  
                "share" : {}  
            },  
            "orientation" : [ "portrait-primary" ]  
        }  

操作步骤:

manifest.json 配置
/ ios打包配置 /
"ios" : {
"UIBackgroundModes" : [ "audio" ],
"urlschemewhitelist" : [ "baidumap", "iosamap", "snssdk1128", "snssdk32" ]
},
let url = 'snssdk1128://lynxview?surl=https://lf-dy-sourcecdn-tos.bytegecko.com/obj/byte-gurd-source/1325/gecko/resource/alliance_lynx_live_room_middle_page/app/template.js&fallback_url=https://alliance.jinritemai.com/lynx/pages/live-room-middle-page/app/template/index.html&hide_nav_bar=1&dynamic=2&live_room_schema=snssdk1128://webcast_room?room_id=7130368027991739166&enter_method=cps_open_deeplink&enter_from_merge=cps_open_deeplink&ecom_live_params=%7B%22cps_track%22%3A%22Cj0InqLk-8ICEOgIGihkeV8xMDcwOTg1ODU0Mjg4MTU5NzA1NjRfOTA3Nl8xMjE3MDQwNjIzIgUxXzFfMUgAEgwInpaAkpf-ifpiEAE%22%7D'
// #ifdef APP-PLUS
plus.runtime.openURL(url, function(res) {
console.log('打开了吗', res);
uni.showToast({
title: res.message,
icon: 'none'
})
});
// #endif

预期结果:

预期 -- 跳转到抖音某个直播间

实际结果:

结果 -- {code:-3,message:'此功能不支持'}

bug描述:

已经配置过了 "urlschemewhitelist" , 调用 plus.runtime.openURL 还是报 不支持该功能。请问还需要配置什么吗?

2022-08-23 17:24 负责人:DCloud_iOS_WZT 分享
已邀请:
BoredApe

BoredApe - 有问题就会有答案。

使用plus.runtime.launchApplication( appInf, errorCB );

  • 业精于勤荒于嬉 (作者)

    openURL不行吗?你说的那个我这里不适用0.0, 而且我打开高德导航到某个地方都可以。就跳抖音直播间不行

    2022-08-24 10:12

  • 业精于勤荒于嬉 (作者)

    还是用的你说的 launchApplication 这个,openUrl一直报 此功能不支持。

    2022-08-24 10:34

  • DCloud_iOS_WZT

    回复 2***@qq.com: 跳转不能光配白名单,还要配urlSchemes

    2022-08-25 12:15

DCloud_iOS_WZT

DCloud_iOS_WZT

urlSchemes配了嚒 你appid私信我下 我看下

  • 业精于勤荒于嬉 (作者)

    发你了0.0,坐等

    2022-08-26 09:57

  • DCloud_iOS_WZT

    回复 业精于勤荒于嬉: 你发的截图里看着是没配 加一下

    2022-08-26 11:35

  • 业精于勤荒于嬉 (作者)

    回复 DCloud_iOS_WZT:/ 应用发布信息 /

    "distribute" : {

    / android打包配置 /

    "android" : {

    "permissions" : [

    "<uses-feature android:name=\"android.hardware.camera\"/>",

    "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",

    "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",

    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",

    "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",

    "<uses-permission android:name=\"android.permission.ACCESS_MOCK_LOCATION\"/>",

    "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",

    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",

    "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",

    "<uses-permission android:name=\"android.permission.CAMERA\"/>",

    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",

    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",

    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",

    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",

    "<uses-permission android:name=\"android.permission.GET_TASKS\"/>",

    "<uses-permission android:name=\"android.permission.INTERNET\"/>",

    "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",

    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",

    "<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",

    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",

    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",

    "<uses-permission android:name=\"android.permission.READ_SMS\"/>",

    "<uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\"/>",

    "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",

    "<uses-permission android:name=\"android.permission.SEND_SMS\"/>",

    "<uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\"/>",

    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",

    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",

    "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",

    "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",

    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",

    "<uses-permission android:name=\"android.permission.WRITE_SMS\"/>",

    "<uses-permission android:name=\"android.permission.RECEIVE_USER_PRESENT\"/>"

    ],

    "schemes" : "snssdk1128"

    },

    / ios打包配置 /

    "ios" : {

    "UIBackgroundModes" : [ "audio" ],

    "urlschemewhitelist" : [ "baidumap", "iosamap", "snssdk1128", "snssdk32" ],

    "urltypes" : "snssdk1128",

    "capabilities" : {

    "entitlements" : {

    "com.apple.developer.associated-domains" : []

    }

    }

    },

    / SDK配置 /

    "sdkConfigs" : {

    "speech" : {

    "ifly" : {}

    },

    "ad" : {},

    "maps" : {

    "amap" : {

    "appkey_ios" : "ad02ce0ef0f1d0f7ccd5a65e31c2d495",

    "appkey_android" : "ad02ce0ef0f1d0f7ccd5a65e31c2d495"

    }

    },

    "geolocation" : {

    "system" : {

    "platform" : [ "ios", "android" ]

    }

    },

    "share" : {}

    },

    "orientation" : [ "portrait-primary" ]

    }

    2022-08-26 11:41

  • 业精于勤荒于嬉 (作者)

    回复 DCloud_iOS_WZT: 你看这样对不

    2022-08-26 11:41

业精于勤荒于嬉

业精于勤荒于嬉 (作者) - jiuT94

urlSchemes

  • DCloud_iOS_WZT

    你这个schemes 要跟你要跳转的应用的官方文档里的一致 确认一致就没问题

    2022-08-26 12:00

  • 业精于勤荒于嬉 (作者)

    回复 DCloud_iOS_WZT: 刚刚测试了,你说的方法解决了我的bug。 谢谢

    2022-09-23 16:24

该问题目前已经被锁定, 无法添加新回复