如何编码邀请雅虎朋友在ios7

时间:2014-04-09 05:58:00

标签: ios7 yahoo

如何邀请雅虎朋友。按钮点击雅虎登录页面应该是打开的。

登录页面我希望发送邀请给我的朋友.plz建议我该怎么办?

对于Facebook我们使用以下代码,但我们如何在雅虎做。

-(IBAction)InviteYourFriendsBtnClk:(id)sender
{
    NSMutableDictionary* params =   [NSMutableDictionary dictionaryWithObjectsAndKeys:nil];

    [FBWebDialogs presentRequestsDialogModallyWithSession:nil
                                              message:[NSString stringWithFormat:@"I just smashed  friends! Can you beat it?"]
                                                title:@"StopNSwap"
                                           parameters:params
                                              handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
                                                  if (error) {
                                                      // Case A: Error launching the dialog or sending request.
                                                      NSLog(@"Error sending request.");
                                                  } else {
                                                      if (result == FBWebDialogResultDialogNotCompleted) {
                                                          // Case B: User clicked the "x" icon
                                                          NSLog(@"User canceled request.");
                                                      } else {

                                                          NSLog(@"Request Sent.");
                                                      }
                                                  }}
                                          friendCache:nil];

}

1 个答案:

答案 0 :(得分:0)

最简单的方法是向要求关注雅虎页面的人发送电子邮件。

  

//来自您的活动视图控制器   if([MFMailComposeViewController canSendMail]){       MFMailComposeViewController * mailCont = [[MFMailComposeViewController alloc] init];       mailCont.mailComposeDelegate = self;

[mailCont setSubject:@"Follow us on Yahoo!"];
[mailCont setToRecipients:[NSArray arrayWithObject:@"stkovf@jaydz49.com"]];
[mailCont setMessageBody:@"Follow our apps yahoo page" isHTML:NO];

[self presentModalViewController:mailCont animated:YES];
[mailCont release]; }
     

//然后实现委托方法    - (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error   {       [self dismissModalViewControllerAnimated:YES]; }