拉起抖音APP視訊頁的scheme
阿新 • • 發佈:2019-01-25
拉起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();
}