“Find my friends” style GPS (remotely ping for loc

2019-08-14 06:51发布

In the "find my friends" ios app, a friend can ask for another person's location. Find my friends grabs the location in the background and the location services arrow appears momentarily. I am mainly concerned with the fact that the GPS arrow indicator is only shown when the user is pinged by a friend (does not remain on).

My intended scenario: Bob opens the app and pings his friend John for John's location. John's phone momentarily shows the GPS arrow and in the background, sends back his location to the server where we can send info back to Bob.

What is the basic strategy for accomplishing this? Is there some way to wake the app in the background to grab location?

I don't want to use something like significant location changes as I only want to grab user location when a specific action happens (a friend pings them).

Thanks so much!!

2条回答
唯我独甜
2楼-- · 2019-08-14 07:29

You need to have a service running on the phone that can handle a request to get user location ans send it back.

查看更多
仙女界的扛把子
3楼-- · 2019-08-14 07:31

Even I am trying for the same solution but after loads of R&D I found that there is no way you can request a device to open up the app and send the location... apple used their own api to get the location of friend when request arrives.

查看更多
登录 后发表回答