My info.plist
<key>LSApplicationQueriesSchemes</key>
<array>
<string>telprompt</string>
<string>tel</string>
</array>
This piece of code in objective c works.
NSString *phoneNumber = @"telprompt:0426155885";
NSURL *url = [NSURL URLWithString:phoneNumber];
if ([[UIApplication sharedApplication] canOpenURL:url]) {
[[UIApplication sharedApplication] openURL:url];
}This piece of code in swift DOESTN WORK!
let urlString = "telprompt:0426155885";
let url = NSURL(fileURLWithPath: urlString);
if UIApplication.sharedApplication().canOpenURL(url) {
UIApplication.sharedApplication().openURL(url);
}the error say
-canOpenURL: failed for URL: "telprompt:0426155885 -- file:///" - error: "This app is not allowed to query for scheme file
They are the in the same project in 2 different controller. Im slowly migrating my code to swift.
The question is why doesnt work in Swift? and how to make it work?