试图发送Facebook通知,导致“抱歉,发生错误”响应 [英] Trying to send facebook notification, results in "sorry, something went wrong" response
问题描述
从标题来看,我正在尝试使用Facebook的通知api。我已经阅读了文档,我正在尝试对图形进行POST,如下所示:
As from the title I am trying to use tha facebook notifications api. I have read the documentation and I am trying to do a POST to the graph like the one following:
String notificationURL =
"https://graph.facebook.com/" +
String.valueOf(facebookUserId) +
"/notifications?" +
"access_token=444146492324422|8LOOIj7xPT2LFlx14_3SqKCDgVc" +
"&href=https://apps.facebook.com/Nmctesting" +
"&template=@["+String.valueOf(facebookUserId)+"]! You have won!!";
访问令牌是从图形查询返回的令牌:
the access token is the one returned from the graph query :
String appAccessURL = "https://graph.facebook.com/oauth/access_token?client_id=444146492324422"+
"&client_secret=[MYAPPSECRET]" +
"&grant_type=client_credentials";
我尝试使用登录用户的访问令牌,当时的管理员,但它没有工作。
I have tried to use the access token of the logged in user, who was the admin at that time, but It didn't work.
对于任何我做的测试,我将html页面作为响应,其中指出对不起,出现问题
For any test that I do I get the html page as a response which states "Sorry, something went wrong"
发生了什么问题?
提前感谢
推荐答案
确保您的FACEBOOK_USER_ID是一个有效的Facebook用户名。您可能需要首先将URI转义为它。如果它是正确的用户名,https://www.facebook.com/FACEBOOK_USER_ID将是用户的Facebook页面,所以尝试在浏览器中尝试其他任何内容。
Make sure your FACEBOOK_USER_ID is a valid facebook username. You may need to URI escape it first. If it's the correct username, https://www.facebook.com/FACEBOOK_USER_ID will be the user's facebook page, so try hitting it in a browser before you try anything else.
这篇关于试图发送Facebook通知,导致“抱歉,发生错误”响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!