canOpenURL: without using LSApplicationQueriesSchemes

438 Views Asked by At

I'm calling canOpenURL: without LSApplicationQueriesSchemes in my Info.plist, yet this call returns true:

BOOL canMakePhoneCalls = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"tel:+123"]];

  1. If I use a different URL (e.g., "https://..." or even @"xxxxxxxxtel:+123"), canOpenURL: returns false, as expected.

  2. if I add LSApplicationQueriesSchemes to my Info.plist but with an empty list of schemes, the above code still returns true.

  3. Worse, if I specify "https" as one of the schemes, canOpenURL: with an https URL still returns false.

My deployment target is iOS 12 (specifically, long after iOS 9).

I'm expecting canOpenURL: to always return false since LSApplicationQueriesSchemes is missing. Why is it (1) returning true for the telephone scheme when LSApplicationQueriesSchemes is missing, and (2) not returning true when I specify "https" in LSApplicationQueriesSchemes?

(This might not mean anything, but Xcode doesn't show a readable text string for LSApplicationQueriesSchemes when "Raw Keys & Values" is off -- it still shows "LSApplicationQueriesSchemes".)

0

There are 0 best solutions below