bencallis
bencallis

Reputation: 3678

iOS: Invite Friend via Email, SMS or Facebook

I am looking to add an invite friend screen to my application. Ideally I would like to to support invitations via email, SMS or Facebook (similar to path).

The invite will only be a message informing the user that the application exists and a link to the App Store to download it.

Is there an open source library which does such thing? Alterntively can anyone reccomend any tutorials which could help?

Path

P

Upvotes: 2

Views: 5433

Answers (2)

John
John

Reputation: 1717

Bit late, but this might help... https://libraries.io/cocoapods/AppSociallySDK

Upvotes: 2

Vincent
Vincent

Reputation: 1386

I found some information in this book. "The Business of iPhone and iPad App Development: Making and Marketing Apps". Chapter 5, Social inception: Promoting your apps with apps. In this chapter, it mentions about Email, and Facebook.

As to SMS, it's easy to implement, here is some sample code.

    MFMessageComposeViewController *smsController = [[MFMessageComposeViewController alloc] init];
    smsController.messageComposeDelegate = self;
    smsController.body = @"check out apps, link";
    [self presentModalViewController:smsController animated:YES];
    [smsController release];

sampel code for email:

MFMailComposeViewController *mcvc = [[MFMailComposeViewController alloc] init];
mcvc.mailComposeDelegate = self;
[mcvc setSubject:@"Check out this app"];
UIImage *image = [UIImage imageNamed:@"Icon"]; 
//include your app icon here
[mcvc addAttachmentData:UIImageJPEGRepresentation(image, 1) mimeType:@"image/jpg" fileName:@"icon.jpg"]; 
// your message and link
NSString *defaultBody =@"check out this cool apps, link...."
[mcvc setMessageBody:defaultBody isHTML:YES];
[self presentViewController:mcvc animated:YES completion:nil];

For facebook, it's a little bit complicated. You have to use facebook SDK and reference their document. http://developers.facebook.com/ios/

NSMutableDictionary *dict = [NSMutableDictionary dictionary];
[dict setObject:@"This is a great apps, link..." forKey:@"message"];
[facebook requestWithGraphPath:@"me" andParams:dict andHttpMethod:@"POST" andDelegate:self];

Upvotes: 7

Related Questions