Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to register an app to respond to a custom URL scheme opening request?

Tags:

ios

iphone

ipad

Like this:

NSString *stringURL = @"appname://";
NSURL *url = [NSURL URLWithString:stringURL];
[[UIApplication sharedApplication] openURL:url];

I slightly remember it was necessary to write a value-key to Info.plist. How?

like image 257
openfrog Avatar asked Nov 20 '11 12:11

openfrog


People also ask

How do I register a URL scheme?

Register your URL schemeRegister your scheme in Xcode from the Info tab of your project settings. Update the URL Types section to declare all of the URL schemes your app supports, as shown in the following illustration. In the URL Schemes box, specify the prefix you use for your URLs.

How do I find the URL scheme of an app?

Go to the Play store, find the app and view its page. Copy the URL from the browser address bar. Make a note of this as the "Android Fallback URL." You'll see a parameter called "id" followed by an equal sign (=).

What is a custom URL scheme?

Custom URL schemes provide a way to reference inside your app. Users can open a custom URL in the browser or tap in any link. Other apps can also trigger your app to launch with specific context data; for example, a photo library app might display a specified image.


2 Answers

Add this to plist screenshot.

The app will by called by @"readtext://" url

like image 181
d.lebedev Avatar answered Oct 05 '22 05:10

d.lebedev


This seems to be the question that I answered (with screenshots & source code) here.

enter image description here

And I've posted a full walkthrough of how to do this on my blog.

like image 25
Mike Gledhill Avatar answered Oct 05 '22 07:10

Mike Gledhill