3
votes

I get this error:

-canOpenURL: failed for URL: "instagram://app" - error: "(null)"

This is the code I use:

let instagramURL = NSURL(string: "instagram://app")!     
if (UIApplication.sharedApplication().canOpenURL(instagramURL)) {
    //some code
}

I added LSApplicationQueriesSchemes to my info.plist file

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>instagram</string>
</array>

And it seems to "recognise" the instagram scheme, cause when I use something else like "instagraam" I get a different error message (which makes sense):

-canOpenURL: failed for URL: "instagraam://app" - error: "This app is not allowed to query for scheme instagraam"

Am I missing something obvious?

1
See the related questions, e.g. stackoverflow.com/questions/32107315/… - Mats
I even read that beforehand - just thought it would only apply to "telprompt". Thanks, it works on a real device. - David Schmoecker

1 Answers

2
votes

As pointed out in the comments - this is in fact a duplicate of this.

On a real device it works, it's just weird output of the simulator.