我是IOS开发的新手? 在我的项目中,我想邀请Facebook的朋友。当安装Facebook应用程序并且在两种情况下都没有安装我想邀请我的朋友吗? 怎么做
//下面是我的代码
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];
答案 0 :(得分:0)
据我所知,您正在尝试发送应用程序到用户请求以邀请用户的Facebook好友开始使用您的应用程序,对吗?在这里查看第一个答案,Paul建议使用Facebook SDK进行有效的方法:How to send add friend request (to facebook user) from iOS application?