Hey developers,
I’m trying to implement the facebook SDK into a little game I’m working on.
I’ve downloaded the latest version of the Facebook SDK for Unity3D (version 5.1).
Now I would like to make a ‘AppRequest’ (ask for help) which uses an actiontype and a objectid.
How do I get an objectid?
FB.AppRequest(
DirectRequestMessage,
DirectActionType,
objectId: "YOUR_OBJECT_ID", // <--- how do I get an valid object id?
filters: "",
excludeIds: null,
maxRecipients : null,
data: "{\"some data\":",
title: "awesome title",
callback: RequestKeysCallback
);
EDIT: nevermind, I figured it out, there’s a tool which allows you to create objects.
Thanks for mentioning th ename of the tool …
Hey everyone,
Have you successfully created Object ID using Facebook Object browser?
I think we need to create it by using Facebook API . I am using the code below but not getting ID in return-
private static void GetOpenGraphObjectID()
{
var formDict = new Dictionary<string, string>()
{
{“title”, “AskForCoins”},
{“type”, “product.item”},
{“app_id”, “921871194580745”}
};
var formData = new Dictionary<string, string>() { { “object”, Facebook.MiniJSON.Json.Serialize(formDict) } };
Debug.LogError (formDict.Values);
FB.API(“/me?objects/product.item”, HttpMethod.POST, CreateFBLifeCallback, formData);
}
private static void CreateFBLifeCallback(IGraphResult result)
{
if (!string.IsNullOrEmpty(result.Error))
{
Debug.LogError("Error during object create call! " + result.Error);
}
else
{
Debug.LogError("result "+result.ResultDictionary.Values);
object myID;
if (result.ResultDictionary.TryGetValue (“id”, out myID)) {
Debug.LogError ("myID "+myID);
}
}
}
If someone ha solved this issue, please help.