“Find my friends” style GPS (remotely ping for location)

邮差的信 提交于 2019-12-11 04:41:54

问题


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!!


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/17494135/find-my-friends-style-gps-remotely-ping-for-location

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!