1

I want to send a push notification from my app if it was inactive (not used on this device) for a certain time of inactivity (for example one week).

I know how to send push notifications but I do not know how to add the time variable.

Hope you have some ideas!

Mokkapps
  • 2,028
  • 9
  • 42
  • 67

2 Answers2

2

I see two possible solutions:
1. Setup an alarm using AlarmManager every time the user exits your application and cancel it whenever your application starts.
2. In case your application sends http requests to a server, or a server gets notified, in any way, when the user uses your app, detect the inactivity in the server side and send a cloud message when the app has been inactive for x amount of time.

Thomas Kaliakos
  • 3,274
  • 4
  • 25
  • 39
0

you have two solution to implented : -local solution by using "service" runing in background in all the time which detect the local time (but this solution can consume your batterie) -extrenal solution = by push notification of GCM (this solution depends the network connection )

Sofien Rahmouni
  • 4,354
  • 1
  • 21
  • 22