Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

This is the code I use:

let instagramURL = NSURL(string: "instagram://app") if UIApplication.shared.canOpenURL(instagramURL! as URL) {   //Code } else {   //Showing message "Please install the Instagram application" } 

I am getting unsuccessful to enter in if loop.

I get this error:

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

I have also Login with Instagram in my device.

like image 306
Krunal Patel Avatar asked May 15 '17 09:05

Krunal Patel


2 Answers

Right click on your plist file and open it as source code. Then copy and paste below code:

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

Note: One thing you have to keep in mind that it will not work on simulator. You need a real device for this.

like image 181
Maddy Avatar answered Sep 20 '22 16:09

Maddy


Open your plist as source code and paste following code:

<key>LSApplicationQueriesSchemes</key> <array>     <string>instagram</string> </array> 
like image 23
Codobux Avatar answered Sep 18 '22 16:09

Codobux