-
-
Notifications
You must be signed in to change notification settings - Fork 699
🚀 WearOS support #1197
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
Comments
This is a follow up to #785 |
This comment was marked as off-topic.
This comment was marked as off-topic.
Any updates on this? There is still not a single Location package that supports WearOS. |
While wearOS is still not officially supported by flutter, most use cases can be covered by third party packages like this one and I personally have multiple apps productive on the play store. However, there is still no location package available for wearOS applications, signifficantly reducing the appeal of using Flutter for wearOS. Supporting this use case could be huge for Flutter on WearOS. |
I am considering implementing this feature in the near future. Can you point me to what would have to be done in order to do so? This woul dbe the first time I work on Flutter plugins, so I would really appreciate the help. Also, would a wearOS implementation be part of the geolocator_android federated plugin, or would it be implement as a separate federated plugin? |
It would be so great to see geolocator working on WearOS ! As of the WearOS implementation for geolocator, I guess it could be part of geolocator_android plugin, but might not be the easiest way though. If any help is necessary I would be glad to join, even if I'm in the same situation as you are regarding Flutter packages. |
@masus04 @SkylL3r I need this too for my project and would also being willing to chip in. Yeah I believe the geolocator_android is the place to start. I was able to build a local bridge between android and flutter to get it working on my emulator (can't see to get it working my device though), that's where I added my code. |
@masus04 @SkylL3r I was able to get the location working on WearOS writing my own code (not using this package). The trick is to use the |
@tgritter Indeed, I also was able to get the location on WearOs using So I'd be interested in seeing your code as a comparison and/or show you mine. I also keep thinking it would be a great addition to this package for future users. 👍🏽 |
@SkylL3r Here is my code: build.gradle
MainActivity.kt
Then you can call it in Flutter like so:
|
And yeah would be great to get this package working for future users. Although it's probably not as simple as just copying and pasting this code 😟 |
Any news here ? |
@momo21584 I haven't made a PR for this change, no. If you need GPS for the watch I would advise building it yourself using a bridge modal. The code I posted above ^ was mainly working for me. The key difference between the watch and phone is using the |
If it's not that big of a change, would it be possible to open a PR for it? |
@masus04 I think it would be a big change unfortunately. There would be a lot of device based logic you'd have to be very careful about. You'd probably need to test on various devices too, different watches handle GPS differently I've found. There may be other device based problems encountered too. Unless someone really wants to take this on, I think writing a bridging module is going to be much easier for getting Flutter GPS on WearOS. A good experience too, I learned a lot about bridging writing mine! |
I noticed that this error is seen because SettingsClient returns DEVELOPER_ERROR on Wear OS. I was able to get getCurrentPosition API working by modifying the status code check in FusedLocationClient.java Line 267 in a24775b
Sharing in case anyone needs it. I will try to send a pull request if I get a chance but please feel free to beat me to it :) |
That's the only change you had to make in order to get geolocator to run properly on WearOS? That would be wonderful news 👍 |
Yep, I didn't test all APIs but getCurrentPosition works after that change. As far as I can tell geolocator already uses FusedLocationProviderClient, it is just not working on Wear OS because of this error. |
Could you open a branch & PR? I'd be happy to test it on my app/devices. |
PR sent. I don't know if it fixes all issues on Wear OS but getCurrentPosition() works for me after that change. |
🚀 WearOs Support Feature Request
As WearOS is based on android and works quite similar, it would be great to have geolocator support it.
So far none of the Flutter location packages are supporting WearOS and this could be a great argument to use geolocator.
Contextualize the feature
Geolocator supports most relevant platforms on which location is required. The only exception being Apple watchOS and Android WearOS. This feature request seeks to address one of these. Doing so would also make geolocator the first flutter plugin that supports location integration on wearOS devices.
Describe the feature
Ideally the full feature set that is currently supported on mobile android should be supported. If there are limitations, the key features would be a great start.
I suspect the fact that geolocator does not currently work on wearOS, even though it works great on android is mostly due to different permission / service requirements.
Platforms affected (mark all that apply)
Test Application
I have set up a very minimal test application to showcase the current behaviour: https://github.com/masus04/Flutter-WearOS-Location/blob/main/README.md
The same behaviour can be observed when running the application on an emulator in Android Studio or a physical device.
When running this application on Android mobile / wearOS, the following log is printed:
Android Mobile
WearOS
This is with the latest Flutter & dependencies at the time of this issue
The text was updated successfully, but these errors were encountered: