1

It is possible to clear and remove the association of that contact key with that particular device when the user logs out? What's the recommended approach to avoid having the notifications sent to that device?

Currently I'm developing for Android but I'd also like to know if there's a solution for iOS as well.

Thank you

1 Answer 1

0

Great question! You can not currently clear the Contact Key once it is set, but there is a simple workaround: set it to a random UUID UUID.randomUUID().toString().

CAUTION

You'll want to create the anonymous/unknown ID once and hold on to it to re-use as the consumer logs in/logs out of your application. If you assign a "new" random UUID every time the consumer logs out you'll orphan contacts. I would recommend:

  1. First launch, create an anonymous UUID and store it locally
  2. Consumer logs in, set their Contact Key
  3. Consumer logs out, set the anonymous UUID as the Contact Key
  4. Repeat steps 2-3 as necessary, but never repeat step 1

On logout you might also consider clearing Attributes and removing Tags as necessary.

Make sense?

Also, a Voice of Customer request would be great. The SDK engineers would love to see a simple log in/log out functionality added, but it's got to get on the product road map. That won't happen without your voice.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .