Description
Step 1: Describe your environment
Android Studio version: 4.1.2
Build #AI-201.8743.12.41.7042882, built on December 20, 2020
Runtime version: 1.8.0_242-release-1644-b3-6915495 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.16
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 12
Registry: ide.new.welcome.screen.force=true, external.system.auto.import.disabled=true
Non-Bundled Plugins: org.jetbrains.kotlin
Firebase Component: Cloud Messaging
Component version: com.google.firebase:firebase-messaging:20.2.4
Step 2: Describe the problem
Steps to reproduce:
Problem: User properties are not getting updated. Notifications based on User properties are receiving for wrong users.
Please follow below steps:
1. Create a project with firebase cloud messaging.
2. Make sure that you are receiving notifications from firebase console after device registration.
3. Consider a login/logout feature for your app. (Or create a button with Login / Logout).
4. Now once you tap login set some user properties. (say "user_membership": "premium").
val firebaseInstance = FirebaseAnalytics.getInstance(getAppContext())
firebaseInstance.setUserProperty("user_membership", "premium")
Note: wait for few hours to replicate user properties as per guidelines.
5. Create a Notification Campaign with user property who have premium access as below.
6. Send Notification and make sure you received notification.
7. Now tap on Logout.
8. Since we have logged out make user properties to empty value or null. (say "user_membership": "" or null).
val firebaseInstance = FirebaseAnalytics.getInstance(getAppContext())
firebaseInstance.setUserProperty("user_membership", "")
Note: wait for few hours to replicate user properties as per guidelines.
9. Do step 5 again.
10. Send notification but this time Notifications are still receiving even though we have updated user properties.
Expected: Notification should not receive after user properties have been updated.