CBB 的APP跳轉(zhuǎn)文檔
目前跳轉(zhuǎn)采用沒有帶參數(shù)的方式,后期會進行參數(shù)攜帶,再另行更新.
一. iOS:
1.判斷方式和跳轉(zhuǎn)方式:
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"efu://"]]) {
//跳轉(zhuǎn)到app
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@“efu://“] options:nil completionHandler:nil];
}else{
//說明此設(shè)備沒有安裝app,進入下載頁
};
如果在安裝的情況下沒有跳轉(zhuǎn),請修改以下設(shè)置:
xcode-info->
增加URL TYPES: URL Schemes : efu
二. android
1.判斷是否安裝:
public boolean isMobile_spExist() {
PackageManager manager = this.getPackageManager();
List < PackageInfo > pkgList = manager.getInstalledPackages(0);
for (int i = 0;i < pkgList.size();i++)
{
PackageInfo pI = pkgList.get(i);
if (pI.packageName.equalsIgnoreCase("com.baoxian")) return true;
}
return false;
}
2.用戶有安裝進行跳轉(zhuǎn):
Intent intent = new Intent(); intent.setClassName("com.baoxian”, “com.baoxian.MainActivity
"); startActivity(intent);
3.沒安裝跳到網(wǎng)頁下載
三. 統(tǒng)一下載頁:
https://app.efujr.com/index.php?g=wechat&m=Helpword&a=yydownload&orgno=b1feb94aa5ee53618d2f10d2d5d62347&appname=%E4%BF%9D%E9%99%A9APP