iOS:UIApplication類的OpenURL方法

來源:互聯網
上載者:User

iOS:UIApplication類的OpenURL方法

1、調用app store介面方法

在實際開發中,往往要推薦自己其他應用和推薦自己的收費軟體,那麼我們就需要在程式中直接連接到app store的相應頁面。

實際上的做法很簡單,使用的還是UIApplication類的OpenURL方法:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"程式的相應串連"]];


2、調用其它應用的方法

// 調用 內建mail

[[UIApplicationsharedApplication] openURL:[NSURLURLWithString:@"mailto://admin@hzlzh.com"]];

// 調用 電話phone

[[UIApplication sharedApplication] openURL:[NSURLURLWithString:@"tel://8008808888"]];

// 調用 SMS

[[UIApplicationsharedApplication] openURL:[NSURL URLWithString:@"sms://800888"]];

// 調用內建 瀏覽器 safari

[[UIApplicationsharedApplication] openURL:[NSURLURLWithString:@"http://www.hzlzh.com"]];

// 調用 Remote

[[UIApplicationsharedApplication] openURL:[NSURL URLWithString:@"remote://fff"]];

調用phone可以傳遞號碼,調用SMS只能設定號碼,不能初始化SMS內容。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.