WP7 Facebook integration using C# SDK - facebook

I want my game player to able to post game score to his facebook wall from WP7 game. I have gone through following tutorials
1> Tutorial: Logging Into Facebook with Windows Phone 7 (Silverlight) (source code is downloaded from their website.)
PROBLEM: After running sample project, i can login to facebook, but can't figure out how to post the message.
2> I have download sample project from github.
PROBLEM: When i open the project for WP7, a window pop up saying "Solution folder are not supported in this version of application. solution folder '.nudget' will be displayed as unavailable."
I have tried downloading nuget updates as suggested by Prabir's Blog.
3> With this tutorial, i am able to login to facebook.
PROBLEM: unable to post any message. it display inside emulator "The remote server returned an error:NotFound".
please let me know if you find this question inappropriate or lack of research, i will romove question immediately.
I am novice to both WP7 and C#. Please help me to correct above problems.
Thanks in advance
EDIT : Finally got 3rd one working by making small changes in PGLogin.xaml.cs, just change "PRE" to "pre" in "wbLogin_LoadCompleted" method. but still not much satisfy. because its work and sometime don't. it's not stable. and don't know how to logout. any suggestion?

Another user had this exact issue, it was resolved using the following code:
var args = new Dictionary<string, object>();
args["name"] = "Check this out";
args["link"] = "www.xyz.com";
args["caption"] = "";
args["description"] = "description";
args["picture"] = "";
args["message"] = "Check this out";
args["actions"] = "";
FacebookAsyncCallback callBack = new FacebookAsyncCallback(this.postResult);
fbApp.PostAsync("me/feed", args, callBack);
private void postResult(FacebookAsyncResult asyncResult)
{
System.Diagnostics.Debug.WriteLine(asyncResult);
}
Post to Facebook wall using WP7 and Facebook.dll

ShareLinkTask shareLinkTask = new ShareLinkTask();
shareLinkTask.Title = "Divum Photo Browser";
shareLinkTask.LinkUri = new Uri(list_photos.ElementAt(index_).imageUrl, UriKind.Absolute);
shareLinkTask.Show();

Related

Corona SDK Facebook api showDialog properties do not work

I'm about to submit my latest app/game, and it seems something changed, since my call to Facebook's showDialog only works half way.
This is the structure I'm using to make the call which worked fine a month ago when I last tested it:
local fb_publish_properties = {};
fb_publish_properties["iTunes"] = {};
fb_publish_properties["iTunes"]["text"] = "Blabla text to be shown";
fb_publish_properties["iTunes"]["href"] = "https://The link to open on text click";
fb_publish_properties["GooglePlay"] = {};
fb_publish_properties["GooglePlay"]["text"] = "Blabla text to be shown";
fb_publish_properties["GooglePlay"]["href"] = "https://The link to open on text click";
local fb_publish_properties2 = json.encode(fb_publish_properties);
local fb_publish_params = {
app_id = facebook_appId,
from = user_fb_id,
to = user_fb_id,
picture = "http://icon picture here",
name = "Title of post",
caption = "Come play against me!!",
description = "",
properties = fb_publish_properties2;
}
facebook.showDialog("feed",fb_publish_params);
Now, as I said, this worked just fine a month ago, but now, it posts the post to the feed alright, but nothing of the properties is shown in the post, and while clicking on the post itself, it leads to the message icon (which I believe happens since he doesn't recognized any other links in the message).
First, what is wrong with Facebook, changing their API every 2 months!!?? but now really, what is wrong with the piece of code which used to work but now works only partly?
Thanks all!
UPDATE:
After not doing anything about it, just going on as normal, some of the things started working on their own, for example, now when the Facebook API opens on the device (iOs or Android) I see the texts just fine as they are supposed to be, yet when I publish to stream, the post that shows online again, shows only the caption text, not the properties texts and links, and when I click on my post online, it leads to the icon file I'm using and not to the links I've published.
This is the last thing that stops me from publishing this app, please, someone, help??!
This is not an answer, but does not fit in a comment:
Try the following to see if you get anything at all:
facebook.showDialog( "feed", {link="http://www.coronasdk.com/"} )
facebook.showDialog( "apprequests", {message="some message"} )
Please update your post accordingly, describing what you observe, then I can then erase this. Also ensure that login succeeded (the fbconnect event properties of didComplete, isError and expiration).

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.

Unity3d web app facebook Sdk payments API Error Code: 1383008

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.

Facebook connect for Blackberry Application

I am using the Blackberry Facebook sdk from http://sourceforge.net/projects/facebook-bb-sdk/.
The PDF included in the zip file says that attach/include the two .jar files in the Project using eclipse and then use the methods to get user information from facebook.
Including the jar files is fine but when i call the methods and try running the app i get a Run time exception " java.lang.noClassDefFoundError ". No compilation error but a runtime error. I have tried cleaning up the BB 9900 Simulator but it doesn't work. I am pasting the code that causes the runtime exception.
String NEXT_URL = "http://m.facebook.com/login.php";
String APPLICATION_ID = "318512824926003";
APPLICATION_SECRET = "e0e532b55a4586ec2fb0eddf4eed12b1";
String[] PERMISSIONS = Facebook.Permissions.USER_DATA_PERMISSIONS;
ApplicationSettings as = new ApplicationSettings(NEXT_URL, APPLICATION_ID, APPLICATION_SECRET, PERMISSIONS);
Facebook fb = Facebook.getInstance(as);
Inserting the above code causes the runtime exception. Many users have told that this works but have not provided a simple and end solution. So please help.
Thank you.
great.. i got it working.. I retrieved the email id of the FB user by adding a parameter to LoginScreen.java file.
Parameter added : "email"
"http://www.facebook.com/dialog/oauth?scope=publish_stream,offline_access,email&redirect_uri=" + pfbc.getNextUrl() + "&response_type=token&display=touch&client_id=" + pfbc.getApplicationId()
Guys if u need any help integrating FB Connect to your BB App please email me at alvin.chettiar#hotmail.com . I will be glad to help. I know the head banging that i went through.

BlackBerry Facebook jar file in eclipse

I know this might sound a very basic question but I am having an issue in using Facebook SDK for Blackberry. I have downloaded the latest one 0.8.25. I have imported them in my eclipse and they are present in the referenced libraries. I have a game app where I want the users to login using their facebook account. Which class contains the code for logging in? Are the jar files implementable or they are just for reference? I have read forums posts where users say that they executed Strawberry program but I can no where find any executable source code. Kindly please let me know how do I create a login page for BlackBerry using its SDK. I did go through another link of Sample Code here!
Let me know which class has login code or how do i use the SDK
At the very basic least, you need to get an instance of the Facebook object and call getCurrentUser(). So, for example:
String[] permissions = new String[] { Facebook.Permissions.ALL_PERMISSIONS };
Facebook fb = Facebook.getInstance(new ApplicationSettings(myNextUrl, myAppId, myAppSecret, permissions));
User fbUser = fb.getCurrentUser();
The code in the library will handle all of the details like getting the user to login to facebook account and accept the requested permissions and so on. You'll want to wrap that all in a try/except to catch FacebookException for error conditions (e.g. user refuses your request).