Skip to main content
Track who your users are and what they do in your mobile app and customize the Skara Messenger. Here’s how to configure Skara Chat for iOS:

Update your User

  • When you call a login method we create a user with his basic detail, if you want to change his basic detail then you can use update user functionality as per the below code snippet:
let email = "[email protected]"
let firstName = "John"
let lastName = "Doe"
let userId = "unique-user-id" // Unique ID recommended

SalesmateChat.update(userId: userId, email: email, firstName: firstName, lastName: lastName) { success, error in
    if error == nil {
        // Update successfully
    } else {
        // Update error
    }
}

Submit an Event

  • You can log events in Skara Chat SDK that record what users do in your app and when they do it. For example, you could record the item a user contact from your mobile app, and when they contact it.
Objective-C
[SalesmateChat logEventWithEventName:@"contact_item" 
                            withData:@{
    @"created_date": @1260016272,
    @"contact_id": @"011",
    @"contact_detail": @{
        @"first_name": @"John",
        @"last_name": @"Smith"
    }
}];
Swift
SalesmateChat.logEventWith(
    eventName: "contact_item",
    withData: [
        "created_date": 1260016272,
        "contact_id": "011",
        "contact_detail": [
            "first_name": "John",
            "last_name": "Smith"
        ]
    ]
)

Create a Custom Launcher

  • However, if you’d like Messenger to open from another location in your mobile app, you can create a custom launcher. This allows you to specify a button, link, or element that opens Messenger. For example, you can trigger the launcher to open when a customer clicks on your ‘Ask for support’ button.
Custom Launcher
  • If you have a custom launcher, you can call:
Objective-C
- (IBAction)presentMessenger:(id)sender {
    [SalesmateChat presentMessengerFrom:self];
}
Swift
@IBAction func presentMessenger(_ sender: UIButton) {
    SalesmateChat.presentMessenger(from: self)
}