在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