user3547221
user3547221

Reputation: 13

Objective-C: Real-time location updates

I wanted to ask is there anyway to communicate the location of someone to another device live? Sort of like GPS or instant messaging.

I know that you can use CLLocationManagerDelegate to update location. Instead of updating to a database like Parse and having the receiving user grab from there, is there a way to send immediately to the receiver? The functionality I am looking for is similar to how you can see yourself move on Google Maps GPS or how you can receive a message instantly in other apps.

Right now I currently am using Google Maps SDK so I would be updating the marker location as soon as the location was updated.

Any suggestions?

Upvotes: 0

Views: 1711

Answers (2)

Pritesh Patel
Pritesh Patel

Reputation: 119

If you want to get location through ios , then you can refer to this question:

How can I get current location from user in iOS

May be the below link of article can also help you in some way

Location services provide a way to improve your app by enhancing the user experience. If you’re developing a travel app, you can base on the users’ current location to search for nearby restaurants or hotels. You can also find the location feature in most of the Photo apps that saves where the pictures are taken. The Core Location framework provides the necessary Objective-C interfaces for obtaining information about the user’s location. With the GPS coordinate obtained, you can make use of the API to decode the actual street or utilize the Map framework to further display the location on Map.

You can check link below for further info http://www.appcoda.com/how-to-get-current-location-iphone-user/

Upvotes: 1

Lyndsey Scott
Lyndsey Scott

Reputation: 37300

Yes, since iOS has a location services background mode, this is completely do-able. As soon as a user's location is updated, you can perform whatever task you need to in the app delegate (limited to a few minutes), which in this case would be sending the user's location to the other device. For real-time sending, I recommend Firebase; but push notifications should probably work as well if you don't mind a few seconds delay (seems like a few seconds shouldn't matter in this case).

Upvotes: 0

Related Questions