New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin: Geolocation #121

Closed
FlutterIssues opened this Issue Nov 9, 2015 · 32 comments

Comments

Projects
None yet
@FlutterIssues

FlutterIssues commented Nov 9, 2015

Issue by eseidelGoogle
Wednesday Aug 05, 2015 at 19:34 GMT
Originally opened as https://github.com/flutter/engine/issues/471


Some features include:

  • geofencing (region monitoring)
  • current/last location
  • location updates
  • beacons
  • testable (mockable) APIs

@sethladd sethladd changed the title from Add a GPS/Location service for Sky to Add a GPS/Location service Dec 7, 2015

@sethladd sethladd added the plugin label Dec 7, 2015

@sethladd

This comment has been minimized.

Contributor

sethladd commented Dec 7, 2015

Android location APIs from Play Services: https://developers.google.com/android/reference/com/google/android/gms/location/package-summary

(the android.location APIs are not recommended. Android wants us to use the Play Services APIs for location)

@sethladd sethladd added this to the Hackathon milestone Dec 7, 2015

@eseidelGoogle eseidelGoogle modified the milestones: Blocks Adoption, Hackathon Jan 26, 2016

@eseidelGoogle

This comment has been minimized.

Contributor

eseidelGoogle commented Jan 26, 2016

No longer in scope for the hackathon.

@edelvalle

This comment has been minimized.

Contributor

edelvalle commented Aug 31, 2016

There is right now a simple way to ask for the last known location in Android:

import 'dart:jni';


final Context = Java.getClass('android.content.Context');
final LocationManager = Java.getClass('android.location.LocationManager');


getLastLocation() {
    final context = new JavaObject(JniApi.getApplicationContext());
    final locationManager = context.getSystemService(Context.LOCATION_SERVICE);

    return locationManager.getLastKnownLocation(
      LocationManager.PASSIVE_PROVIDER
    );
}

Is there an easy way to get location udpates? Because I can not create a LocationListener from Dart and pass it to Java. 😢

@a14n

This comment has been minimized.

Contributor

a14n commented Sep 2, 2016

It is possible to access Plateform Services to request location updates. I made a little demo available at https://github.com/a14n/flutter-geolocation-demo that shows how to do that. See the Android code that forwards locations to the flutter part.

@sethladd

This comment has been minimized.

Contributor

sethladd commented Dec 2, 2016

My understanding is that our strategy is to build out a plugin/interop layer, and then use that to allow the ecosystem (flutter team? developers?) to build a Geolocation service.

I'm going to close this issue in the meantime. However, ensuring GPS/Geolocation can be exposed via plugins/interop is on the radar and important. We're just unlikely to deliver this specific API directly as part of Flutter.

@sethladd sethladd closed this Dec 2, 2016

@sethladd sethladd reopened this Jan 27, 2017

@mit-mit mit-mit changed the title from Add a GPS/Location service to Plugin: Geolocation Feb 2, 2017

@mit-mit mit-mit added p: self service and removed plugin labels Feb 2, 2017

@mit-mit mit-mit modified the milestones: 4: Make shippers happy, 5: Make Hixie proud Feb 2, 2017

@paolosoares

This comment has been minimized.

Contributor

paolosoares commented Feb 23, 2017

This blocks customer:mulligan, as it requires the current/last location for a critical user flow.

@abarth abarth modified the milestones: 1: Top Customer Requests, 4: Make shippers happy, 2: Make Early Adopters happy Feb 24, 2017

@Hixie

This comment has been minimized.

Contributor

Hixie commented Mar 1, 2017

When doing this, consider writing #1432 at the same time.

@sethladd sethladd added this to the 3: Make conferences happy milestone Mar 14, 2017

@martijn00

This comment has been minimized.

martijn00 commented Jul 31, 2018

As @mit-mit pointed out we made a new Geolocation plugin, which is available at https://github.com/BaseflowIT/flutter-geolocator. If there is any feature missing or you encounter a bug, fill out an issue in the repo and we'll take a look as soon as possible!

We aim to make this the default go-to plugin for geolocation, including all requested features, and having a great documentation.

@mit-mit

This comment has been minimized.

Member

mit-mit commented Aug 6, 2018

Thanks much @martijn00; I'm going to close this tracking issue with the assumption that this is now covered.

@NikhilJogdand

This comment has been minimized.

NikhilJogdand commented Aug 9, 2018

How to turn on GPS on flutter ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment