I was wondering if somebody can help me to solve this problem. I am trying to use FB.AppRequest() in Facebook SDK for Unity to implement an Invite feature . This is the code which I use.
if(FB.IsLoggedIn)
{
FB.AppRequest(
message: "Let's eat and be prosperous!",
title: "Let's eat and be prosperous!",
callback: InviteCallback
);
}
// ...
void InviteCallback(FBResult response)
{
// print response to console
}
The invitation dialog which I get can be seen here (link to Imgur). There is no "Invite" label on those buttons, and unsurprisingly, clicking them does not send any invitation. However, I can see the FBResult data, which is in the following format:
{
"request": "ABCD",
"to":
[
"EFGH",
"IJKL"
]
}
(more or less, since I haven't found a way to print new lines to Firebug console)
Additional information:
The result is the same regardless of the Sandbox setting.
The Unity version is 4.3.0f4
The Facebook SDK for Unity version is 4.3.4
The binary is hosted on an intranet server.
The Invite functionality in the Friend Smash example, hosted on the same server, doesn't work either. However, this is before the latest Friend Smash update (11/11/2013), whose Facebook functionalities I can't get to work yet.
Other Facebook functionalities (e.g. Init, Feed, API) work well.
I can't find any information about this on the internet. There are other questions about the Invite feature not working, but without the Facebook SDK for Unity, so I am not sure how they can be helpful to me.
Thanks a lot!
Just to clarify: the envelope button sends the invite, and it does so immediately when it is clicked.
If your app is in sandbox mode, people won't get notified when the request is sent. Look for the request in https://www.facebook.com/appcenter/requests as the recipient and see if the request shows up there.
If this still doesn't work, can you send me your fbresult data? unity-sdk#fb.com. thanks!
Related
I've created a Facebook app, linked it with a business, submitted and passed review, the business is verified, contracts signed, the app has leads_retrieval permission, the app status is now live.
I can test it under the webhooks link in the side menu, my end point receives the test data from Facebook. The data shown below is received by my server.
When I test using the lead ads testing tool I instantly get a 102, server error, and nothing is received by my server. See below for the message.
I've spent so long getting to this stage and every step has been painful!
Can anyone suggest why using the lead ads testing tool results in an error and what I can do to resolve the issue.
Cheers
I've been struggling with this too.. Apparently you can't use it on development apps anymore. Found the answer here: https://stackoverflow.com/a/57397525/8439792
I think I found your problem! It is when you subscribe to your apps. Here is the link that shows the subscribed_fields and scope should be:
https://stackoverflow.com/a/54713182/7313872
I was going straight from the demo and the subscribed_fields is set to 'feeds' and the scope was only manage_pages. You need to change it like in the example in the above link. I will also provide the snippets I changed below:
subscribed_fields - in subscribe apps function
FB.api(
'/' + page_id + '/subscribed_apps',
'post',
{access_token: page_access_token, subscribed_fields: 'leadgen'},
function(response) {
console.log('Successfully subscribed page', response);
}
);
scope - end of facebook login function
{scope: ['manage_pages', 'leads_retrieval']});
Hope this helps!
Facebook had the problem in their startup documentation for the webhooks. I have notified them in a bug, and does look like they have fixed the documentation to now subscribe to "leadgen" and not "feeds".
https://developers.facebook.com/support/bugs/681262475926363/
https://developers.facebook.com/docs/marketing-api/guides/lead-ads/quickstart/webhooks-integration/
I am trying to use Sender Actions as described in the messenger Send API docs. However when I send a typing_on POST I do no see anything happen in messenger. I have tried on chrome desktop and the messenger android app.
I am able to send a mark_seen POST and this does update the chat with an icon indicating my message has been seen.
The request body looks as follows:-
{
"recipient":{
"id":"<PSID>"
},
"sender_action":"typing_on"
}
When sending mark_seen, typing_on or typing_off I always get the following response body.
{
"recipient_id": "<PSID>"
}
Are there additional steps needed to get the typing indicator to display? Does it only work on a specific platform? I cannot find any more documentation, and I am not getting any error messages, the POST status comes back OK identically when sending mark_seen or typing_on, I just can't see any effect after typing_on.
Okay I got reply from Facebook developer team on Facebook Developers group
Quote:
"This changed recently for mobile and is currently assigned to an internal team". Looks like something internal.
I am developing a facebook game in Unity3d using facebook's new facebook sdk, running the app as a web app inside facebook in sandbox mode.
Today I started implementing a shop in the game for microtransactions using their canvas pay model. I read their documentation and javascript tutorial for payments (they don't have one yet for unity) and created a simple button that when you click you are able to buy some ingame currency(coins).
Now my open graph og:product is tested and looks accurate and my c# code in unity is this:
public void onCoinsClicked()
{
FB.Canvas.Pay(
product: "my_url/products/coin.html",
action: "purchaseitem",
quantity: 1,
testCurrency:"EUR",
callback: delegate(FBResult response) {
FbDebug.Log("The result of the purchase is: " + response.Text);
});
FbDebug.Log("onCoinsClicked: ");
}
When i test it using a payments tester user that i have, it throws the following error when displaying the payment popup:
An error occurred. Please try again later.
API Error Code: 1383008
API Error Description: The app you're using isn't responding. Please try again. If you keep seeing this error, try again in a few hours.
If some of you kind people have experienced this before please enlighten me :)
Thank you.
Have you run your product's URL through the Open Graph Debugger (https://developers.facebook.com/tools/debug)? It's possible that a crawler error is causing the issue, and it would be good to make sure that the problem isn't at the data level.
Before I ask my question here are a few details of my setup and the problem I am facing.
This is my first post on StackOverflow :).
Platform :
Unity3d engine + Prime31 plugin for Facebook
Context :
I am trying to integrate Facebook into our Mobile iOS app, developed using Unity3d (still in development), and I am trying to post to the user's friend's wall using a plugin called Prime31.
Problem :
I keep getting a 403 forbidden error when I post to the friends wall
Code :
I am using the following piece of code
var token = FacebookBinding.getAccessToken();
Debug.Log( "access token: " + token );
var param = new Dictionary<string,object>
{
{"message", "Test message for dragons "},
{"access_token" , token},
{"name", "School of Dragons"},
{"caption", "Join the world of Dragons"},
};
Facebook.instance.post(id+"/feed",param, OnPostComplete);
Where id is retrieved from another piece of code.
Additional Info :
With the same setup, publishing on my own wall works. (me/feed instead of id/feed)
The friend I am trying to post to and myself both are listed as developers in the account for the app.
I have the the info.plist additions according to the steps provided by Prime31.
I have done extensive googling on this problem and most of the replies indicate a high number of posts being made from the server / app as a possible reason.
Questions :
Is filling in the Native IOS App setting in the developer console a must for publishing ?
Is the number of posts made by a developer application in Facebook restricted ? Because I can post to the same friends wall with the same content outside of the app. This seems to be the least likely scenario.
Why could this problem be happening ?
Any help would be greatly appreciated as we have a deadline approaching in three days and this feature should be done and ready in a couple of days.
Thanks
Anur
When I use me/photo to share a picture I have meet 403 error.My case is because of my Facebook app not approve the publish_actions permission,and I use a normal user for test,just test user can use not approved permissions.You can use app manage page's menu "Status & Review" -> "Submission" to request permission.
Well, I'm using unity3D I had the same FBResult::Error (res.Error.Text) text (403 forbidden)
You need to see what the res.ToString() says.
For example mine is
""message":"(#200) Requires extended permission: publish_actions","type":"OAuthException","code":200,"fbtrace_id":"C3X4jSCm7or"
This is the first time I'm trying to develop a facebook app so sorry in advance if my question is too naive.
What I need to do is making a chat-like facebook application where:
the user can write something on the wall
the app should be able to detect this event and send an HTTP request to an external web service of my own which will provide a response (text)
publish that text as a comment
the user should be able to continue the dialog by entering another comment(s) (in which case we go back to step #2)
Basically, this would be very similar to:
https://www.facebook.com/SkyscannerFlightSearch
I think one (ugly) way to do this would be making a script which searches for new wall entries/comments and posts replies in an infinite loop by using the Graph API but it's obviously sub-optimal and expensive.
Is there any way to have facebook call a certain url every time a wall post/comment is entered?
Or maybe something like Twitter's streaming API based on long-polling technique?
Am I in the right direction by assuming such kind of solutions or I'm totally missing the point?
Thanks in advance.
Giampaolo
I am working on something very similar myself.
So far i have the "loop" which can be set to any page, group or app on facebook.
SAMPLE: https://shawnsspace.com/plugins/wallfeed.php My page wall.
SAMPLE: https://shawnsspace.com/plugins/wallfeed.php?pageid=19292868552&ptype=feed&limit=40 Facebook Platform Wall.
With some perms, a form and user access_tokens i can make the wall postable. Asper UGLY - you do not need to run this in a loop, Facebook supports realtime updates and will send a response to your app when a user, or page has made a change.
MORE: http://developers.facebook.com/docs/api/realtime
Thanks for the input.
I tried to use the real-time API by using object=user and fields=feed.
If I understood the doc correctly this should result in my callback url being called (POST) every time a user writes something on my app's wall.
I received the initial GET request but never POST.
This is the current configuration:
{
"data": [
{
"object": "user",
"callback_url": "http://XXX.XXX.XXX.XX:8888/",
"fields": [
"feed"
],
"active": true
},
{
"object": "page",
"callback_url": "http://XXX.XXX.XXX.XX:8888/",
"fields": [
"picture"
],
"active": true
}
]
}
I've noticed various user comments reporting different concerns about the reliability of this API.
Also, here:
http://developers.facebook.com/docs/reference/api/page/
it says: "Note: Real-time updates are not yet supported for the total number of Page checkins."
...which I'm not sure what it means exactly.
For the record, my app's page I'm using for tests is:
http://www.facebook.com/pages/testgiamp/187148861354102?sk=wall