I have a custom defined URL scheme and a TARGET app that registered this scheme to be recognized.
When I launch a WEB app in mobile Safari and I push a button in the WEB App, there is an URL link provided by the button, and a dedicated TARGET application is launched - which is the desired behaviour.
However if I launch a native SOURCE app, and implement an action on a UIButton, and there I call the appdelegate to openURL and pass the same url that is used from the web app, TARGET app is not launched.
The [UIApplication canOpenURL] check even returns NO, which is strange, since TARGET App DID register that custom URL Scheme correctly, otherwise it would not work from the web app.
PS:SOURCE and TARGET are just convenient names for SO.
NSString *urlString = @"nda://nda.undernda/actionundernda?someparamters..";
BOOL isURLSchemeRegistered = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:urlString]];
if (isURLSchemeRegistered == YES)
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]];
//go to appstore
Ok ,so the problem was that he url had characters that were not escaped using UTF8 encoding.
NSString *urlString = @"sorry..can't show this :("; NSString *escapedUrlString = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSURL *url =[ NSURL URLWithString:escapedUrlString]; [[UIApplication sharedApplication] openURL:url];