0

I want to send the "We miss you" notification to the users who haven't user my app in more than 5 days. Can this be done with Firebase notifications?

I haven't noticed any options when creating a new notification that can see if the app wasn't used or anything similar, so I'm wondering is it possible to retrieve the timestamp of when the app was last accessed and schedule a notification (maybe locally?) using the said timestamp?

AL.
  • 36,815
  • 10
  • 142
  • 281

1 Answers1

0

You can use implement ActivityLifecycleCallbacks.To know how to implement refer -Automatically log Android lifecycle events using ActivityLifecycleCallbacks?

Once you implement ActivityLifecycleCallbacks you will get callback whenever any of the activity is interacted by the user.

You can send this timestamp to the server everytime user interacts with your app.

The server can maintain 5 min timeout logice and send a push notification to the device.

On receiving the push notification your app can show notification to the user.

Community
  • 1
  • 1
rupesh jain
  • 3,410
  • 1
  • 14
  • 22