Is it possible to share your location through flutter app - flutter

I built an app in flutter, dart to access the location of the user. I now want to share the current physical location of the user via Whatsapp, email etc but not as coordinates.
I have tried geolocation as well as location but seem to only manage to get the coordinates. Below is a snippet of my share button that shows me the coordinates.
_share(){
Share.share('I have arrived safely at ${_currentLocation.latitude} & ${_currentLocation.longitude}');
}
I am expecting to see a message that can be shared to anyone on my device that provides my current location. I am not receiving any error messages as i am currently only getting the coordinates as shown in the code. What can be done to share the physical location of my device?

I have figured out that the only way to be able to share your location via a flutter app is to add the coordinates to a url string of google maps
i.e.
_share(){
Share.share('https://www.google.com/maps/search/?api=1&query=${_currentLocation.latitude},${_currentLocation.longitude}');
}

Related

Share my objects using a link - ionic3

I'm imagining this situation: I have my app opened on my device. I've just created a new element (object) in my app, for example a new Film like this
film = {
title: 'Shark 3',
subtitle: 'the revenge',
date: '12-11-2019',
plot: '...'
};
and I've saved it in my local storage. Now I want to share it on socials (WhatsApp, Facebook...) generating a link to this object. By clicking on this link I want my app (or the app store if it is not installed) to open. In case my app is installed, it should display a page with the film's information.
Is it possible? How to do this in ionic?
The data you want to present is stored within the app and so available on every device your app is installed, I guess? Or is it data loaded from a backend?
What you want to do is called a Deep Link. This means clicking on a links opens your app and redirects the user to a specific page depending on the link.
This is possible with Ionic and the DeepLink native plugin.
But there need to be done other things outside your app to make it work. You need to register and verify your domain with Google and/or Apple.
And be aware testing this is very uncomfortable. It will only work with signed packes. So just running ionic cordova run android won't work, you will have to go the whole way creating a signed package as you need to do when you're going to publish it.
Here is a Blog article describing the functionality.

iOS web app "Open this page in Maps?" popup when trying to open the Maps App

I'm writing an iPhone web app using HTML5/CSS3. I need to embed a link to open a built-in maps app from my web app. To open a location on the map I redirect mobile Safari to URL like this:
http://maps.google.com?q=Business+Name%26+Street+Address+City+State+Zip
In this case if a user taps on this link the iPhone opens up the maps app and displays the location specified in the URL.
But when I need to provide a URL for driving directions to a predefined location:
http://maps.google.com/maps?saddr=1234+1st+ave+portland+or&daddr=Business+Name%26+Street+Address+City+State+Zip
I've encountered a strange situation when in some cases the iPhone displays a pupup message:
Open this page in "Maps"?
with a choice of yes and no, and only if a user taps Yes, the maps opens up with directions. Note that this popup shows only for some addresses.
Is there any way to prevent this popup from showing at all?
I've created simple web page. Put a link and set google map link with query string value of particular address on src attribute of link element,run it to my iPhone 4.It is working fine, I'm not getting any window to ask it open on map app.
I noticed that you've used "saddr" as a query string parameter. You can replace that with "q" query string parameter.

Is it possible to disable google maps from requesting user location?

I'm guessing not, but I'm creating an app that gets the users coordinates using CLLocationManager, then passes the coordinates into Google maps to display directions. When the webpage opens to display, it requests the users location, and if the user says yes, it somehow affects some variables in my code. I was curious if the prompt from Google maps can be disabled, or if the coordinates that Google maps does take in can be retrieved by my app somewhere. I'm pretty sure neither are possible, just tossing it out there.
short answer. NO.
The location fetching in google maps app is done through JavaScript api
more details here
if you can disable the javascript the map routing itself might not work so NO.
the part about retrieving variables, I think you can check the webview shouldStartLoadWithRequest and check the url, maybe that has some information you can fetch out.
If anyone else needs it, here is an answer
let mapView = GMSMapView()
mapView.isMyLocationEnabled = false

Link directly to Google Maps transit directions mobile site

If you visit maps.google.com on a mobile device, then press 'Menu', 'Get Directions', and select the 'transit' option, you are taken to a page where you can enter two locations and a date/time, and get directions on public transit. However, the URL is still maps.google.com.
Is there any way to link directly to this page so that I can load it in a UIWebView in my iOS app? Would 'clicking' the buttons in Javascript be (the only/a good) solution?
Try: http://www.google.com/transit
Even clicking the buttons in javascript doesn't seem to be working. The Google Maps code is a little strange- the event listeners aren't assigned directly and I can't get a .click() to work. So what I'll do is have the user enter the two locations in boxes in the app, then load something like http://maps.google.com/maps?f=d&source=s_d&saddr=Coover+Hall&daddr=lied+rec+center in the UIWebView, except I'll add some more specific location information before building the URL, since this is a city-specific app. Not a perfect solution but it gets the job done.
You could create a URL that links to the transit directions with the "dirflg=r" paramater.
Find the other URL parameters here: http://web.archive.org/web/20110714031648/http://mapki.com/wiki/Google_Map_Parameters

Unable to use Facebook Places after manually setting Geolocation in Firefox

I am having a play with Facebook Places but don't want to publish my current location for privacy reasons. I therefore changed the geo.wifi.uri in the about:config in Firefox to point to a file containing JSON of my location with the lat and long. This works great and if I test by using Google Maps or the Mozilla Geolocation test I get the location I have specified. However, if I 'Check in' via Facebook (touch.facebook.com) in Firefox I can see the location on the little Bing map but get the following error
We couldn't determine the coordinates of this location. Check if your latitude and longitude are in range, and verify the format of the location.\n
Any ideas?
Thanks
I have wired up Google Latitude to Firefox geolocation. This lets you manually update your location in Google Latitude with a single mouse click, instead of looking up your latitude and longitude yourself and typing it into a local file or URI. My article on the subject is Make Firefox Take Geolocation From Google Latitude.
I am not normally a Facebook Places user, but I browsed over to touch.facebook.com and clicked Places, and was presented with the usual permission prompt and then a list of nearby places. So the problem does not seem to be in Facebook or in Firefox. Without looking at your JSON I could not guess why it's not working.
Cheers, MetaEd