polin 发表于 2016-1-2 13:24:29

In-App SMS in iPhone OS 4.0(转)

  With iPhone OS 4.0 and above we can send SMS right from within our application. Now our application can invoke the SMS composer screen justlike we invoke the Mail composer screen. We need to invoke an instance of MFMessageComposeViewController and assign the delegate, recipients and body of the SMS. The code snippet is provided below:
  
   MFMessageComposeViewController *controller = [[ init] autorelease];
if()
{
controller.body = @"A test message from http://www.macoscoders.com";
controller.recipients = ;
controller.messageComposeDelegate = self;
;
}
  
  The MFMessageComposeViewController invoking class can implement the below delegate method to know the result of the SMS sending operation.
  - (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result
  You can download sample XCode project source here
  
About Me: Anish:
Mac OS X software development is my bread winner with over 6 years of experience.Expertise in Color Management, TWAIN Scanner drivers on Mac OS X, Photoshop Filter andImport Plugin development on Mac OS X, iPhone. As an hobby I love to work on PHP, Flex, AIR, Photoshop. Check the 'About' page for more.
Readers who viewed this page, also viewed:

[*]iPhone Apple Push Notification Service (APNS)
[*]Supporting both Retina Display and Normal Display
[*]Uploading Images To Facebook Wall Using FBConnect
[*]Tab Bar Icons
[*]Powered by Where did they go from here?
页: [1]
查看完整版本: In-App SMS in iPhone OS 4.0(转)