I'm currently integrating the Message Center into my iOS app (Swift). I'm simply displaying it using UAirship.defaultMessageCenter.display(). So far, so good.
I noticed though that it doesn't seem to be in sync with the current user logged in my app. As an example, every time a user signs in / signs out, I update UAirship.namedUser().identifier with either "nil" if the user just logged out or with a user ID if a user logged in, this then allows me to target specific users for push notifications etc.
And this is the problem I have with the Message Center:
- The user launches the app for the first time, he logs in on our platform, retrieves a used ID that I pass to the Urban Airship SDK via: "UAirship.namedUser().identifier", accepts Push Notifications etc.
- I then send him a message (delivered via a Push Notification or an In-App Message) from the Urban Airship dashboard, targeting this specific user ID.
- The user receives the message, it sits in the Message Center on his device.
- The user logs out, another logs in on the device, we pass a different user ID to the Urban Airship SDK.
- The new user browses the Message Center and still sees messages from the previous user. Even after deleting / reinstalling the app
Is there a way to reset / clear and link the Message Center to the current user logged in my app? I would have though that would happen under the hood by setting a unique identifier to UAirship.namedUser().identifier