cordova - Opening Play Store App within PhoneGap -


i have designed hybrid mobile application , there 2 versions. direct users version, have included inside html5 source

    <a href="market://details?id=com.kabam.ff7">          <img id=offtomarket alt="get on google play"             src="./img/android_app.png" />      </a> 

the image displayed not opening play store app on android device. why it?

com.kabam.ff7 example now.

i tried approach

$("#offtomarket").click(       function(e) {  window.open('market://details?id=com.kabam.ff7');                  alert("offtomarketclicked");                }               ); 

and still did not work. see alert window.
thanks

i found solution

install plugin

https://github.com/xmartlabs/cordova-plugin-market

cli -

cordova plugin add https://github.com/xmartlabs/cordova-plugin-market 

and in javascript

cordova.plugins.market.open('com.kabam.ff7');  

if use jquery , have button id called mybutton

$("#mybutton").click(   function(e) {         cordova.plugins.market.open('com.kabam.ff7');   } ); 

and include following css in css make badge perfect

img {     width  : 100%;     height : auto } 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -