mobile-messaging-sdk-android icon indicating copy to clipboard operation
mobile-messaging-sdk-android copied to clipboard

infobip android re-synchronizes push notifications when I logout in my app

Open willianB opened this issue 1 year ago • 2 comments

Hello! When I send a notification from the infobip website it arrives fine, but when I logout it comes back and shows the notification that previously arrived. Reviewing I see that it is because of the intent that runs when I logout in my app, which is as follows:

new Intent(activity, SplashActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);

This immediately executes MobileMessagingSynchronizationReceiver with the onReceive method, which synchronizes the push notification messages.

How can I disable this feature so that I can logout normally without it syncing again? Thanks in advance.

willianB avatar Sep 19 '23 16:09 willianB

Hello @willianB,

when I logout it comes back and shows the notification that previously arrived.

  • If notification arrived and was delivered it shouldn't come again, so this sounds weird that MobileMessagingSynchronizationReceiver again receives the same message, may be you have some specific logic (for ex. another push provider) so message wasn't properly handled by MobileMessaging SDK?
  • if your app has logout/login logic this document about personalization/depersonalization might help you

riskpp avatar Sep 21 '23 14:09 riskpp

Hello @willianB

I just wanted to check have this issue persisted on your side, and have you tried what @riskpp suggested?

ikresicc avatar May 09 '24 11:05 ikresicc