Notifications
Clear all

Usergroup Load?!

2 Posts
2 Users
0 Reactions
683 Views
 joki
(@joki)
Posts: 29
Eminent Member
Topic starter
 

I dont know how to load usergroups it appears.

 

I can add customData but getting it from the server doesnt seem to work so I believe I'm not loading groups properly. This is what I'm using directly out of the documentation:

 

12.2 Load groups

To load groups you have 3 choices:

• load groups owned by local user UserGroup.Load(CombuManager.localUser.idLong, (UserGroup[] groups, string error) => { Debug.Log(groups.Length); });

• load groups in which local user is a member (owners are also members) UserGroup.LoadMembership(CombuManager.localUser.idLong, (UserGroup[] groups, string error) => { Debug.Log(groups.Length); });

 

It does nothing..  Even the Debug.Log(groups.Length) returns 0..... 

 
Posted : 30/03/2016 4:31 am
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

I don't know how you're creating groups, but the following code is running fine:

CombuManager.platform.Authenticate("username", "password", (bool logged, string errorLogin) => {

 if (logged)
 {
 UserGroup group = new UserGroup ();
 group.name = "My Group";
 group.users = new User[] { {userName=CombuManager.localUser.userName} };
 group.Save((bool success, string error) => {

 Debug.Log("Group saved: " + success);
 if (success)
 {
 UserGroup.Load(CombuManager.localUser.userName, (UserGroup[] groups, string errorLoad) => {
 Debug.Log("Groups: " + groups.Length);
 });
 }

 });
 }

});

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 30/03/2016 3:42 pm
Share: