chat-sdk-android icon indicating copy to clipboard operation
chat-sdk-android copied to clipboard

Where is public thread created

Open Lavii7 opened this issue 9 years ago • 3 comments

Where is public thread created? as we would like to integrate code to limit the public thread creator to be limited to admin. Also is there a way to allow few users to create the public thread?

Lavii7 avatar Apr 24 '17 22:04 Lavii7

First you should get the token:

    // Get the token
    RXPromise * tokenPromise = [RXPromise new];
    [firebaseUser getTokenWithCompletion:^(NSString * token, NSError * error) {
        if (!error) {
            [tokenPromise resolveWithResult:token];
        }
        else {
            [tokenPromise rejectWithReason:error];
        }
    }];

Then call authenticateWithDictionary on [BNetworkManager sharedManager].a.auth passing in the following Dictionary:

@{bLoginTypeKey: @(bAccountTypeCustom), bLoginCustomToken: @"TOKEN"}

This will authenticate the user with Chat SDK and perform the necessary setup steps.

bensmiley avatar Apr 25 '17 04:04 bensmiley

Hi @Lavii7,

Just to extend @bensmiley's answer:

Currently we do not have administrator functionality for the Chat SDK. We are looking at implementing something along these lines but the functionality you are talking about would be different again.

If I am not mistaken you want to:

  • Have a number of admin users
  • Admin users have additional privileges - creating public groups

To do this you need the app to be able to recognise your user as an admin user. You can then have the app check the admin status of the user and enable/disable the UI for them. There are a number of ways you can do this:

  1. Manually add the entityID of admin users in Firebase. The app will then check the current admin entityIDs and will then let them do additional things. The disadvantage of this is that you have to manually find the users and add them to the admin branch.
  2. Have a different login for admin users. You could add a new button in login called "admin login" - the user would then have to enter an admin password to access it (you would tell your users this specific password to allow them to login). We could then add an admin flag to their account meaning they could then access the additional features.

Hopefully this makes sense? Let me know if you have any additional questions,

Simon

simonsmiley64 avatar May 01 '17 10:05 simonsmiley64

Yup this helps thanks

Lavii7 avatar May 02 '17 16:05 Lavii7