send sms programmatically on iPhone

吃可爱长大的小学妹 提交于 2019-12-31 07:31:19

问题


in my application I want to send predefine smstext to one single number on certain event , how to send sms like that?


回答1:


You cannot send an SMS without user intervention. However, with the user's "approval" there are two ways to send an SMS from an iPhone application.

  1. Apple's MessageComposer sample project has code that shows you how to send an SMS using the MFMessageComposeViewController class.
  2. Alternatively, you can use:

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms:1-408-555-1212"]];
    


来源:https://stackoverflow.com/questions/3819013/send-sms-programmatically-on-iphone

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!