问题
I have following code in html file:
<html>
<head>
<title>My Great Website</title>
</head>
<body>
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js">
</script>
<script>
FB.init({
appId:'156154681125939', cookie:true,
status:true, xfbml:true
});
FB.ui({ method: 'apprequests',
message: 'Here is a new Requests dialog...'});
</script>
</body>
</html>
I am using this code to send apprequests for my app (reference: http://developers.facebook.com/blog/post/464/)
Problem: I am able to load Request dialogue by above code, and it shows my friend list. Also I can send invited then. Say suppose I send the invite to friend "X" (provided "X" is not already using my app). Then in X's FB account, apprequest bookmark count is increases by 1. But when X is trying to see app invite, he actually cannot see any app invite received for my app. I have tried this with at least 5 users, all are getting their apprequest book incremented by 1 after I send the invite to them, but when they see the invite, there is actually no invite present.
Can anyone suggest me that what is the problem?
Note: My app is website (and not canvas app), also I have hosted above demo code on my server at http://www.gmarjil.com/a.html
回答1:
This is the expected behavior of non-canvas applications. Requests always redirect to the application's canvas URL and if it is not set the request is not displayed.
The request is still sent (this is why the requests count is increased), you can access it via the graph API (https://graph.facebook.com/{user_id}/apprequests, needs app access token).
回答2:
Even if your app is not a game you can give any url as the canvas uri in the facebook app setting.The url even if invalid will allow teh notifications to send.This solved my issue.
来源:https://stackoverflow.com/questions/8204433/facebook-apprequests-not-working