C# 如何使用 Facebook API 发送邀请请求?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/921098/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I send an invitation request using the Facebook API?
提问by Ahmy
I would like to send an invitation request from my Facebook application written in C#.
我想从我用 C# 编写的 Facebook 应用程序发送邀请请求。
Here is what I tried:
这是我尝试过的:
_fbService.API.notifications.sendEmail(DataList1.DataKeys[e.Item.ItemIndex].ToString(),"Invitation to play a game", "You are invited to play the game","");
This does not work, it only sends a notification, not a request.
What am I doing wrong?
这不起作用,它只发送通知,而不是请求。
我究竟做错了什么?
采纳答案by Ajw
If you are asking how you can send invitations to users who have not authorized your application (i.e. not inviting your application users to use a new feature or participate in an activity), then you can't with the API.
如果您要问如何向未授权您的应用程序的用户发送邀请(即不邀请您的应用程序用户使用新功能或参与活动),那么您不能使用 API。
From the API documentation - Notifications.sendEmail:
从 API 文档 - Notifications.sendEmail:
Sends an email to the specified users, who have both authorized your application and granted it the email extended permission.
向指定用户发送电子邮件,这些用户已授权您的应用程序并授予其电子邮件扩展权限。
The API function that did allow this was Notifications.sendRequestbut it has been disabled, perhaps due to consideration of abuse and security. See the documentation for the alternative.
确实允许这样做的 API 函数是Notifications.sendRequest,但它已被禁用,可能是出于滥用和安全的考虑。有关替代方案,请参阅文档。