在ionic项目用调用手机的打电话功能。开始还想找cordova和ng-cordova的插件那,如今H5实现起来特别方便。html
在cordova中全部的URL Schemes 都是服从于白名单的,因此要如今项目config.xml中添加android
<access origin="tel:*" launch-external="yes" />
Making a Phone Call from Within PhoneGap in Android and iOS ios
①html代码直接写就能够了安全
<a href="tel:15210203452">打电话</a> <a href="tel:10086">打10066</a>
②在controller中实现也就一句话app
$scope.callPhone=function(){ $window.location.href="tel:10085"; }
① iOS的实现须要借助插件,具体参照连接资料。
http://rickluna.com/wp/2012/02/making-a-phone-call-from-within-phonegap-in-android-and-ios/ionic
这个东西貌似直接用的话只能在ios中用ui
http://www.zhihu.com/question/19907735spa
可是在AIR apps中用自定义URL schemes调用别的apps是不容许的,AIR的安全模型对于schemes在http:,sms:,tel: ,mailto:, file: ,app: ,app-storage: ,vipaccess:和connectpro:中的限制是很严格的。
ios
http://jbguide.me/2015/03/21/launcher/
http://www.360doc.com/content/14/0901/16/9200790_406290994.shtml
http://www.w3chtml.com/html/url.html