I was trying to create some web app using Framework 7. Everything's fine, but i'd like to be able to call an app from the Home Screen (for example, the Store or the News app).
I know that some APIs are published by Apple Inc, but I can't find a way to call an app from my PHP code.
The Web app is created to run in Safari.
I tried something like:
<script type="text/javascript" charset="utf-8">
window.location = "myapp://iMessage";
</script>
But it doesn't seem to be able to launch the app.
In order to open another app in iOS you need to know what schemes it supports. Not all apps use them, so not every app is openable this way. An example scheme that opens up AppStore looks like this :
itms://itunes.apple.com/us/app/apple-store/id375380948?mt=8
This will open AppStore on "Apple Store" apps screen. You can test this also by replacing itms
with https
and pasting in your browser. The itms
part is the scheme
, and the rest are the parameters passed to the app.
Apps can register to handle "generic" URLS, so a URL like
http://9gag.com/gag/a1MXxR2
will be opened in 9GAG app (unless the user doesn't agree to it - he will be asked the first time he opens such a link in Safari, then it will be opened in Safari).
Note that not all apps support it yet, and there is no way (apart from asking the creators) to know if they ever will.
So to answer your question : there is no generic way to open a "random" app installed on someones phone. Especially not apps which don't support such opening via URLs (no matter whether with a custom scheme, or http(s)
).
Some of the popular apps (Facebook, Twitter, Chrome, ...) publish their schemes and you can implement them, not all will do so.
Note: this all applies to non-jailbroken phones.