Closed alexandrkrucheniuk closed 5 years ago
Hello @alexandrkrucheniuk,
I'm not using this feature, but I think you could translate the code from the freshchat docs like this:
const restoreId = RESTOREID // Which need to be fetched from your DB
this.chat.init({
token: MY_FRESHCHAT_TOKEN,
host: MY_FRESHCHAT_URL,
restoreId: restoreId ? restoreId : null
})
.pipe(
flatMap(
() => this.chat.getUserProperties()
),
catchError(
() => this.chat.setUserProperties(MY_USER_DATA)
)
)
.subscribe(
data => {
if (data.restoreId) {
// Update restoreId in your database
}
},
err => console.log(err)
);
fixed in 0.1.0
@beyondsanity Hey Can you please advice is there any ability to get restoreId when_ user is created?
In Freshchat WebMessenger API they have:
AFAIK there is only one way how to get the restoreId.