Cordovaã§ã¢ããªã¹ãã¢ã表示ããæ¹æ³
Cordovaã§ä½ã£ãã¢ããªã§ããã¿ã³ãã¿ããããã¨Google PlayãApp Storeã®ã¢ããªãèµ·åãã¦ç¹å®ã¢ããªã®ãã¼ã¸ã表示ããæ¹æ³ã«ã¤ãã¦èª¿ã¹ã¦ã¿ã¾ããã
HTMLã®ãªã³ã¯ã§è¨è¿°ããæ¹æ³
æåã
<a href="market://details?id=...">
ã®ããã«è¨è¿°ãã¦ã¿ã¾ãããããã¾ãããã¾ããã§ããï¼Androidã®å ´åï¼ã
WebViewã®ã»ãã¥ãªãã£ã®å¶éã§ããããã
ãªã®ã§ãHTMLã®ãªã³ã¯ã§è¨è¿°ããæ¹æ³ã¯ããããã¾ããã
ãã©ã°ã¤ã³ã使ç¨
cordova-plugin-market ã¨ãããã©ã°ã¤ã³ã試ãã¦ã¿ãã¨ããããã¾ãããã¾ããã
https://github.com/xmartlabs/cordova-plugin-market
READMEã«èª¬æãããã¾ãããAndroidã®å ´åã¯ã
cordova.plugins.market.open('your.app.package')
iOSã®å ´åã¯ã
cordova.plugins.market.open('yourappname')
ã§ä½¿ãã¾ãã
iOSã®å ´åã®æ³¨æç¹1
iOSã®å ´åã®ãã©ã¡ã¼ã¿ã¼ã«ã¯ãã¢ããªåã®ç縮åï¼App Store Short Linkï¼ãæå®ããªããã°ãªãã¾ããã
ç縮åã¯ãã¹ãã¼ã¹ãç¹æ®æåã®åé¤ãå°æååãï¼ããandãã«å¤æ´ããªã©ã®å¤æãå ãã¦ä½æãã¾ãã
詳細ã¯ä»¥ä¸ã®ãã¼ã¸ã§èª¬æããã¦ãã¾ãã
Technical Q&A QA1633: Creating easy-to-read short links to the App Store for your apps and company
ãã®ãã¼ã¸ã«ã¯è¨è¿°ããã¦ãã¾ããããã¢ããªåãæ¥æ¬èªãªã©ã®å ´åãURLã¨ã³ã³ã¼ãããå¿ è¦ãããã¾ãã
ä¾ãã°ããã¡ã®ä¼ç¤¾ã§åºãã¦ããã¢ããªãã´ã¼ã«ãã - ä»äºãæåã«å°ããã©ã³ãã¼ãã®å ´åã
var appName = encodeURI('ã´ã¼ã«ããä»äºãæåã«å°ããã©ã³ãã¼');
cordova.plugins.market.open(appName);
ã¨ããã¨ãApp Storeã®ãã¼ã¸ãéãã¾ããã
iOSã®å ´åã®æ³¨æç¹2
iOSã§ã¯ã¢ããªåãæå®ãã¦ããã®ã§ãã¢ããªåã夿´ããå ´åãä¸è¨ã®ã³ã¼ããä¿®æ£ããå¿ è¦ãããã¾ãã
ã¢ããªåã«ãã£ããã³ãã¼ã説æãä»ãã¦ããå ´åã ã¨ãããã¯é常ã«ä½¿ãåæãæªããã®ã«ãªãã¾ãã
cordova-plugin-market ãã©ã°ã¤ã³ã®ã½ã¼ã¹ãèªãã¨ãApp Storeãéãã®ã«ã
itms-apps://itunes.com/app/
ã¨ããURLãæå®ãã¦ãã¾ããã調ã¹ã¦ã¿ãã¨ãããããã
itms-apps://itunes.apple.com/app/
ã«å¤ãã¦ãå¾ãã«ã¢ããªIDãä»ãããã¨ã§ããåãåä½ãå®ç¾ã§ãããã¨ããããã¾ããã
ä¾ãã°ã
itms-apps://itunes.apple.com/app/id123456789
ã®ããã«æå®ãã¾ãã
ããã ã¨ã¢ããªåã夿´ãã¦ãå½±é¿ããªãã®ã§ããã§ããã
åã¯çµå±ãã½ã¼ã¹ãç´æ¥ä¿®æ£ãã¦IDæå®ã®ã¿ã«ãã¦ä½¿ã£ã¦ãã¾ãããäºææ§ãèããã¨ãã¢ããªåãæå®ãããå ´åã¨IDãæå®ãããå ´åã§URLãåãæ¿ããã®ãè¯ãããã§ãã
Objective-Cã¯ã¾ã ãã¹ã¿ã¼ãã¦ããªãã®ã§ããï¼ããSwiftã®ã¿ã§è¡ãããï¼ãæéãã§ãããPull Requestãæããããã¨æãã¾ãã