Unity3D Facebook SDK Achievements -


i'm trying implement achievements facebook unity sdk.

i hoping give me qualitative description of process required this.

here's i've done far.

  • hosted web build on server
  • created achievements folder on site , created test achievements html file in https://developers.facebook.com/blog/post/539/

    my main confusion difference between registering achievement , positing achievement.

is registering achievement needs done once , if should done? need create script in unity registers achievements game run before rest of testing? i'm unsure how method call works registering , posting achievement. i'm under impression need call fb.api(string endpoint,facebook.httpmethod,facebookdelegate callback,dictionary formdata)

but i'm not sure input arguments need be.

here's attempt far(i'm pretty sure string endpoint i've used 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.

i'd suggest looking @ general facebook achievements api: https://developers.facebook.com/docs/games/achievements/

also can first test out put graph explorer put graph.: https://developers.facebook.com/tools/explorer

so example create new achivement it's this:

var dict = new dictionary<string,string>(); dict["achievement"] = "<url_to achievement_here>"; fb.api(fb.appid+"/achievements", facebook.httpmethod.post, null, dict); 

to game achievements, it's:

fb.api(fb.appid+"/achievements", facebook.httpmethod.get); 

then award player achievement, it's this:

var dict = new dictionary<string,string>(); dict["achievement"] = "<url_to achievement_here>"; fb.api(fb.userid+"/achievements", facebook.httpmethod.post, null, dict); 

to player's achievment completed, it's:

fb.api(fb.userid+"/achievements", facebook.httpmethod.get); 

Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -