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

2

5

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?

Peridot answered 20/11, 2011 at 12:25 Comment(1)
You could see a detailed illustration with the updated 2015 version for Xcode 6 here https://mcmap.net/q/219138/-fbsdklog-cannot-use-the-facebook-app-or-safari-to-authorize-fb-is-not-registered-as-a-url-schemeDisplease
T
7

Add this to plist screenshot.

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

Tachistoscope answered 20/11, 2011 at 12:32 Comment(1)
Xcode 4 looks completely different! Must I really repeat the bundle identifier for the URL type? It also asks for an Icon and Role.Peridot
S
1

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.

Supposed answered 28/4, 2014 at 7:10 Comment(1)
You're welcome. It's simple, isn't it, once you can see an example ? It turns a two-hour headache into a 5-minute job !!Supposed

© 2022 - 2024 — McMap. All rights reserved.