Tutorial details

Sending A SMS | App Code for Sale | Preview

Sending A SMS | iOS Tutorial

How to send an sms text message from your app

Overview PAGE TOP

Reference: http://www.geekylemon.com/xcode-sms-sending

In this tutorial i will be showing you how to send an sms text message from your app

Features:

  • 1 Button

This is a great feature for sharing information from user to user from your app wether its there score from your game or general download this app link

ViewController.h PAGE TOP

#import <UIKit/UIKit.h>
#import "MessageUI/MessageUI.h"

@interface ViewController : UIViewController <MFMessageComposeViewControllerDelegate> {
}

- (IBAction)SendASMS:(id)sender;

@end

ViewController.m PAGE TOP

@implementation ViewController
- (IBAction)SendASMS:(id)sender {
MFMessageComposeViewController *textComposer = [[MFMessageComposeViewController alloc] init];
[textComposer setMessageComposeDelegate:self];
if ([MFMessageComposeViewController canSendText]) {
[textComposer setRecipients:[NSArray arrayWithObjects: nil]];
[textComposer setBody:@""];
[self presentViewController:textComposer animated:YES completion:NULL];
} else {
NSLog(@"Can't Open Text");
}
}

- (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result
{
switch (result) {
case MessageComposeResultCancelled:
NSLog(@"Cancelled");
break;
case MessageComposeResultFailed:
break;
case MessageComposeResultSent:
break;
default:
break;
}
[self dismissViewControllerAnimated:YES completion:NULL];
}
@end

Reference PAGE TOP

http://www.geekylemon.com/xcode-sms-sending

0 Comments Leave a comment

Please login in order to leave a comment.

Newest first
!

Sign-in to your Chupamobile Account.

The Easiest way to Launch your next App or Game.

Join Chupamobile and get instant access to thousands of ready made App and Game Templates.

Creating an account means you’re okay with Chupamobile’s Terms of Service and Privacy Policy.