You should first check to make sure that UIApplication canOpenURL
before attempting to open it. This will also help identify what the problem might be. If UIApplication doesn't know how to handle the URL given this will return NO
. Here is what the documentation states specifically...
Returns whether an app can open a given URL resource. This method guarantees that that if openURL: is called, another app will be launched to handle it. It does not guarantee that the full URL is valid.
Example Usage:
NSString *urlString = [notif.userInfo objectForKey:@"urlMedia"];
NSURL* url = [NSURL URLWithString:urlString];
if ([[UIApplication sharedApplication] canOpenURL:url]) {
[[UIApplication sharedApplication] openURL:url];
}