DevC DevC - 1 year ago 135
iOS Question

canOpenUrl - This app is not allowed to query for scheme instragram

Im trying to add the Instagram url to my app in iOS9 however I am getting the following warning:

-canOpenURL: failed for URL: "instragram://media?id=MEDIA_ID" - error: "This app is not allowed to query for scheme instragram"

However, Ive added the following to the
in my

<string>instagram://media?id=MEDIA_ID</string>//this one seems to be the issue

Any help is greatly appreciated?


This is the code I am using to open instagram:

NSURL * instagramURL = [NSURL URLWithString:@"instragram://media?id=MEDIA_ID"];//edit: note, to anyone copy pasting this code, please notice the typo OP has in the url, that being "instragram" instead of "instagram". This typo was discovered after this StackOverflow question was posted.
if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
//do stuff
NSLog(@"NO instgram found");

based off this example.

Answer Source
  1. Your LSApplicationQueriesSchemes entry should only have schemes. There's no point to the second entry.

  2. Read the error. You are trying to open the URL with a typo in the scheme. Fix your reference to instragram in your call to canOpenURL:.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download