App Links developer guide
概要
本文主要說明 ONE store 應用程式的 URL Scheme 連動方式及各種API。
ONE store 應用程式連動 URL Scheme
在行動應用程式和瀏覽器上執行ONE store客戶端後,支援直接移動到特定下載頁面或執行搜尋的URL scheme。http: //、ftp: // 、 market: // 等字串稱爲URL scheme。通過URL scheme執行應用程式的方式如下。
在應用程式或網頁上點擊超連結時,URL scheme會傳送到system
查看system收到的URL scheme來確認是否有可執行的應用程式
如果有可收到該URL scheme的應用程式,執行應用程式並同時傳送該URL
應用程式在運行中,參考URL中包含的內容執行特定功能
在網頁中使用URL scheme執行ONE Store客戶端時,可能需要對未安裝ONE Store客戶端的情況進行特殊處理。 (只有 Shorten URL的方式不需要特殊處理)
URL Scheme 建構
各個規格詳情請參考 Reference。
應用程式/遊戲 詳細呼叫
商品查看是以product ID(商品ID為基準從ONE store客戶端移動至該商品的詳細查看畫面。
在ONE store網頁上搜尋該商品即可簡單確認商品PID。
規格
onestore://common/product/{product ID = PID}
範例
onestore://common/product/0000252337
搜索呼叫
搜尋查看是讓ONE store客戶端顯示對於關鍵字的搜尋結果畫面。
規格
onestore://common/search/{query}
範例
onestore://common/search/naver app
更新請求
當收到更新應用程式/遊戲商品的請求時,如果該商品不是最新版本,將會自動下載並安裝更新版本。當更新請求的商品Package名稱與即將要下載的商品Package名稱相同時才會進行。
規格
onestore://common/product/bg_update/{product ID = PID}
範例
onestore://common/product/bg_update/0000252337
使用短網址(Shorten URL)連動
可使用ProductID(商品PID)簡單地生成應用程式詳細頁面的連動網址。
規格
https://onesto.re/{product ID = PID}}
範例
https://onesto.re/0000252337
原有規格的重定向(Redirects)處理
各個Store中個別使用的連動規格會自動重定向處理。因此,對於販售中的商品則無須另外開發。
原有規格重定向新規格
如果需要intent統計,按照以下標準,在指令後統一輸入以下內容。referrer 統計查詢
詳情請見 Reference。
規格
onestore://common/{individual connection command}?refType=(Int)&referrer=(STRING)&callerType=(INT)
從最終幻想1(com.square_enix.android.finalfantasy_sp)連接到最終幻想6(0000652407)下載頁面時,
範例
onestore://common/product/0000652407?refType=1&referrer=com.square_enix.android.finalfantasy_sp&callerType=7
在活動網頁中連接至最終幻想6(0000652407)下載頁面時,
範例
onestore://common/product/0000652407?refType=2&referrer=http://goo.gl/tQu1mP&callerType=8
與Hungryapp(0000309884)合作,連接到最終幻想(0000652407)下載頁面時,
範例
onestore://common/product/0000652407?refType=3&referrer=HUNGRY APP+0000309884&callerType=15
在行動網站呼叫URL scheme
通過html hyperlink reference輸入所定的custom url。建構html頁面,以實現使用者選擇相對連接時如以下方式處理。
未安裝應用程式時所實現的處理方式
如果已安裝應用程式,則即可執行,但未安裝,因為使用javascript timer而發生setTimeout,可轉移到其他行動網站或Goole play商店等。(如果未安裝應用程式,在轉移頁面之前,有可能顯示有誤的提示框。)詳細處理方式如下。
為了隱藏系統錯誤訊息,有可能需要以 iframe處理等。如果使用intent scheme,處理起來更簡單。
var url = "onestore://common/product/0000252337?view_type=1"; var ONEstoreUrl = "https://onesto.re/0000252337" function onClickApp(url) { var clickedAt = +new Date; AppCheckTimer = setTimeout(function() { if (+new Date - clickedAt < 2000){ if (window.confirm("The latest version of the ONE store app is not installed. \Move to n mobile web page")) { location.href = ONEstoreUrl; } } }, 1500); } location.href = url;
伺服器 API
- 以Package名稱(packageName)確認PID和版本
如果商品已上市,可以通過packgeName的openAPI確認PID以及各種資料。
請求規格
https://oneapi.onestore.net/api/devcenter/getAppVersion/v1?pkgNm={package name}&deviceModelCd={model name}&osVer={OS version}&sdkVersion={SDK version}
請求範例
https://oneapi.onestore.net/api/devcenter/getAppVersion/v1?pkgNm=com.nexon.bluearchiveone&deviceModelCd=SM-N960N&osVer=11.0&sdkVersion=30
回應範例
{ "result": { "code": "000", "desc": "success" }, "prodId": "0000758646", "verNm": "1.36.120365", "verCd": "120365", "title": "블루 아카이브", "topMenuId": "DP01", "topMenuNm": "게임", "menuId": "DP01004", "menuNm": "롤플레잉", "sellerNm": "(주) 넥슨", "game": true }
Last updated