WhatsApp like location sharing in iOS application - ios

I want to share user's current location from my iPhone application. And plan to show a preview screen of recieved location, like location sharing feature in WhatsApp application.
Is there any in-built functionality available with MapKit or Google Map in iOS.
Any suggestions?

There's no direct feature available (except whatsapp developers), but here's an idea to do this
Get user current location using CLLocationManager see this answer
Refer this, https://developers.google.com/maps/documentation/staticmaps/
You've to pass users latitude and longitude which you've to use to create static map image URL
Load that URL in UIImageView in background (something like, SDWebImage)
You've to setup your required UI for this.

Related

Google Maps SDK doesn't work in iOS Share Extension

I have an app that uses the Google Maps SDK for iOS to show an interactive map on a particular screen. It works great.
Now I've added an embedded "share extension" that uses the same components to allow the user to share content (e.g. photos from the Photos app) to my app. Everything else in the extension is showing up exactly as in the app, apart from the Google Maps component, which shows the Google logo on a blank map with no features.
The map responds to taps as I would expect (e.g. I can blindly tap the map and it will report the coordinates I've tapped on), though nothing is shown on the map, which makes me think this is a rendering problem.
The SDK is being initialized with the same API key that I use in the main app. The API key is not restricted to a particular app ID in the Google Console.
Has anyone seen this? Any workaround (apart from switching entirely over to the Apple Maps SDK)?

Swift : Can I use home and work locations using MapKit?

Everyone knows that Maps app can detect your home and work location and it shows you with "maps destination" feature. I am just wondering how it gets our specific location like work and home. Is it because we are stable on some places and it figures out we live here and we work there in specific time?
I'm also wondering that how can we get detected datas from the maps. Is it possible that I can use home and work locations on my app, using MapKit?
No you cannot, since it’s confidential users data. Only apples map app can use it

Is it possible to get turn by turn directions using Google Maps Api in iOS?

I am looking for a way to get or make turn by turn navigation using Google Maps Api in swift. I've done drawing polylines from source to destination using GoogleMaps Api but still couldn't find a way to do turn by turn navigation. Is it possible?
-Thanks
Yes. It is possible.
Please refer following link which is using turn by turn directions using google API.
https://itunes.apple.com/us/app/biznavi-gets-you-where-you/id597147565?mt=8
(see last two screen shot of iPad from itunes link)
To achieve it, you have to use Google Direction API which allows us to use upto 8 way points.
After that you will get an array of route including all turn by turn message and lat/long.
Just create a CLRegion of 100 meters (or as per your requirement.) around your current location in locationDidUpdate method. If next point of route array falls within CLRegion, just show a message received in routes array by google API.
I have made above application but it was not updated after uploading to store so it is having old UI and it is not having iPhone 5+ support. Sorry for that but you will find feature you require in this app...

In app map navigation with voice in iOS

I need to implement a map navigation in an iOS app to guide user from current location to the target destination. I do not want to redirect the user to another app such as Apple Map or Google Map. I need to do this inside my app. MKDirectionsRequest return step by step direction but no voice.
Also mtdirectionsk has done this but I am not sure if it has the voice guide.
As far as I know this is already done in at least one app: Uber Driver

How to get live data from Maps like Speed, location? Is it possible?

So I got a question I don't know if it is possible or not.
I have searched around the web for a while but I could not find anything.
So I have an application that opens Maps app pragmatically when a situation occurs. My question is later when that user is redirected to the Maps app can I get live data feed like speed as it is changing or other values?
Examples or links would be nice if there is such a way to do it
I recommend the following:
Use the MapKit framework and a MapView inside your own app instead of redirecting the user out of your app.
If you absolutely have to redirect the user out of your app, then you have to ask for permission from to user to use their location data while your app is in the background. Since they're in Maps and not in your app, you're using their location data in the background. You can read this article on requesting for permission in iOS 8.
Get location data by using CoreLocation's CLLocationManager, and implementing the CLLocationManagerDelegate protocol. There's a delegate method which gives you CLLocation objects, which in turn hold properties such as speed, course, etc.
Here's an EXAMPLE for using CLLocationManager.

Resources