1

I want to call a service continuously to check the new created event location to hit the server when app kill/terminate, because I want to fetch near by event location push notification with in 500m. But I am unable to call any service while app kill. But in background it's working fine.

Dhananjaya
  • 21
  • 3
  • Possible duplicate of -> https://stackoverflow.com/questions/34527972/location-update-even-when-app-is-killed-terminated – Keshu R. Nov 28 '19 at 10:44
  • You cannot run code in your app when your app is not running – Scriptable Nov 28 '19 at 15:41
  • Possible duplicate of [Location update even when app is killed/terminated](https://stackoverflow.com/questions/34527972/location-update-even-when-app-is-killed-terminated) – Vaibhav Jain Nov 28 '19 at 18:19

2 Answers2

1

You can check this -> Scheduling a Notification Locally from Your App

  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Keshu R. Nov 28 '19 at 10:56
  • Please read the question carefully – Dhaval Raval Nov 28 '19 at 11:01
  • Thank you, for your reference, but while I am killing the app at the moment new event creating from back office/ backend end then how it will get & notify. I need to call the service/API to get the list of event. then only I can set the notification. So while app in kill/terminate stage how to call a service to get the list of event. – Dhananjaya Nov 28 '19 at 12:00
0

Strictly follow this json to get silent push notification which will wake your application if killed otherwise in the background you will get didReceiveRemoteNotification method trigger for more information and video please check More Detail

For testing it you can send silent notification from the postman with,

Select Body -> Raw -> Json payload

{
    "content_available":true,
    "priority":"high",
    "data" : { 
        "article" : "12212121"
    },
    "to" : "eqZ_xx:APA91bxxxxZvAZF05J1-Vv5HrIU6cXVQdq8GExxxg-DWjVU0b8Ci36AWV0QrbsjKUWxxc1Q-vjrGclrEqZmMxhYMKriQFJQcmN5aBZX45Kht_PR86O_iaW7pzSxAFH"
}
Paresh. P
  • 486
  • 5
  • 18