Send Request in background

347 Views Asked by At

How can I run service in background to send periodic request to server and show notification from server response to user even app is killed(swiped left or right)?

1

There are 1 best solutions below

1
On

Please let me break your question in few parts and answer them one by one.

  1. How can I run service in background - Services are usually running in background.
  2. Send periodic request - AlarmManager is a good choice for repeating behaviour. Please read more about here
  3. Show notification from server response - please be more specific about what type of notification you have in mind, you need a custom or show a standard one. Also you can implement Firebase and put your logic behind handling notifications.

What research have you done, do you have any code you are struggling?