Hello Etorki,
In such case, you can link user additional information like his name, profile picture etc while creating the App42 user with Facebook id. And use that additional information while you are adding friend as a buddy.
Please find the below code snippet for saving the additional information of user along with user creation:
String userName = "Facebook Ids";
String pwd = "********";
String emailId = "nick@shephertz.co.in";
String dbName = "<Your_DataBase_Name>";
String collectionName = "<Your_Collection_Name>";
Dictionary<string, object> jsonDoc = new Dictionary<string, object> ();
jsonDoc.Add("name","John");
App42API.SetDbName(dbName);
userService.AddJSONObject(collectionName, jsonDoc);
App42Log.SetDebug(true); //Print output in your editor console
userService.CreateUser(userName, pwd, emailId, new UnityCallBack());
public class UnityCallBack : App42CallBack
{
public void OnSuccess(object response)
{
User user = (User) response;
App42Log.Console("userName is " + user.GetUserName());
App42Log.Console("emailId is " + user.GetEmail());
for(int i=0; i<user.GetJsonDocList().Count; i++)
{
App42Log.Console("updated at = "+ user.GetJsonDocList()[i].GetUpdatedAt());
App42Log.Console("created at = "+ user.GetJsonDocList()[i].GetCreatedAt());
App42Log.Console("doc id is = "+ user.GetJsonDocList()[i].GetDocId());
App42Log.Console("json doc is = "+ user.GetJsonDocList()[i].GetJsonDoc());
}
}
public void OnException(Exception e)
{
App42Log.Console("Exception : " + e);
}
}
Also, follow this
blog in which you find that how you can fetch these details using Storage service as well.
Let us know if it helps.
Thanks