I've got an html app which is wrapped in Phonegap and in the android store.
I'd like to put a link to the app within the app for users to update if an update is available.
According to the documentation, and some results here on SO, on devices,
< a href="market://details?id=.myapp.name" > Update App </a>
opens the store, but I need to open the link from javascript.
I've tried both window.open
and window.location.href
but both of those open the browser and I get a URL not found error. The url in the browser turns out to be http://market://details...
Anybody know why or how I can link directly to the store, not to the play website?
---------------UPDATE -------------------
I don't want to open the play store in a browser, I am trying to open the native play store.
I know this is possible because smartbanner opens the proper store. .smartbanner/
But I can't get it to work.
I've got an html app which is wrapped in Phonegap and in the android store.
I'd like to put a link to the app within the app for users to update if an update is available.
According to the documentation, and some results here on SO, on devices,
< a href="market://details?id=.myapp.name" > Update App </a>
opens the store, but I need to open the link from javascript.
I've tried both window.open
and window.location.href
but both of those open the browser and I get a URL not found error. The url in the browser turns out to be http://market://details...
Anybody know why or how I can link directly to the store, not to the play website?
---------------UPDATE -------------------
I don't want to open the play store in a browser, I am trying to open the native play store.
I know this is possible because smartbanner opens the proper store. http://jasny.github.io/jquery.smartbanner/
But I can't get it to work.
Share Improve this question edited May 8, 2013 at 2:22 pedalpete asked May 8, 2013 at 1:34 pedalpetepedalpete 21.5k45 gold badges133 silver badges245 bronze badges3 Answers
Reset to default 9Turns out that phonegap basically steals the window.open, and was checking the protocol used within. Therefore using '_blank'
within phonegap doesn't open a new browser window (as you'd expect) but instead opens a browser window within phonegap, which phonegap owns and only lets use either http or https protocols (I'm assuming those are the only two).
In order to pass a link to the system browser, you have to use
window.open("market://details?=.your.app","_system");
and that will send the request out of phonegap and open the link in the native browser, which then redirects correctly to the native app store.
User target="_top"
<a href="market://details?id={package_name}" target="_top">App</a>
As Google says here
Use the format below to deep-link users directly to a specific app's product details page. At the product details page, users can see the app description, screenshots, reviews and more, and then install it.
To create the link, you need to know the app's fully qualified package name, which is declared in the app's manifest file. The package name is also visible in the Developer Console.
From a web site: (these will open the dialog of what app you want to take the action: browser or market)
http://play.google./store/apps/details?id=<package_name>
From an Android app:
market://details?id=<package_name>