我在本书中找到了一些信息."iPhone和iPad应用开发业务:制作和营销应用".第5章,社交启动:使用应用程序推广您的应用程序.在本章中,它提到了电子邮件和Facebook.
至于SMS,它很容易实现,这里有一些示例代码.
MFMessageComposeViewController *smsController = [[MFMessageComposeViewController alloc] init];
smsController.messageComposeDelegate = self;
smsController.body = @"check out apps, link";
[self presentModalViewController:smsController animated:YES];
[smsController release];
Run Code Online (Sandbox Code Playgroud)
电子邮件的样本代码:
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];
Run Code Online (Sandbox Code Playgroud)
对于Facebook来说,它有点复杂.你必须使用facebook SDK并引用他们的文档.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];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5165 次 |
| 最近记录: |