I’m currently building a clienteling app that integrated the Mobile Push SDK on both iOS and Android and encountered some issue on switching the account.
I found that when I login to user A, and set contact key to A, the Inbox Messages will be send to this device.
However, I logout user A and switch to a user B, I should set the contact key to B. But seems the inbox messages are associated with the Device instead of Contact, I can still see the inbox messages that were sent to contact A previously.
My question is, how should we deal with this situation, to prevent from seeing the previous inbox messages if the contact key has been changed?
First, as of 2018-11-16 neither the SDK nor the Marketing Cloud supports the use-case you describe. Please open a Voice of Customer (VoC) request through your account manager. The more of these requests that exist the more likely it is the feature will be implemented.
Now, we do have people who have successfully implemented your use-case. It requires that you send the
ContactKey (or similar unique identifier) along with your inbox message in a “Custom Key”. Then you would implement your inbox message adapter such that you inspect your custom key to determine whether or not your message should be included in the message list.
UPDATE 20190108 — Apparently, I have misspoken. This was our understood solution from the SDK’s perspective until such time that the messages could be filtered at the system level for a given contact, but we are mistaken. You are correct in your comment that messages are rendered at the time that they are downloaded. There is work underway to allow for the use-case you describe.
UPDATE 20200924 — Inbox messages can now be targeted to a Contact rather than a device. Your application in the Marketing Cloud must be configured to do so. Please contact your support representative for more information.