I use the latest version 4.13
This is my init:
var promise = Smooch.init({
appId: smooch_key,
givenName: $rootScope.data.user.first_name,
surname: $rootScope.data.user.last_name,
properties: {
email: $rootScope.data.user.email,
uid: $rootScope.data.user.id,
language: $rootScope.data.user.language,
country: $rootScope.data.user.country
}
});
promise.then(function() {
$('#sk-holder').addClass('no-print');
$rootScope.smooch_inited = true;
});
As you can see, I give it the name, but it seems to now work. What am I doing wrong?
givenName
, surname
, and properties
are not part of the supported init parameters. You should call Smooch.updateUser
to set the properties on the user record
Smooch.init({
appId: smooch_key
})
.then(function() {
Smooch.updateUser({
givenName: $rootScope.data.user.first_name,
surname: $rootScope.data.user.last_name,
properties: {
email: $rootScope.data.user.email,
uid: $rootScope.data.user.id,
language: $rootScope.data.user.language,
country: $rootScope.data.user.country
}
});
$('#sk-holder').addClass('no-print');
$rootScope.smooch_inited = true;
});