0

When I get Only data FCM notification, I want to get person location and send it to my API in all app states: Foreground, Background, Terminated.

When app is in Foreground I have no problem. When app goes to Background I am not able to get device location and make API call. I did not even test terminated because I had no success in Background yet.

What I am using for test is: FCM: firebase_messaging To create background task: background_fetch

On notification received I am creating background task (NOTE: It will be created on background or terminated states in this states, not sure if this is true, most probably not I think.)

here is what I receive when trying in background

enter image description here

**Questions:

  1. Is it possible?
  2. What kind of solution can you suggest?
  3. what is wrong in my solution**

Thanks in advance

  • Could you share the code of your late variable so others can see how are you initializing the data? – Yuji Bry Feb 06 '23 at 13:51

0 Answers0