iOS呼叫撥號,簡訊,郵件,瀏覽器,AppStore,應用評分
1.呼叫系統撥號
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:電話號碼"]];
2.呼叫系統簡訊
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms://電話號碼"]];
2.1.如果要設定預設的簡訊內容
這個設定預設簡訊的時候,是在你的APP中會跳轉出一個簡訊的編輯介面,仍然在自己APP的介面裡面,並非跳轉到系統的簡訊介面
同時這個預設的內容使用者是可以修改過後在傳送的,相當於編輯狀態
// 匯入標頭檔案
#import <MessageUI/MFMessageComposeViewController.h>
// 新增代理
MFMessageComposeViewControllerDelegate
- (void)sendSMS{
MFMessageComposeViewController *messageViewController = [[MFMessageComposeViewController alloc] init];
messageViewController.messageComposeDelegate = self;
if ([MFMessageComposeViewController canSendText]) {//判斷能否傳送簡訊
messageViewController.recipients = @[@"手機號碼1",@"手機號碼2"]; // 新增收件人號碼,可以新增多個
messageViewController.body = @"要傳送的簡訊內容"; // 要傳送的內容
[self presentViewController:messageViewController animated:YES completion:nil];
}
}
#pragma mark - MFMessageComposeViewControllerDelegate
- (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result{
//可以判斷簡訊傳送的結果
if (result == MessageComposeResultCancelled) {
NSLog(@"簡訊被取消");
}else if (result == MessageComposeResultSent) {
NSLog(@"簡訊傳送成功");
}else if (result == MessageComposeResultFailed) {
NSLog(@"簡訊傳送失敗");
}
}
3.呼叫郵件
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"mailto://收件人郵箱"]];
3.1.設定預設的郵件內容
跟上面設定簡訊的預設內容一樣
// 匯入標頭檔案
#import <MessageUI/MFMailComposeViewController.h>
// 新增代理
MFMailComposeViewControllerDelegate
- (void)sendMail{
MFMailComposeViewController * mcViewController = [[MFMailComposeViewController alloc] init];
mcViewController.mailComposeDelegate = self;
if ([MFMailComposeViewController canSendMail]) {
// 收件人
[mcViewController setToRecipients:@[@"郵箱地址1"]];
// 抄送
[mcViewController setCcRecipients:@[@"郵箱地址2",@"郵箱地址3"]];
// 密送
[mcViewController setBccRecipients:@[@"郵箱地址4"]];
// 主題
[mcViewController setSubject:@"郵件主題"];
// 內容
[mcViewController setMessageBody:@"郵件內容" isHTML:NO];
[self presentViewController:mcViewController animated:YES completion:nil];
}
}
#pragma mark - MFMailComposeViewControllerDelegate
- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error{
if (result == MessageComposeResultCancelled) {
NSLog(@"郵件被取消");
}else if (result == MessageComposeResultSent) {
NSLog(@"郵件傳送成功");
}else if (result == MessageComposeResultFailed) {
NSLog(@"郵件傳送失敗");
}
}
4.呼叫safari
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://網址"]];
5.呼叫APPStore介面
跳轉到APPStore的下載介面的時候擁有兩種情況,都是可以跳轉的
5.1跳轉到APPStore 官方下載介面
1).以itms-apps:
//或https://
開頭的應用詳情頁連結,跳轉到AppStore
//以itms-apps:為開頭,拼接下載地址
NSString *url = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=%@",@"1014939463"];
//以https://為開頭,拼接下載地址
NSString *url = [NSString stringWithFormat:@"https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=%@",@"1014939463"];
//跳轉到appstore
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
2).以itms://
為開頭的詳情連線,雖然是跳轉到 iTunes Store,但是開啟的仍然是應用的下載頁
//以itms://為頭拼接下載地址
NSString *url = [NSString stringWithFormat:@"itms://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=%@",@"1014939463"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
6.跳轉到應用評分頁
此時以itms-apps://
和itms://
開頭的連結都可以,而此時以https://
開頭的連結不可以
NSString *url = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@",@"1014939463"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
相關文章
- Dash應用瀏覽器端回撥常用方法總結瀏覽器
- iOS12系統應用傳送普通郵件構建郵件iOS
- 郵件和簡訊傳送
- Celery--簡訊與郵件
- 呼叫瀏覽器的爬蟲——selenium瀏覽器爬蟲
- js 呼叫瀏覽器複製功能JS瀏覽器
- 前端實現iPhone繞過AppStore從瀏覽器安裝App前端iPhoneAPP瀏覽器
- Python/Sqlite 程式:瀏覽器應用還是桌面應用?PythonSQLite瀏覽器
- 瀏覽器渲染簡述瀏覽器
- 抖音直播小號自動發評論 – 瀏覽器外掛瀏覽器
- iOS12系統應用傳送郵件中的附件iOS
- 瀏覽器跨 Tab 視窗通訊原理及應用實踐瀏覽器
- 【AppStore】一文讓你學會IOS應用上架AppstoreAPPiOS
- 影片號直播自動迴圈發評論-自動回覆評論 - 瀏覽器外掛瀏覽器
- Ooui:在瀏覽器中執行.NET應用UI瀏覽器
- 【轉載】SAP中用json資料格式呼叫http介面傳送簡訊郵件案例JSONHTTP
- 5分鐘教你搭建郵件伺服器的實用指南伺服器
- iOS12系統應用開發基礎教程傳送郵件iOS
- 條件註釋判斷瀏覽器版本瀏覽器
- Hyperf 完整專案-3-郵件-簡訊
- 如何重新整理瀏覽器的應用快取?瀏覽器快取
- 使用SAT跟蹤監控從瀏覽器開啟的SAP應用的效能和呼叫棧瀏覽器
- iOS app與瀏覽器深度連結 DeeperLinkiOSAPP瀏覽器
- 瀏覽器掃碼開啟Android/iOS App瀏覽器AndroidiOSAPP
- 瀏覽器呼叫攝像頭進行拍照程式瀏覽器
- 郵件營銷用純文字郵件還是html郵件HTML
- 【瀏覽器】瀏覽器基本工作原理瀏覽器
- 瀏覽器跨標籤通訊瀏覽器
- 【AppStore】聊一聊關於IOS應用上架Appstore稽核不透過的坑APPiOS
- 區分瀏覽器視口的尺寸瀏覽器
- Electron構建一個檔案瀏覽器應用(二)瀏覽器
- Web 應用安全性: 瀏覽器是如何工作的Web瀏覽器
- 記一次不完美的呼叫瀏覽器攝像頭介面(附微信ios取巧)瀏覽器iOS
- 基於騰訊瀏覽服務 TBS 實現應用內開啟並瀏覽 Office 檔案
- 瀏覽器呼叫介面正常,jmeter調不通的可能原因瀏覽器JMeter
- Chrome 瀏覽器修改 UA 模擬其它瀏覽器,包括移動瀏覽器Chrome瀏覽器
- 瀏覽器瀏覽器
- 替代Edge瀏覽器?微軟開發新的瀏覽器:採用Chrome核心瀏覽器微軟Chrome
- python用selenium開啟瀏覽器後瀏覽器關閉---解決辦法Python瀏覽器