Facebook邀请人们为我的应用程序从用户好友列表
问题描述:
我正在使用Facebook的ios好友请求对话框向我的应用程序的用户发送邀请。在Facebook宣布关闭API之后,它停止了工作,有没有人知道如何邀请人们申请ios。Facebook邀请人们为我的应用程序从用户好友列表
答
Facebook已经宣布,这将只适用于游戏应用程序,但可以做到这一点。只需在Facebook应用上设置应用的画布网址并使用faecbook请求对话框即可。这对于任何应用程序都是非常有用的功能.Facebook正在开发此功能以便于使用。
答
您可以使用此代码。
- (void)inviteFriendsOfFacebook
{
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:[mArrTempSelected componentsJoinedByString:@","], @"suggestions", nil];
[FBWebDialogs presentRequestsDialogModallyWithSession:nil
message:textView.text
title:nil
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
{
[Helper showAlertForMessage:@"Invitation Sent Successfully." title:nil cancelButton:@"Ok" otherButton:nil andDelegate:nil withTag:0];
}
}}];
}
Facebook将其列在其常见问题解答中:https://developers.facebook.com/docs/apps/faq#invite_to_app – WizKid 2015-03-03 06:27:49
@WizKid所以我必须使用消息对话框发送邀请..我是吗? – vivek 2015-03-03 06:44:48
是的,这是正确的 – WizKid 2015-03-03 06:47:02