gpt4 book ai didi

ios - 如何从 iOS 应用程序发送好友请求

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:46:47 24 4
gpt4 key购买 nike

我想从我的应用程序发送好友请求。我使用了以下代码

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"My Title", @"title",
@"Come check out my app.", @"message",
FrienduserId, @"id",
nil];
[FBWebDialogs
presentDialogModallyWithSession:nil
dialog:@"friends"
parameters:[params mutableCopy]
handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error){
if (error) {
NSLog(@"%@",error);
}
else
{
NSLog(@"done");
}
}];

它显示对话框,当我点击确认时它会给出消息抱歉出了点问题。我们正在努力尽快解决此问题。

我已经成功集成了 Facebook SDK。我得到了我的个人资料信息和我的 friend 列表。所以请帮我解决这个问题。

最佳答案

NSLog(@"%@",[app.Arr_Facebook_Frnd objectAtIndex:indexpath]);

NSString *str_id;
NSString *str_name;
NSString *str_link;

str_id = [[app.Arr_Facebook_Frnd objectAtIndex:indexpath] objectForKey:@"id"];
str_name = [[app.Arr_Facebook_Frnd objectAtIndex:indexpath] objectForKey:@"name"];
str_link = @"www.google.com";


NSDictionary *params = @{
@"name" : str_name,
@"caption" : @"",
@"description" : @"",
@"picture" : @"",
@"link" : str_link,
@"to":str_id,
};

// Invoke the dialog
[FBWebDialogs presentFeedDialogModallyWithSession:nil
parameters:params
handler:
^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
if (error) {
NSLog(@"Error publishing story.");
[self.indicator stopAnimating];
} else {
if (result == FBWebDialogResultDialogNotCompleted) {
NSLog(@"User canceled story publishing.");
[self.indicator stopAnimating];
} else {
NSLog(@"Story published.");
[self.indicator stopAnimating];
}
}}];

关于ios - 如何从 iOS 应用程序发送好友请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21575516/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com