2012-12-07 3 views
2

내 응용 프로그램에 초대 친구 화면을 추가하려고합니다. 이상적으로는 이메일, SMS 또는 Facebook (경로와 유사)을 통해 초대장을 보내고 싶습니다. 초대를iOS : 전자 메일, SMS 또는 Facebook을 통해 친구 초대

은 응용 프로그램이 존재하는 사용자 및 다운로드 할 수있는 앱 스토어로 연결되는 링크를 알리는 메시지가 될 것입니다.

그런 일을하는 오픈 소스 라이브러리가 있습니까? 대체로 누구든지 도움이 될만한 튜토리얼을 추천 할 수 있습니까?

Path

P

답변

7

는이 책에서 몇 가지 정보를 발견했다. "아이폰 및 아이 패드 앱 개발 사업 : 앱 만들기 및 마케팅". 5 장. 사회적 개념 : 앱으로 앱 홍보. 이 장에서는 Email 및 Facebook에 대해 언급합니다.

SMS의 경우 구현하기가 쉽지만 여기서는 몇 가지 샘플 코드가 있습니다. 이메일

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

sampel 코드 : 페이스 북의 경우

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 [email protected]"check out this cool apps, link...." 
[mcvc setMessageBody:defaultBody isHTML:YES]; 
[self presentViewController:mcvc animated:YES completion:nil]; 

, 그것은 조금 복잡합니다. 당신은 페이스 북 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]; 
관련 문제