Unity3d web app facebook Sdk payments API Error Code: 1383008 - unity3d

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.

Related

Why does Facebook leadgen ads testing tool give a 102 server error?

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/

AS3: Post to Facebook Wall - Error #2032

I am currently developing an app with which visitors of an event can take pictures using a webcam and upload them to Facebook using an AS3-application. I know I can connect to Facebook, because I can log the user out using the API and I can get all the information. The problem is that I can't post to their wall for some reason. I keep getting the following error:
error #2032: stream error. url: https://graph.facebook.com/********/feed
I use the following code to post to Facebook:
private function postFB(e:Event=null):void {
var _params:Object = new Object();
_params.uid = Facebook.getAuthResponse().uid;
_params.access_token = Facebook.getAuthResponse().accessToken;
_params.message = "I was at the Thanksgiving Day Event.";
//_params.picture = _bitmap;
Facebook.api("/me/feed", postComplete, _params, "POST");
}
As I've said before, I know I am connected to facebook because if I change "POST" to "GET" in my api-call, I get all the information of my account. I have the correct permissions as far as I know (read_stream, publish_stream, user_photos). I use GraphAPI_Web_1_8_1.swc as an api.
The documentation on the entire api is very poor, so I am trying to figure out the problem. It's been a few years since I've tried any of this, so my code has probably aged too far by now. So, any ideas what I'm doing wrong?
publish_stream is deprecated (since years?), you need to use publish_actions.
If that does not work, make sure the Access Token includes all the permissions, you can test this in the Debugger: https://developers.facebook.com/tools/debug/
Side note: AS3 is not getting used very often anymore, the last version of the the AS3 SDK is from 2011. It may be a good idea to switch to the JavaScript SDK.

Error: cannot invite friends using Facebook SDK for Unity

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!

Unity Facebook sdk 4.3.6

I am having a issue with facebook login. I am using facebook sdk 4.3.6 and unity3d 4.3.0/4.3.1.
when I hit login button Facebook permission windows open and after pressing ok nothing happens and following message is printed in logs
" sending to Unity OnLoginComplete({"cancelled":true,"key_hash":"asdasd"}) "
FB.Login("email,publish_actions", LoginCallback);
and in
void LoginCallback(FBResult result)
{
login = result.Text; // output login=false, userid="", access_Token=""
}
Not sure what the above answer is...Why does JSON have to do with anything?
I am having the same problem...was using Facebook SDK 4.3.4 and was having the same problem.
I saw there was a new one up 4.3.6 and tried it...same problem.
I check LOGCAT and saw the same line:
sending to Unity OnLoginComplete({"cancelled":true,"key_hash":"4EbLC........0uFU1A="})
Which is NOT my has from my UNITY Facebook settings...I have no idea where it is getting this HASH from.
I am wondering if the "cancelled":true result is a result from the Facebook Dialog to allow permissions ..although I did not click CANCEL
I am going to try the only thing I haven't tried yet and that was a post from someone to get the latest OPENSLL and regen the keys...
SOLVED: OK Here is what I did to get it working....
I added that Hash that I got from the LOGCAT to the Facebook Develop App Settings on
develop.facebook.com/apps
Now it logs in me in...
I just don't know where that Hash is coming from...I also have the hash that was generated from Unity in there as well.
Ryan

Getting a 403 forbidden error when posting in Facebook using Prime31 pkugin from Unity3d

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"