Comments (7)
One of these is for the background permissions. Notoriously and unfortunately, background modes have not worked without the usual coarse/precision request first.
I'm open to suggestions as I've been through a ton of use-cases and devices for this.
from shiny.
I experimented yesterday with the Xamarin Essentials implementation - that one doesn't open the "settings" page:
var request = new GeolocationRequest(GeolocationAccuracy.Best, TimeSpan.FromSeconds(10));
var location = await Geolocation.GetLocationAsync(request, CancellationToken.None);
But I would prefer to use Shiny library for that as it better does background services.
I don't understand why the "settings" page is opened when using the IGpsManager
..
Also, that confuses me even more:
If I try MAUI version (Shiny.Locations v3), then it doesn't open the settings page, but I couldn't find how to use background reading in v3 (the UseGps<>
was removed, I guess)
UPD. Oh, UseGps<>
became AddGps<>
, good. So, I tested v3 and it doesn't open the settings page, even if the background reader is enabled 👍
But, I don't know how to upgrade from v2 to v3... Things (like ShinyStartup and ShinyHost) have changed a lot...
from shiny.
I don't understand why the "settings" page is opened when using the IGpsManager..
Please read my previous response. It was what I tested. It was changed in v3 because foreground services didn't require the background manifest permission.
But, I don't know how to upgrade from v2 to v3... Things (like ShinyStartup and ShinyHost) have changed a lot...
It's a major version. There are lots of samples and templates that can help.
Ok v3 is all I support right now and if you don't have the issue there - then all is good.
from shiny.
The breaking changes are not documented, unfortunately, so that was a painful upgrade. But (I think) I managed to upgrade it to v3.
if you don't have the issue there - then all is good.
I am not convinced that the issue is fixed.
It seems that the gps background service is broken - I only get the first reading, and never get future readings...
What I do is
if (_gpsManager.IsListening())
{
await _gpsManager.StopListener();
}
await _gpsManager.StartListener(GpsRequest.Realtime(true));
I have my delegate
public class MyGpsDelegate :
Shiny.Locations.IGpsDelegate,
Shiny.IAndroidForegroundServiceDelegate
{
public Task OnReading(GpsReading reading)
{
Log("============ Background === Lat: " + reading.Position.Latitude);
return Task.CompletedTask;
}
...
the OnReading is only hit once.
Do you know if I can be missing something?
from shiny.
Actually, even the Foreground tracking doesn't get the new readings
from shiny.
The breaking changes are not documented, unfortunately, so that was a painful upgrade. But (I think) I managed to upgrade it to v3.
This isn't a product. I do the best I can with the time I have. Documenting upgrade processes just isn't something I have the time to do.
It seems that the gps background service is broken - I only get the first reading, and never get future readings...
I'm using it actively in a couple of projects and its working fine for me. File a new issue with a full reproducible sample and I can take look.
from shiny.
I'm sorry, I didn't mean to blame you. The library is great, and I appreciate the work you do!
--
I kept testing and debugging, until once I got a new reading after ~ 5 minutes. Then I decided to try AndroidGpsRequest
with Interval set to 5 seconds instead of GpsRequest.Realtime(true)
and I do get new readings now!
When the app is minimized, I don't see the logs anymore, I'll keep investigating this one.
But I agree, this issue can be marked as resolved (by upgrading from 2.7 to 3.0). 👍
Thank you for your help and the time spent
from shiny.
Related Issues (20)
- [Bug]: HTTP Transfers Foreground Service not exiting after all transfers completed HOT 1
- [Bug]: BLE operation lock not released when cleaning up characteristic notify subscriptions before closing connection HOT 3
- [Bug]: Shiny.Notifications 2.7.2 blocks upgrade of Xamarin.Forms 5.0.0.2612 HOT 3
- [Bug]: Push Notification IntentFilter on Android is not working HOT 7
- [Bug]: iOS - Push notification alert tap crashes the iOS app while app is Active/Foreground
- [Bug]: ScanResult.AdvertisementData.ManufacturerData.Data is Empty HOT 5
- [Feature Request]: HOT 1
- [Feature Request]: Allow configuration of iOS foreground notification presentation options HOT 2
- [Bug]: The operation have time out while NotifyCharacteristic function call HOT 8
- [Bug]: Android Foreground Notification does not always dismiss HOT 1
- [Bug]: Issue with foreground service when restarting GPS listener on Android HOT 1
- [Feature Request]: Android Local Notifications - Categories HOT 1
- [Bug]: Thread Safety GetCurrentPosition GPS manager extension method HOT 1
- [Feature Request]: IGpsManager.GetCurrentPosition() extension method needs a timeout parameter. HOT 4
- [Bug]: Issue with foreground service starts not HOT 3
- [Bug]: OnGpsReading is not triggered when service is started and StartListener HOT 3
- [Bug]: Crash tapping local notification on iOS earlier than 16 when accessing FilterCriteria HOT 2
- [Bug]: Notification + Background Job HOT 7
- [Bug]: NotifyCharacteristic throws BleException "Characteristic notification descriptor not found" HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shiny.