iOS撥打電話功能的實現

2021-07-08 22:16:39 字數 950 閱讀 1274

1、呼叫 自帶mail
2、呼叫 **phone

ios應用內撥打**結束後返回應用

一般在應用中撥打**的方式是:

使用這種方式撥打**時,當使用者結束通話後,iphone介面會停留在**介面。

用如下方式,可以使得使用者結束通話後自動返回到應用:

uiwebview*callwebview =[[uiwebview alloc] init];

nsurl *telurl =[nsurl urlwithstring:@"tel:10086"];// 貌似tel:// 或者 tel: 都行

[callwebview loadrequest:[nsurlrequest requestwithurl:telurl]];

//記得新增到view上

[self.view addsubview:callwebview];

還有一種私有方法:(可能不能通過審核)

3、呼叫 sms

4、呼叫自帶 瀏覽器 safari

呼叫phone可以傳遞號碼,呼叫sms 只能設定號碼,不能初始化sms內容。

若需要傳遞內容可以做如下操作:

加入:messageui.framework

#import 實現**:mfmessagecomposeviewcontrollerdelegate

呼叫sendsms函式

//內容,收件人列表

- (void)sendsms:(nsstring *)bodyofmessage recipientlist:(nsarray *)recipients

} // 處理傳送完的響應結果

- (void)messagecomposeviewcontroller:(mfmessagecomposeviewcontroller *)controller didfinishwithresult:(messagecomposeresult)result

iOS撥打電話

1,這種方法,撥打完 回不到原來的應用,會停留在通訊錄裡,而且是直接撥打,不彈出提示 nsmutablestring str nsmutablestring alloc initwithformat tel 186 x6979 nslog str str 2,這種方法,打完 後還會回到原來的程式,也...

iOS 撥打電話

1.這種方法,撥打完 回不到原來的應用,會停留在通訊錄裡,而且是直接撥打,不彈出提示 nsmutablestring str nsmutablestring alloc initwithformat tel 186 x6979 2.這種方法,打完 後還會回到原來的程式,也會彈出提示,推薦這種 nsm...

iOS程式撥打電話

三種方法,各有不同,拿來給大家分享,希望給大家有所幫助 1,這種方法,撥打完 回不到原來的應用,會停留在通訊錄裡,而且是直接撥打,不彈出提示 nsmutablestring str nsmutablestring alloc initwithformat tel 186 x6979 nslog st...