I'm trying to implement achievements with the Facebook Unity SDK.
I was hoping somebody could give me a qualitative description of the process required to do this.
Here's what I've done so far.
- Hosted the web build on a server
Created an achievements folder on this site and created a test achievements html file as in https://developers.facebook.com/blog/post/539/
My main confusion is the difference between registering an achievement and positing an achievement.
Is registering an achievement something that needs to be done only once and if so where should this be done? Do I need to create a script in unity that registers all the achievements for the game that I run before the rest of my testing? Also I'm unsure how the method call works for registering and posting an achievement. I'm under the impression I need to call FB.API(string endpoint,Facebook.HttpMethod,FacebookDelegate callback,Dictionary formData)
but I'm really not sure what the input arguments need to be.
Here's my attempt so far(I'm pretty sure the string endpoint I've used is wrong)
private void RegisterAchievement()
{
string achievement ="http://www.invadingspaces.com/unity/testing/Achievements/ach1.html";
string appID = "999408935255000";
string achievement_display_order = "1";
string achievement_registration_URL = "https://graph.facebook.com/"+ appID + "/achievements";
FB.API(achievement_registration_URL+","+"achievement="+ achievement+ "&display_order=" +achievement_display_order+ "&access_token=" + FB.AccessToken ,Facebook.HttpMethod.POST,null,null);
}
Thanks in advance.