I am making an as3 AIR app. I want to put phone numbers in the application. On an iPhone, when the user clicks the "phone number" button it calls tel similar to this:
str = "tel:1-415-555-1212";
var urlReq:URLReq = new URLRequest(str);
navigateToURL(urlReq);
This puts the phone number in the users native dialer (on iOS it actually dials it for you and sends also). However, on iPad it does nothing. I want to first check if tel is supported. If it is, do normally. If it is not, show a popup with the phone number. I want to do it pretty much exactly the same for android phones and tablets as well.
As far as I know, there is no way to do this in AIR alone. In Objective-C, you can do this with a method called
canOpenURL
. Fairly trivial. There is no AIR equivalent.So you have two options:
tel
URI. It is unlikely, given Apple's general practices, but possible.Edit: I ended up needing this feature myself yesterday, so I hunted down an ANE that provides the functionality. Huge thanks to StickSports for releasing all of their ANEs. https://github.com/StickSports/ANE-Can-Open-URL
Example usage: