How can I add a link to my app on the homescreen - iphone

On iphone my native app has an URL, so that if you type an url starting with myapp:// it will open my app and it will handle the URL and go to the relevant place.
Is there a way to get these urls as a web app bookmark on the iphone's homescreen?
EDIT: To put it another way, I want add a webapp to link to my native app.

This is not possible. Never will be, as duplicates may occur then, e.g. two web apps with goatse://…, as Apple cannot check web apps.

It is possible to add Web Clips without going into Safari, and to specify a custom URL. But the Apple docs say that Web Clips will only work if the protocol is http or https (i.e. not my app://)

Related

Opening Another Application From My App

this is my first question on the site so if i don't cover anything please let me know and i'll try and fix it :P
I'm trying to make my application load another app from inside the app. An example which i can use to make what I'm trying to do more clear is, I want to load FaceBook from my application without it loading a UIWebView. I would like to do this for Facebook, YouTube, Twitter & Instagram. Also if possible all going to specific areas on the site, so the Facebook profile, YouTube channel, Twitter Page & Instagram profile!
Also I know i would have to write an if statement for it to be, if the user has set application on their device then load in that application else if they don't then load in the web view
You want to use the URL schemes of the other apps. If you know the URL scheme of an app then you can use openUrl: to send a message to another application and bring it to the foreground.
After a quick search you can find some popular app url schemes here along with some examples.
You need to use URL Schemes, this wiki has the major ones listed
http://wiki.akosma.com/IPhone_URL_Schemes

How to implement my android algorithm on iOS?

I have an android app working this way:
User read QR-code with my specific URL
If the app installed it intercepts this URL and handles it somehow.
If app not installed standard browser opens this URL and it leads to Google play on app page.
When user install and run app first time it read browser's history and look for my URL.
If app found URL in browser's history then it handles this URL again.
Is it possible to implement this behavior on iPhone/iPad?
I suppose key features here are to read browser history and to intercept http URL's.
If this is impossible how would you implement this thing on iOS?
Thanks in advance for your help.
You can use custom application URLs in the form: myApp://... iOS will automatically launch the application if present. The logic for handling the 'not-installed' case has to be in the QR code scanning app. can be handled by the scanned website via a forwarding link using the iOS custom URL scheme (this might be useful for usage stats).
Additional info on implementing Custom URLs...

Detecting installed apps on iPhone with javascript or url

I am building a HTML5 based mobile web app for iPhone. I need to check whether user has specific application that I suggest. I heard that each iPhone application has unique URL scheme to detect their app indentity.
Therefore, I've read this article to get an idea.
Is it possible to register a http+domain-based URL Scheme for iPhone apps, like YouTube and Maps?
However, this is not perfect answer to make what I am trying to make.
here is what might happen
User clicks a recommendation app on mobile web browser.
Check with application iTunes URL and URL scheme.
If the user has the installed application, it returns 'installed'
==> In this case, the screen returns back to mobile browser.
If the user does not have the installed application, it returns 'uninstalled'
==> In this case, the screen moves to App Store.
I am running mobile web app with PHP language.
Thank you.
this is not possible I'm afraid. To be honest I'm glad, as there are real privacy concerns if any old web page can detect which apps I have installed.
That's definitely not a good thing!
UPDATE: If you're happy to go native, this library will do what you want.. http://www.cocoacontrols.com/platforms/ios/controls/ihasapp
If you know that a url scheme for the app exists then you can open it via a web link like this, "myapp://". With this there are some round about ways you can effectively check if a certain app exists.
See this related stackoverflow post

Providing A Failover URL When A Custom URL Scheme Cannot Be Handled

I have two iPhone apps that I've built that have their own custom URLs and are in the app store. Let's call them App A and App B.
App A's interface is a UIWebView that gets its markup from a remote server that I run. The behavior I want to implement in app A is this:
If a link is generated with the custom URL for App B, and App B is installed on the device, open App B. This is easily done by checking UIApplication canOpenURL: and, if it returns YES, calling UIApplication openURL:.
If a link is generated with the custom URL for App B, and App B is not installed on the device, go to the app store page for App B.
Here is how I plan on handling that second one:
Include a URL parameter in the custom URL that contains the link to the app store page for App B. If canOpenURL: returns NO for the whole URL, open the URL specified by that parameter instead.
That should work. But it feels a bit hacky because it means App A has to know how to parse the custom URL for App B to retrieve the alternate link. That seems to be less-than-ideal encapsulation. Is there some other convention I should be using to provide the failover URL when canOpenURL: returns NO?
Will you always be opening these URLs for AppB from within AppA?
If so, then why do you need to add the link to the App Store page for AppB in the URL?
Why can't AppA already "know" the App Store URL for AppB, and if "canOpenURL" returns NO for the Custom URL Scheme, then it will just send the user to that App Store page?
This seems like a much cleaner solution.
PS: I know this is an old question, but the question has a couple of upvotes, and hasn't been answered, so perhaps this will help someone...

iPhone: launch app with YouTube URL?

I want to register a custom URL scheme that will enable my app to be launched whenever the user goes to a YouTube URL (http://www.youtube.com/watch?v=VIDEO_IDENTIFIER) in the browser.
Is this possible?
Edit:
After poking around I realized that YouTube's URL scheme is simply youtube://. What I want to do is that whenever there is a call to YouTube with the URL scheme, I want my app to be launched instead of the YouTube app - is this possible? What happens when there are conflicting URL schemes?
URL scheme is the thing preceding ://. It means you can't assign your app to handle youtube urls or any other http urls.
Update
Although Apple mentions YouTube URL Scheme in the docs, in the context of implementing custom URL schemes only the part before :// can be specified.
Update 2
Regarding your updated question. I'm pretty sure Apple wants YouTube app launched for youtube:// URLs. Since I haven't found an explicit note about conflicting URL schemes, I can't tell how the OS chooses an app to launch in general for a custom URL scheme.
As for the URLs handled by the built-in apps, they are very likely to remain so, i.e. it's impossible to override a built-in app and handle an http:// or a youtube:// URL with your own app.
You can do that and it will work on the simulator but the app will never get past the App review process.
On a side note, why would you want to do such thing as redirect youtube urls to your app, it's at least confusing to the user.