Hi folks,
I thought I'd share some work in progress code for facebook integration.
I've tried Epic's suggested approach described here http://udn.epicgames.com/Three/FacebookIntegration.html and present in the CloudGame but I have resulted to creating something a bit different as it left me with the following problems:-
1) The authorization process doesn't appear to work for me using builds from August 2011 -> Jan 2012. The game loads the Facebook application and never returns to the UDK app.
2) The game crashes upon restarting the level. From what I can figure the clear delegate stuff isn't happening and some kind of memory leak maybe happening. I posted a possible bug on the Twitter process covering a similar issue.
Anyhow I have it so that I can authorize my app, post to my wall, restart/ change level but then if I run the function to post it after a level change the game crashes... So not perfect perhaps I'm doing something stupid or the memory leak is still occuring.
Here’s the code, I worked out the authorization dialogue using the Facebook Developer Page. I guess this is an alternative method compared to using the +Permissions option in the Engine.ini I have no idea if it is correct or advisable.
Any suggestions / ideas would be appreciated![]()
All the best
Greg
Code:class CloudPC2 extends SimplePC; var FacebookIntegration Facebook; var bool facebookgregauthorized; simulated function PostBeginPlay() { super.PostBeginPlay(); Facebook = class'PlatformInterfaceBase'.static.GetFacebookIntegration(); } // Cleanup Originally this had clear delegate lines in but it didn't seem to be working as any time I have the add and clear delegate lines in the game crashes upon restart level. event Destroyed() { super.Destroyed(); facebookgregauthorized = false; facebook.disconnect(); } // this function works but as soon as you restart the level it causes the game to crash if you execute it... not sure why yet. I'm presumming the dialogue method leaves a delegate that needs clearing, but the attempts I've tried in the paste in the destroy event does not seem to get rid of anything. exec function postfacebook() { local array<string>Params; local array<string>Params2; //if (!Facebook.IsAuthorized()) This is not playing nice so I made my own temporary bool until I figure out why Epic's example is not working if (facebookgregauthorized == false) { Params.AddItem("scope"); Params.AddItem("email,publish_stream,publish_actions,read_stream"); Params.AddItem("client_id"); Params.AddItem("PUT YOUR FACEBOOK APPID HERE, DO NOT INCLUDE THE FB"); Params.AddItem("redirect_uri"); Params.AddItem("http://www.google.com"); Params.AddItem("response_type"); Params.AddItem("token"); Facebook.FacebookDialog("oauth", Params); facebookgregauthorized = true; } else { // post to wall this is just the epic example I believe Params2.AddItem("message"); Params2.AddItem("Shouldn't see this"); Params2.AddItem("link"); Params2.AddItem("www.google.com"); Params2.AddItem("picture"); Params2.AddItem("http://yourkidsartsucks.com/wp-content/uploads/2011/10/Funny_Art_223.jpg"); Params2.AddItem("name"); Params2.AddItem("Yes, hotness"); Params2.AddItem("caption"); Params2.AddItem("This is an post"); Params2.AddItem("description"); Params2.AddItem("I'm playing with posting to wall from UE3. Enjoy this mightily."); Facebook.FacebookDialog("feed", Params2); } }
You'll know if you get any of the above working as it'll look like this ....
![]()






Reply With Quote
I get the same with Twitter and other things, it's odd because this implementation works on Infinity Blade and other full engine versions. 

Bookmarks