canOpenURL failing for system-wide URL schemes

后端 未结 7 1930
-上瘾入骨i
-上瘾入骨i 2020-12-16 10:18

I\'m running iOS 9b5.

In my app, if a device can make a phone call, I want to color the text blue so it looks tappable. If not, I leave it black.

In order to

相关标签:
7条回答
  • 2020-12-16 11:15

    I think you might need to try this on an actual device, or just try it again. I just got this working on my iPhone 5, it looks like you don't even need to add it to the LSApplicationQueriesSchemes. If the app is built with Xcode 7 Beta 6 and you use canOpenURL or openURL like below it seems to work just fine on device.

    [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"tel:555-555-5555"]]

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:555-555-5555"]]

    On the iOS sim I still get the error:
    LaunchServices: ERROR: There is no registered handler for URL scheme tel
    -canOpenURL: failed for URL: "tel:555-555-5555" - error: "This app is not allowed to query for scheme tel"

    0 讨论(0)
提交回复
热议问题