拉起抖音APP视频页的scheme

拉起scheme地协议

snssdk1128://aweme/detail/6534452667488406792?refer=web&gd_label=click_wap_detail_download_feature&appParam=%7B%22__type__%22%3A%22wap%22%2C%22position%22%3A%22900718067%22%2C%22parent_group_id%22%3A%226553813763982626051%22%2C%22webid%22%3A%226568996356873356814%22%2C%22gd_label%22%3A%22click_wap%22%7D&needlaunchlog=1

如上所示:该uri的是Restful的,path信息中就定位到在目录视频

抖音APP的scheme支持定义

使用apktool反编译抖音App,查看其AndroidManifest.xml,找到对应的intent-filter如下
这里写图片描述

发起Intent的代码

String url = "snssdk1128://aweme/detail/6534452667488406792?refer=web&gd_label=click_wap_detail_download_feature&appParam=%7B%22__type__%22%3A%22wap%22%2C%22position%22%3A%22900718067%22%2C%22parent_group_id%22%3A%226553813763982626051%22%2C%22webid%22%3A%226568996356873356814%22%2C%22gd_label%22%3A%22click_wap%22%7D&needlaunchlog=1"
try {
  Uri uri = Uri.parse(url);
  Intent intent = new Intent(Intent.ACTION_VIEW, uri);
  intent.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
  Activity实例.startActivity(intent);
} catch (Exception e) {
  e.printStackTrace();
}

猜你喜欢

转载自blog.csdn.net/scholar_ii/article/details/80772768