Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send and retrieve real time messages & media files using SupportKit on iOS

I am using Slack with SupportKit v2.9.0. I want to be able to retrieve messages and media files from other users in other channels.

(BOOL) application:(UIApplication *)application 
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    // Override point for customization after application launch.
    [SupportKit initWithSettings:
    [SKTSettings settingsWithAppToken:@"eknlh3uw8lrdveknlh3uw8lrdvs49xj29fqahcs49xj29fqahc"]];
    [SupportKit setUserFirstName:@"Han" lastName:@"Solo"];

    return YES;
} 

I am calling SupportKit in my app with:

[SupportKit show];

When the view loads I am able to send and retrieve messages but the name of the user doesn't appear. I would also like to fetch messages from other users of my app into this same conversation.

Update:

I have made the following change

(void) viewDidLoad {
    [super viewDidLoad];

    [SKTUser currentUser].firstName = @"Doctor";
    [SKTUser currentUser].lastName = @"Who";
    [[SKTUser currentUser] addProperties:@{ @"nickname" : @"Lil Big Daddy Slim", @"weight" : @650, @"premiumUser" : @YES }];

    [SupportKit show];

}

This is what I see in my email: enter image description here

and this in my app: enter image description here

But I am still unable to see the name of the user appear in the conversation.

like image 822
Sport Avatar asked Oct 30 '22 23:10

Sport


1 Answers

To set the user name and profile you can use

[SKTUser currentUser].firstName = @"Doctor";
[SKTUser currentUser].lastName = @"Who";
[[SKTUser currentUser] addProperties:@{ @"nickname" : @"Lil Big Daddy Slim", @"weight" : @650, @"premiumUser" : @YES }];

See this doc for more details http://docs.supportkit.io/#identifying-your-users

Note that SupportKit conversations are meant to be between an app user and an app maker. Having conversation between two app users is not something that is supported at the moment.

like image 154
jpjoyal Avatar answered Nov 15 '22 07:11

jpjoyal