I need to be able to launch my iOS app from the Safari browser. So I went to my .plist
file in xcode and added an item to my URL Schemes and entered in the string of myappname
.
Now if I go to Safari, and type myappname://
in the URL address bar and submit it, it shows me a UIAlertView
that says Open this page in "MyAppName"?
with options for Cancel
and Open
.
If I tap Open
it successfully opens my app, however I want to do this without the UIAlertView
popping up with that message.
I have done some quick searching online and it looks like people keep having trouble with this whenever a new iOS update comes out and I can't seem to find a recent solution or answer.
I am on an iPhone 4s with iOS 7.1, and I'm using xcode 5.1 if that makes any difference.
Also, I have been using an app available in the App Store called "Frontback" that successfully does this same thing without the UIAlertView
showing in Safari so this is definitely possible.
Thanks for the help.
I use this method in my app without getting a UIAlertView
. It just goes straight to the app.
I had a similar issue when I first started implementing it. I suspect that it's not a problem with myappname://
, but possibly a problem with how you added the URL Scheme.
Make sure to assign your custom value (myappname
) to the URL Identifier
object (com.mycompany.myappname
). The URL identifier
should be a String and the URL Schemes
should be an array with your custom value being a String.
The XML version of your .plist should look like this:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>com.mycompany.myappname</string>
<key>CFBundleURLSchemes</key>
<array>
<string>myappname</string>
</array>
</dict>
</array>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With