华为AppGallery常用跳转与链接详解
當(dāng)前華為應(yīng)用市場(AppGallery,以下簡稱AG)的功能越來越全,頁面也越來越多,隨著而來的,是對(duì)于個(gè)各種頁面跳轉(zhuǎn)的需求越來越旺盛。
但是,華為AppGallery所提供的鏈接的種類、功能、使用場景越來越多,不熟悉的人看到這各種鏈接,肯定會(huì)非常頭大。下面根據(jù)我的使用是理解,做了一些AppGallery常用鏈接與跳轉(zhuǎn)場景的整理,僅供大家參考。
?
下面各種鏈接的介紹,主要按照使用場景來劃分,如有錯(cuò)誤,還請(qǐng)大家指正。
?
1、跳轉(zhuǎn)到AG首頁
典型使用場景:需要從開發(fā)者應(yīng)用內(nèi),拉起跳轉(zhuǎn)到應(yīng)用市場首頁,讓用戶自行搜索相關(guān)的應(yīng)用或者活動(dòng)。
使用方法:使用Intent的action方法,具體動(dòng)作為:
| 1 | action:com.huawei.appmarket.intent.action.MainActivity |
?
相關(guān)代碼示例:
public void launchAGHomePage() {Intent intent = new Intent("com.huawei.appmarket.intent.action.MainActivity");startActivity(intent);}?
?2、跳轉(zhuǎn)到AG應(yīng)用詳情頁
2.1?應(yīng)用內(nèi)通過Intent跳轉(zhuǎn)
典型使用場景:應(yīng)用內(nèi)拉起跳轉(zhuǎn)到應(yīng)用詳情頁,應(yīng)用用戶進(jìn)行評(píng)分評(píng)論等操作。
使用方法:使用Intent的action方法,具體可分為兩類:
1、?通過APPID:
| 1 2 3 | action:com.huawei.appmarket.appmarket.intent.action.AppDetail.?withid setPackage("com.huawei.appmarket"); name:?“appId”,?value:?“C100170981” |
2、通過包名:
| 1 2 3 | action:com.huawei.appmarket.intent.action.AppDetail setPackage("com.huawei.appmarket"); name:?“APP_PACKAGENAME”,?value:?“com.huawei.browser” |
?
注意點(diǎn):如果使用方式1即APPID的方式,比使用包名的方式,action中多了appmarket以及withid參數(shù)。
參數(shù)介紹? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
| ? 參數(shù)名 | ? 參數(shù)類型 | ? 備注與取值 |
| ? appId | ? String | ? 在AGC頁面“我的應(yīng)用 –> 應(yīng)用信息”中的APP ID并加上字母C(例如華為瀏覽器的APPID:C100170981) |
| ? APP_PACKAGENAME | ? String | ? 應(yīng)用包名,例如華為瀏覽器的包名:com.huawei.browser |
?
相關(guān)代碼示例:
// 1、通過APPID:
public void launchAppDetilPage1() {Intent intent = new Intent("com.huawei.appmarket.appmarket.intent.action.AppDetail.withid");intent.setPackage("com.huawei.appmarket");intent.putExtra("appId", "C100170981");startActivity(intent);}// 2、通過包名packageName”
public void launchAppDetilPage2() {Intent intent = new Intent("com.huawei.appmarket.intent.action.AppDetail");intent.setPackage("com.huawei.appmarket");intent.putExtra("APP_PACKAGENAME", "com.huawei.browser");startActivity(intent);}?
2.2?通過URL跳轉(zhuǎn)
典型使用場景:用戶通過分享的URL鏈接等場景,直接點(diǎn)擊URL跳轉(zhuǎn)到應(yīng)用詳情頁。
具體方法:鏈接地址為:
| 1 | hiapplink://com.huawei.appmarket?appId=yourAppID&channelId=yourChannelId&referrer=yourReferrer |
?
注意點(diǎn):斜體加粗部分為手動(dòng)修改的變量,其余為固定值。
參數(shù)介紹
?? ? ?? ?? ?? ? ? ?? ?? ?? ? ? ?? ?? ?? ? ? ?? ?? ??
| ? 參數(shù)名 | ? 參數(shù)類型 | ? 備注與取值 |
| ? yourAppID | ? String | ? 用于定位到具體的應(yīng)用,其值為您的AGC上的AppID:例如,華為瀏覽器的Appid為C100170981 |
| ? yourChannelId | ? String | ? (可選)表示不同的渠道,可用于統(tǒng)計(jì)渠道點(diǎn)擊量,根據(jù)此渠道信息輸出報(bào)表。例如:HwBrowserSearch |
| ? yourReferrer | ? String | ? (可選)表示不同的歸因參數(shù):例如?Keywords |
相關(guān)代碼示例:
1. 通過APPID
public void launchAppDetilWithURL1() {String text1 = "hiapplink://com.huawei.appmarket?appId=C100170981&channelId=HwBrowserSearch&referrer=Keywords";Uri uri = Uri.parse(text1);Intent intent = new Intent(Intent.ACTION_VIEW, uri);startActivity(intent);}?
3、market拉起所有本地商店并跳轉(zhuǎn)詳情頁
典型使用場景:傳入包名或者APPID,拉起設(shè)備上所有的應(yīng)用商店,讓用戶自行選擇打開方式,即引導(dǎo)用戶選擇使用哪個(gè)應(yīng)用市場拉起。選擇好打開的應(yīng)用商店后可以直接跳轉(zhuǎn)到應(yīng)用的詳情頁。
使用方法:通過傳入scheme 為market://?的鏈接,Android支持的標(biāo)準(zhǔn)的market協(xié)議,可拉起Android設(shè)備上的所有應(yīng)用商店。有如下兩種方式:
1、market://details?id=pkgName?? // 支持所有商店
2、appmarket://details?id=pkgName???????? ?// 僅支持華為應(yīng)用商店。
3、market://com.huawei.appmarket.applink?appId=APPID" ?// 僅支持華為應(yīng)用商店。
注意點(diǎn):方法1通過market://傳入包名的方式,為Android標(biāo)準(zhǔn)方法,在所有應(yīng)用商店中均可使用,例如GP,應(yīng)用包等;。
參數(shù)介紹? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
| ? 參數(shù)名 | ? 參數(shù)類型 | ? 備注與取值 |
| ? APPID | ? String | ? 應(yīng)用的APPID:例如華為瀏覽器:C100170981 |
| ? pkgName | ? String | ? 應(yīng)用包名,例如華為瀏覽器:com.huawei.browser |
?
相關(guān)代碼示例:
// 1、方式1:market:// + 包名
public void launchAppDetilOnMarket1() {String text1 = "market://details?id=com.huawei.browser";Uri uri = Uri.parse(text1);Intent intent = new Intent(Intent.ACTION_VIEW, uri);startActivity(intent);}// 2、方式2:appmarket:// + 包名
public void launchAppDetilOnMarket2() {String text1 = "appmarket://details?id=com.huawei.browser";Uri uri = Uri.parse(text1);Intent intent = new Intent(Intent.ACTION_VIEW, uri);startActivity(intent);}3、方式3:market:// + 華為商店 + APPID
public void launchAppDetilOnMarket3() {String text1 = "market://com.huawei.appmarket.applink?appId=C100170981";Uri uri = Uri.parse(text1);Intent intent = new Intent(Intent.ACTION_VIEW, uri);startActivity(intent);}?
4、鏈接到web AG的應(yīng)用詳情頁
典型使用場景:應(yīng)用的官網(wǎng)或者web投放等場景,用戶點(diǎn)擊web鏈接,直接拉起AppGallery中應(yīng)用的詳情頁面,引導(dǎo)用戶安裝。
使用方法:
-
方法1:https://appgallery.huawei.com/#/app/YOUR_APPID
-
方法2:https://appgallery.cloud.huawei.com/appDetail?pkgName=pkgName
-
方法4:https://appgallery.huawei.com/#/app/YOUR_APPID?pkgName=pkgName
-
方法3:https://appgallery.cloud.huawei.com/marketshare/app/?YOUR_APPID?locale=LOCALE&shareTo=WAP&shareFrom=channeID
?
參數(shù)介紹? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
| ? 參數(shù)名 | ? 參數(shù)類型 | ? 備注與取值 |
| ? YOUR_APPID | ? String | ? 應(yīng)用的APPID:例如華為瀏覽器:C100170981 |
| ? pkgName | ? String | ? 應(yīng)用包名,例如華為瀏覽器:com.huawei.browser |
| ? LOCALE | ? String | ? (可選)設(shè)置國家和展示語言,例如:zh-CN |
| ? WAP | ? String | ? (可選)分享到何處,可以自行定義,例如:wap |
| ? channeID | ? String | ? (可選)分享來源,可以設(shè)置渠道統(tǒng)計(jì)標(biāo)識(shí),即渠道號(hào)碼 |
?
示例:
// 1、最短鏈接:通過APPID
https://appgallery.huawei.com/#/app/C100170981
// 2、通過包名
https://appgallery.cloud.huawei.com/appDetail?pkgName=com.huawei.browser
// 3、APPID與包名組合使用
https://appgallery.huawei.com/#/app/C100170981?pkgName=com.huawei.browser
// 4、詳細(xì)鏈接并且加上可選參數(shù)(不常用,一般在圖章中使用)
https://appgallery.cloud.huawei.com/marketshare/app/C100170981?locale=en_US&shareTo=wap&shareFrom=52656
?
5、圖章鏈接到AG的應(yīng)用詳情頁
圖章鏈接,簡單來說,就是有一個(gè)AppGallery的圖,點(diǎn)擊這個(gè)圖,可以超鏈接到華為應(yīng)用市場的應(yīng)用詳情頁。應(yīng)用的營銷人員,可以直接將這個(gè)圖用于投放(其鏈接的本質(zhì),與上述方法4的web鏈接相同)。
典型使用場景:對(duì)于與上架的應(yīng)用,營銷人員希望通過圖章鏈接,在官網(wǎng)上導(dǎo)流到應(yīng)用商店,或者直接用于投放。
創(chuàng)建方法:在AGC首頁?-> 點(diǎn)擊“應(yīng)用內(nèi)分發(fā)”-> 即可在應(yīng)用內(nèi)分發(fā)的界面“制作圖章”, 即可為已上架的應(yīng)用制作圖章鏈接。
注意點(diǎn):僅已上架的應(yīng)用才能制作圖章,并且每個(gè)應(yīng)用只能創(chuàng)建一個(gè)圖章;如果應(yīng)用已創(chuàng)建圖章,則只能在 “圖章查詢”中查看。
使用指南:
圖章創(chuàng)建以后,即可在“圖章查詢”頁簽中,查看當(dāng)前已經(jīng)創(chuàng)建的圖章, 你可以在該界面,下載圖章或者復(fù)制鏈接:
-
下載圖章:下載的結(jié)果是一個(gè)png圖片,可以掛在官網(wǎng)或者營銷H5頁面里。
-
新增鏈接:用于標(biāo)識(shí)不同的渠道,例如:Facebook,baidu等
-
復(fù)制鏈接:可根據(jù)不同的渠道下載不同的鏈接
?
使用示例:
?
// 1、典型的鏈接
https://appgallery.huawei.com/#/app/C100170981?channelId=baidu&referrer=TestBaidu&id=fa09e0f0f3de489386a7180d7b4b3585&s=6E90164FC0CED39CD11D9BE25BE6D1B333FEDCCBCD90A86F29A8DA2400AA4163&detailType=0&v=
// 2、使用典型的圖章,在網(wǎng)站中嵌入該圖章,點(diǎn)擊即可跳轉(zhuǎn)到應(yīng)用詳情下載頁,使用實(shí)例如下:
? ? ? ?
?
6、跨平臺(tái)的App Linking鏈接
App Linking 是華為AppGallery Connect推出的一項(xiàng)新的服務(wù),大家知道和接觸的比較少,因此下面的介紹會(huì)更加詳細(xì)并且更加通俗,幫助大家更好的理解這個(gè)
AppLinking是什么:App Linking就是一個(gè)可以跨平臺(tái)(Android,iOS,PC-Browser)使用的鏈接,對(duì)標(biāo)于Firebase的Dynamic Link功能,幫助應(yīng)用開發(fā)者快速構(gòu)建跨平臺(tái)的分享鏈接。
AppLinking用在哪:比如說一個(gè)應(yīng)用在Android和iOS都有發(fā)布,此時(shí)有個(gè)促銷活動(dòng)需要各個(gè)平臺(tái)的用戶參與;該活動(dòng)的邀請(qǐng)鏈接,在Android和iOS上都要能夠生效,并且對(duì)于在PC瀏覽器打開的用戶,也能夠?yàn)g覽相應(yīng)的活動(dòng)H5頁面。
使用AppLinking后有什么效果:
-
手機(jī)上已安裝該應(yīng)用:AppLinking鏈接將自動(dòng)拉起應(yīng)用,并且跳轉(zhuǎn)到指定頁面,
-
手機(jī)上未安裝該應(yīng)用:鏈接將提示你通過應(yīng)用市場打開,可配置為華為AppGallery或者本地應(yīng)用商店,下載并安裝好應(yīng)用以后,仍可打開指定頁面。
?
AppLinking怎么用:AppLinking有三種創(chuàng)建方式:適用于不同的場景:
-
AGC界面創(chuàng)建:在AGC首頁?-> 點(diǎn)擊“我的項(xiàng)目”并選擇相應(yīng)的項(xiàng)目-> 在左側(cè)菜單欄找到“增長”-“ App Linking”。在AppLinking界面先創(chuàng)建鏈接前綴,然后在創(chuàng)建AppLinking.
該方式主要給不懂代碼的營銷同事使用,但里面使用到的深度鏈接地址,還是需要跟開發(fā)同事獲取。
-
Android應(yīng)用內(nèi)創(chuàng)建:在Android應(yīng)用內(nèi),集成AppLinking SDK,并且通過build.buildAppLinking()等相關(guān)代碼進(jìn)行鏈接的實(shí)時(shí)創(chuàng)建。
該方式主要提供給Android用戶的實(shí)時(shí)創(chuàng)建,比如應(yīng)用內(nèi)的活動(dòng)頁面,添加一個(gè)分享按鈕,點(diǎn)擊分享按鈕,就創(chuàng)建一個(gè)AppLinking鏈接。
-
?iOS應(yīng)用內(nèi)創(chuàng)建:和Android應(yīng)用一樣,這個(gè)就是在iOS應(yīng)用內(nèi),使用代碼進(jìn)行鏈接創(chuàng)建。
該方式主要提供給iOS用戶,讓iOS用戶在應(yīng)用通過代碼實(shí)時(shí)創(chuàng)建并且分享。
?
非華為手機(jī)上怎么用:
AppLinking是跨平臺(tái)的,也即適用于所有Android和iOS,那肯定很多同學(xué)關(guān)心“在非華為的Android手機(jī)上怎么使用AppLinking?”這個(gè)問題,下面這方面問題做相應(yīng)的解答:
1、?非華為手機(jī)能否使用AppLinking?—— App Linking不依賴HMS Core,可以在所有Android設(shè)備上使用,GMS和HMS設(shè)備通用。
2、?應(yīng)用未安裝且手機(jī)上未安裝華為應(yīng)用市場,AppLinking怎么用? —— 對(duì)于沒有安裝AppGallery的Android手機(jī),可以將AppLinking配置為?本地應(yīng)用市場打開,這樣Android系統(tǒng)就會(huì)引導(dǎo)讓你選擇通過哪個(gè)商店商店打開,只要你的包名一致,可以任何商店的應(yīng)用詳情頁。
?
使用示例
// 1、典型的鏈接前綴
https://photoplaza.drcn.agconnect.link?????? // 其中photoplaza為應(yīng)用唯一參數(shù),drcn.agconnect.link為系統(tǒng)固定參數(shù)。
// 2、典型的AppLinking鏈接:
https://photoplaza.drcn.agconnect.link/vm3Y
// 3、 典型的Android創(chuàng)建AppLinking
| 1 2 3 4 5 6 7 | private?static?final?String?DOMAIN_URI_PREFIX?=?"https://photoplaza.drcn.agconnect.link";private?static?final?String?DEEP_LINK?=?"https://developer.huawei.com";public?void?createAppLinking()?{ ?????AppLinking.Builder?builder?=?new?AppLinking.Builder() ?????????????.setUriPrefix(DOMAIN_URI_PREFIX) ?????????????.setDeepLink(Uri.parse(DEEP_LINK)) ?????????????.setAndroidLinkInfo(new?AppLinking.AndroidLinkInfo.Builder().build()); ?????String?LongAppLinking?=?builder.buildAppLinking().getUri().toString(); ?} |
// 4、典型的iOS創(chuàng)建AppLinking
| 1 2 3 4 5 6 7 | -?(IBAction)CreatLink:(id)sender?{ AGCAppLinkingComponents?*component?=?[[AGCAppLinkingComponents?alloc]?init]; component.uriPrefix?=?@"https://photoplaza.drcn.agconnect.link";????? component.deepLink?=?@"https://www.developer.huawei.com";????? component.iosBundleId?=?@"com.lucky.agc.demo"; ????component.iosDeepLink?=?@"agckit://ios/detail"; ????self.longlink.text?=?component.buildLongLink.absoluteString; |
?
7、相關(guān)參考鏈接
圖章鏈接官方文檔:https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/appgallery-agd-introduction-stamped
App Linking官方文檔:https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agc-applinking-introduction-0000001054143215
添加歸因參數(shù)文檔:https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/appgallery-referrer-createlink
獲取歸因信息:https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/appgallery-referrer-develop
原文鏈接:https://developer.huawei.com/consumer/cn/forum/topic/0201448086867860655?fid=0101271690375130218&pid=0301448086867860778
原作者:Mayism
?
總結(jié)
以上是生活随笔為你收集整理的华为AppGallery常用跳转与链接详解的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: oracle存储过程借助utl,使用UT
- 下一篇: css三角形的IE兼容写法