The getMyGroups:failure method returns all the groups, both public and private, the user is a member of.
Method parameters :
success : Success block to be executed after user's groups are successfully retrieved.
failure : Failure block to be executed if user's groups could not be retrieved, returns BayunError.
[[BayunCore sharedInstance] getMyGroups:^(NSArray<Group*> *myGroups) {
for(Group *group in groups) {
NSLog(@"Group Id - %@",group.groupId);
NSLog(@"Group Name - %@",group.groupName);
GroupType groupType = group.groupType;
}
} failure:^(BayunErrorbayunError) {
NSLog(@"Error getting my groups.");
}];
BayunCore.sharedInstance().getMyGroups({ (myGroups) in
for group in myGroups! {
NSLog("Group Id - \(group.groupId!)")
NSLog("Group Name - \(group.groupName!)")
let groupType : GroupType = group.groupType
}
}, failure: { (bayunErrorCode) in
NSLog("Error getting my groups.")
})