as you can read in the topic i am selling an Unity Facebook example + documentation for setting up your own Unity game in Facebook in less than 5 minutes.
For this purpose (and for some artist buddies) i set up http://www.polyload.com for selling our stuff a few weeks/month ago. It’s now in a kind of beta stage, so please feel free to contact me if you find bugs or strange behaviours.
I might want to buy this for a school project. But before i do so, I have some questions:
Is it possible to invite friends?
Is it possible to send gifts?
Is it possible to run the scripts without having the webplayer in the facebook canvas page?
Im getting some issues in reading non english letters(im from Denmark), could that be fixed?
If we are going to buy it, and you make further development on it, would we be able to get the updates for free?
Beside all that I just want to tell that it’s a really awesome project you have been working:smile: I have been looking for something like this for a while.
you can do everything what the Graph Api is capable of, just in the same way i loaded the userpicture or posted to your wall.
The example uses Unity’s WWW class to call Graph Api URLs or it’s own php scripts, which contain Graph Api stuff, too.
You don’t have to mind about the authorization and Graph Api setup - that’s already done. Just place your Graph Api calls.
Here is a simplified example how to get your own picture (the used Graph Api call is in bold):
// we get m_myFacebookUserId via external javascript functions from index.php
var www : WWW = new WWW ("[B]https://graph.facebook.com/" + m_myFacebookUserId + "/picture[/B]");
// Wait for download to complete
yield www;
var newTextureFromWeb : Texture2D = www.texture; // here you get the picture as texture
Hi Ethan
Thanks for the quick response!
Then i want to hear about the letter issue. Can that be fixed? Need these letters: æøå.
I like coding in C#. I wont get some issues when using the Graph API?
These might be stupid questions, but i’m not into all unity stuff yet:smile:
The letter stuff is just about the right charset. If you want to display those chars in html you have to find the right shortcut to the char (see this table: HTML 4.0 Latin-1 Entities). If you want to display such chars in Unity you have to pick the right charset in your codeeditor.
It works with C# or JavaScript, there’s no difference.
interesting aproach on that WWW.texture call… however I done it trough regular url… My API is little more complicated but works just right… nice work btw
Hi Ethan,
I bought the package and it was super easy to implement.
I Just followed the instructions and got it all working in no time.
I’ll keep you posted as I make some progress on my game.
Thanks for putting it out there
Hi,
i started working on a fb app some months ago.
Some weeks ago i wanted to finish the app, port everything to the new fb api and then stumbled upon your handy little script. After 3 hours i had everything ported and working! Thanks for that!
I can only recommend this to everyone interisted in connecting unity and facebook. It’s a great kick-start script
The only critique i have is that the php code could be a bit more organized. (Important variables are scattered over multiple files. One can easily change that himself though). At the end of the day the 18€ were very well worth it though.
Hi guys,
Were you able to access any other features of the Graph API besides profile picture and name.
I’m trying to access photos or albums , but no luck so far.
Any idea how to do that?
Thanks,
E
That’s the part that I actually did figured out how to do. So I did ask for all the permission, just not sure how to write the functions to grab the photos.
$photo = $fb->api('/98423808305'); // id of photo - see link above
echo '<img>'. $photo[data]['picture'] .'</img>'; // $photo[data]['picture'] should contain the link to the .jpg
maybe you have to leave the [data] away or sth (sorry, i cant test it atm).
Ethan, does this system work in a web player that is not a Facebook App? For instance, if the webplayer was running on my site, or kongregate etc… could I still allow my player to authenticate with FB and post to their wall?
I am feeling kind of stupid. I’ve bought the package, followed the instructions, uploaded the app, but when I try to access it, the browser keeps loading in loop but never loads the app. Any idea of what may I did wrong?
sorry i wasn’t available for some days. The problem is, that facebook changed something in the settings, which forces you to do the following:
Go to your developer page “My Applications”
Select your app and ‘Edit Settings’
Advanced > Migrations > Enable the “OAuth 2.0 for Canvas (beta)”
Maybe you should also update the facebook php-sdk (the facebook.php in facebook/src): https://github.com/facebook/php-sdk/
But this wasn’t necessary for my apps.
Please tell me if this worked for you. I just updated the package in the AssetStore.