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

247 views Asked by At

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.

2

There are 2 answers

1
jpjoyal On

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.

0
codehitman On

SupportKit cannot be used as a chat client between App users, if that's what you mean. I think what you might be looking for is something along the lines of ChatSecure. However, that won't let you as an App Maker contribute to the conversation between users.