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

后端 未结 4 815
失恋的感觉
失恋的感觉 2021-01-01 12:12

This is the code I use:

let instagramURL = NSURL(string: \"instagram://app\")
if UIApplication.shared.canOpenURL(instagramURL! as URL) {
  //Code
} else {
           


        
4条回答
  •  一个人的身影
    2021-01-01 12:30

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

    LSApplicationQueriesSchemes
    
        instagram
    
    

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

提交回复
热议问题