Track who your users are and what they do in your mobile app and customize the Salesmate Messenger. Here’s how to configure SalesmateChat 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 = "user's email address"
let firstName = "user's first name"
let lastName = "user's last name"
let userId = "user's user id" // Unique id recommended
SalesmateChat.update(userId: userId, email: email, firstName: firstName, lastName: lastName, completion: { (success, error) in
if error == nil {
// Update successfully
} else {
//U
pdate error
}
})
Submit an event
You can log events in Salesmate 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-3434",
"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.
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)
}
Comments
0 comments
Article is closed for comments.