Trying to send facebook notification, results in “sorry, something went wrong” response

房东的猫 提交于 2019-12-11 09:04:45

问题


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.

For any test that I do I get the html page as a response which states "Sorry, something went wrong"

what did went wrong?!

Thanks in advance!


回答1:


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.



来源:https://stackoverflow.com/questions/14872984/trying-to-send-facebook-notification-results-in-sorry-something-went-wrong-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!