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
**Questions:
- Is it possible?
- What kind of solution can you suggest?
- what is wrong in my solution**
Thanks in advance