not allowed to query for scheme 🍎 iOS

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

The app called canOpenURL for a scheme not listed in LSApplicationQueriesSchemes in Info.plist.

Seen on: iOS

Meaning

Since iOS 9, apps must declare schemes they query (up to 50). open(_:) works without it, but canOpenURL returns false.

Common causes

  • Scheme missing from LSApplicationQueriesSchemes
  • Plist entry in a different target
  • Typo in the scheme name

⚡ Quick fix

  1. Add the scheme (without ://) to LSApplicationQueriesSchemes
  2. Or skip canOpenURL and call open with a completion handler

Detailed fix by platform

XML

  1. swift
    <key>LSApplicationQueriesSchemes</key>
    <array>
      <string>whatsapp</string>
      <string>comgooglemaps</string>
    </array>

How to diagnose

  1. Plist — Scheme listed?
  2. Target — Right Info.plist?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.