gpt4 book ai didi

ios - 在 iOS 9 中邀请 Facebook 好友

转载 作者:行者123 更新时间:2023-11-29 01:20:47 25 4
gpt4 key购买 nike

我在我的 iOS 应用程序中使用此代码邀请 friend

[FBWebDialogs presentRequestsDialogModallyWithSession:nil
message:@"Test1"
title:@"Title 1"
parameters:parameters
handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error)
{
if(error)
{
NSLog(@"Some errorr: %@", [error description]);
UIAlertView *alrt = [[UIAlertView alloc] initWithTitle:@"Invitiation Sending Failed" message:@"Unable to send inviation at this Moment, please make sure your are connected with internet" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alrt show];

}
else
{
if (![resultURL query])
{
return;
}

NSDictionary *params = [self parseURLParams:[resultURL query]];
NSMutableArray *recipientIDs = [[NSMutableArray alloc] init] ;
for (NSString *paramKey in params)
{
if ([paramKey hasPrefix:@"to["])
{
[recipientIDs addObject:[params objectForKey:paramKey]];
}
}
if ([params objectForKey:@"request"])
{
NSLog(@"Request ID: %@", [params objectForKey:@"request"]);
}
if ([recipientIDs count] > 0)
{
//[self showMessage:@"Sent request successfully."];
//NSLog(@"Recipient ID(s): %@", recipientIDs);
UIAlertView *alrt = [[UIAlertView alloc] initWithTitle:@"Success!" message:@"Invitation(s) sent successfuly!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alrt show];

}

}
}
friendCache:nil];

//示例代码2

 [FBWebDialogs
presentRequestsDialogModallyWithSession:nil
message:@"Yeeeeep Check my app"
title:@"Burp War"
parameters:nil
handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
if (error) {
// Error launching the dialog or sending the request.
NSLog(@"Error sending request.");
} else {
if (result == FBWebDialogResultDialogNotCompleted) {
// User clicked the "x" icon
NSLog(@"User canceled request.");
} else {
// Handle the send request callback
NSDictionary *urlParams = [self parseURLParams:[resultURL query]];
if (![urlParams valueForKey:@"request"]) {
// User clicked the Cancel button
NSLog(@"User canceled request.");
} else {
// User clicked the Send button
NSString *requestID = [urlParams valueForKey:@"request"];
NSLog(@"Request ID: %@", requestID);
}
}
}
}];

但不幸的是,这不起作用,出现错误“游戏请求仅适用于游戏应用程序”。如何获取 friend 的电子邮件ID?提前致谢。

最佳答案

新的图形 api 仅支持游戏的用户邀请好友 https://developers.facebook.com/docs/graph-api/reference/v2.5/user/invitable_friends

https://developers.facebook.com/docs/games/services/gamerequests

Note: There is no way for apps to obtain email addresses for a user's friends.

facebook 政策声明指出这一点

How can I get facebook friends list email addresses?

How to get a facebook user's friends emails

关于ios - 在 iOS 9 中邀请 Facebook 好友,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34625031/

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