问题
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.
- Apple's MessageComposer sample project has code that shows you how to send an SMS using the MFMessageComposeViewController class.
Alternatively, you can use:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms:1-408-555-1212"]];
来源:https://stackoverflow.com/questions/3819013/send-sms-programmatically-on-iphone