nhagen/react-intercom

How update works ?

Closed this issue · 4 comments

Hi,
i fail to understand how Intercom('update') work
I don't see it fired in my network console when i call it

image

The intercom doc is not very clear... did you guys manage to update and fetch new message when ever you want ?

Thanks

I seem to be able to update the user on demand, but I was having some inconsistency with calling update with no params.
mar15 121516

Message from the customer support :

Hey Gautier 👋
Just so we are on the same page, are you aware that we dedupe pings?
When you call the update function a few times in a short period of time without changing any user data, we dedupe requests that don’t contain any new data. Which means that if you trigger an event, and then try to trigger the same call or a simple update with no new information in it straight after, Intercom will ignore the second call. These updates are deduped with a 60s window, which means that you can make a basic update call without changing any user information every 60s.

Great! Glad you were able to get a resolution, and thanks for sharing!

I manage to make it work like that :

onClick={() => {
	IntercomAPI('trackEvent', 'custom_event');
	setTimeout(()=>{
		IntercomAPI('update', {garbage : random(10000, true)});
	},1000)
}}

Thanks for this package btw !