canOpenUrl - This app is not allowed to query for scheme instragram
Your
LSApplicationQueriesSchemes
entry should only have schemes. There's no point to the second entry.<key>LSApplicationQueriesSchemes</key>
<array>
<string>instagram</string>
</array>Read the error. You are trying to open the URL with a typo in the scheme. Fix your reference to
instragram
in your call tocanOpenURL:
.
canOpenURL: failed for URL: instagram://app - error: This app is not allowed to query for scheme instagram
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.
failed for URL: message:// - error: This app is not allowed to query for scheme message
This does not work in the simulator, only on a real device.
Don't forget to configure your Info.plist and add entry to message under this key: LSApplicationQueriesSchemes, so you can query it with canOpenURL.
Example Info.plist file that whitelists the URl query schemes :
<key>LSApplicationQueriesSchemes</key>
<array>
<string>googlegmail</string>
<string>mailto</string>
<string>instagram</string>
<string>message</string>
</array>
You can also consider to use the mailto schema
let mailURL = URL(string: "mailto://example@example.com")
Custom URL Scheme Error : This app is not allowed to query for scheme
You are doing it in opposite way if you register:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>com.test.clientEndApp</string>
</array>
You should be calling this scheme
let urlsrting = "com.test.clientEndApp://provideInfo?username='Debanjan'"
An you were missing com.test.
from your LSApplicationQueriesSchemes
This app is not allowed to query for scheme error (have listed correct info.plist info)
LSApplicationQueriesSchemes is an array.
<key>LSApplicationQueriesSchemes</key>
<array>
<string>scheme1</string>
<string>scheme2</string>
</array>
failed for URL: snapchat:// - error: This app is not allowed to query for scheme snapchat
You need to add the schemes you try to open in your app in the info.plist
file. Add these lines in your info.plist
right after the first <dict>
keyword you see when you open it as source code.
<key>LSApplicationQueriesSchemes</key>
<array>
<string>snapchat</string>
</array>
Related Topics
How to Copy SQLite Database When Application Is Launched in iOS
Xcode 4: Creating a Uiview Xib, Not Properly Connecting
What Is a Monospace Font in iOS
iOS 9 Uitableview Separators Insets (Significant Left Margin)
iOS Push Notification Banner Shown Twice for a Single Push
How to Use Networkreachabilitymanager in Alamofire
Today App Extension Widget Tap to Open Containing App
iOS How to Detect Programmatically When Top View Controller Is Popped
iOS Storyboard Passing Data Navigationviewcontroller
Setting Constraints Programmatically
How to Get Managedobjectcontext for Viewcontroller Other Than Getting It from Appdelegate
How to Disable Afnetworking Cache
Custom Url to Launch Facebook Messenger on iOS