[Objective-C] IOS应用发送SMS短消息代码 →→→→→进入此内容的聊天室

来自 , 2020-11-18, 写在 Objective-C, 查看 185 次.
URL http://www.code666.cn/view/f19ec2b8
  1. //Import the MessageUI Framework into your project and
  2. //#import the header file into the “.h” file of your controller
  3. //where you want to open the In-App SMS sheet.
  4. -(IBAction) sendInAppSMS:(id) sender
  5. {
  6.     MFMessageComposeViewController *controller =
  7.         [[[MFMessageComposeViewController alloc] init] autorelease];
  8.     if([MFMessageComposeViewController canSendText])
  9.     {
  10.         controller.body = @"Hello from Mugunth";
  11.         controller.recipients = [NSArray arrayWithObjects:
  12.                 @"12345678", @"87654321", nil];
  13.         controller.messageComposeDelegate = self;
  14.         [self presentModalViewController:controller animated:YES];
  15.     }
  16. }
  17. //objectc/5246

回复 "IOS应用发送SMS短消息代码"

这儿你可以回复上面这条便签

captcha