**Working** Publish to Facebook users wall from app :-) !!!
Hi all,
Just been working away at a little something that has now reached a workable state. It is a feature I will be putting into my next game 'Monkey Up'.
So basically with a lot of javascript fiddling I managed to get my server to interpret different URL links using the same script that then posts the relevant data to the users facebook page. So for example if the player beats level 1 then the URL link sent simply states this, level 2 the same, etc.... The script on the server then takes this and picks the correct status update, then if the player clicks the 'FB' button it redirects the iPad/iPhone browser to an authorisation page, autofills all the relevant links and pics for the status update and and then posts to their wall. (does that make any sense?!?).
It's all playing along pretty seamlessly now (except we have no way to return to the app apart from double tapping home and using the multi-tasking).
Here are some pics, I'll post a video when I get time tomorrow:
So .... click the facebook button:

Takes the user to this page:

Then this pops up:

And this is what it looks like on their page. Every text link and the image direct straight to the appstore purchase page for the app.

Stu
Just been working away at a little something that has now reached a workable state. It is a feature I will be putting into my next game 'Monkey Up'.
So basically with a lot of javascript fiddling I managed to get my server to interpret different URL links using the same script that then posts the relevant data to the users facebook page. So for example if the player beats level 1 then the URL link sent simply states this, level 2 the same, etc.... The script on the server then takes this and picks the correct status update, then if the player clicks the 'FB' button it redirects the iPad/iPhone browser to an authorisation page, autofills all the relevant links and pics for the status update and and then posts to their wall. (does that make any sense?!?).
It's all playing along pretty seamlessly now (except we have no way to return to the app apart from double tapping home and using the multi-tasking).
Here are some pics, I'll post a video when I get time tomorrow:
So .... click the facebook button:

Takes the user to this page:

Then this pops up:

And this is what it looks like on their page. Every text link and the image direct straight to the appstore purchase page for the app.

Stu
Comments
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
I am wondering if you would be able to offer this service in the market place? I wouldn't even begin to know how to do the serve-side scripting.
its an amazing find mate! you caught my attention !
looking forward for more info on this
Roy.
Do you need the pro version for this to work?
In the past, I've contacted GS about being able to pass a name/value pair from a game but at this time it is apparently impossible.
Nice hack and very cool!
also, since you used open source code, i think it would technically be illegal to sell it...most open source code comes with a license forbidding you from putting it in a for-profit product. from my understanding. though, you could probably just change some things around in the code and then it wouldn't be the same code.
http://gamesalad.com/forums/topic.php?id=19324
You don't need Javascript to accomplish this.
You do need the pro version, as it uses hyperlinks.
I think it's a good way to end the game, so that players can brag on Facebook that they beat the game. It doesn't matter if they're leaving the app then, as the game is over.
@Photics, with your method, is it an in-game link?
I'll check out your link. Thanks for the post.
Thanks for that info.
I had a quick look at the different methods and they all seem to be passing hard coded data vs. dynamic data. Is this correct?
For example, how would a high score be passed?
It's fantastic that you guys share this kind of thing so that we can all benefit. Makes us more like a team than a group of individuals.
I look forward to when I can contribute something more than "Hey, I've worked out how you can make your actor bigger"
Simon
www.octappus.com
As for posting achievements to Facebook, I think pre-generated text makes more sense.
The OpenURL is not dynamic... so you can have lots of static HTML pages, or one dynamic page... with PHP, Javascript, or similar technique.
That was the other main point in my earlier thread... if OpenURL was dynamic... and we had access to the system clock/date... we could make our own leaderboards, with some basic encryption to discourage cheating.
If there was a way that GS could include a behavior that allows us to collect in-game values to pass as a payload to a defined url, then *that* would be powerful.
What would be better is if we can custom create our own behaviors as plugins.
It was night time where I live, just woke up.
As mentioned in the first post this script needs to receive a specific URL link to post a specific status update. Posting a highscore would not be possible using this method. It is working in connection with the facebook javascript sdk at the server to achieve the authorisation and the ability to write to the facebook stream (wall) through the graph API.
I'll post a video of it working later so you can see if it is something you might want to implement.
@photics
A dyanmic openURL would not really help in this case and IMO you HAVE to use javascript to achieve this. If you can write a method to access the facebook.streampublish() function or talk to the graph API without javascript then I'd love to see it, it can't be done through just URL arguments. It is not using php/javascript to just dynamically accept the URL links, it is to interact with the whole facebook system. The user has to grant access for you to be able to post to their stream. Also if not logged in it needs to launch a login window that then still continues the task of authorising and then posting. Your method was through the sharer.php that facebook is planning on removing soon. sharer.php only takes a url and page title as arguments and is pretty limited in how you can control it. This method I posted also grants you access to post other information at a later date (like updates to your game) straight to their wall as well and stores data about which users have shared your game in your facebook developer area. But hey, as the 'professional web developer' that you are then I'm sure you know best and can post for us another solution.