Comments (16)
No worries, glad you got it working.
from background-geolocation.
Just my two cents, but I believe you can use the Capacitor Permissions plugin to check which permissions have been granted.
As far as I know, this plugin doesn't use the ACCESS_BACKGROUND_LOCATION
permission, but instead utilizes a foreground service. This is why there is a persistant notification. The ACCESS_BACKGROUND_LOCATION
permission is a bit more intense, and requires you to send in a video explaining and demonstrating exactly how you use that permission.
from background-geolocation.
That is correct. Don't worry about the background permission.
from background-geolocation.
@alexandermccormick I did send a video demonstrating the use, but my user still experience issue tracking the location when the driver is an Android user, and I keep seeing the above issue on Sentry.
and my options on the app look like
{
backgroundTitle: 'My App is tracking your trip.',
backgroundMessage: 'My App is operating on the background.',
distanceFilter: prodMode ? 2 : 0
}
So not sure how to handle it.
from background-geolocation.
Some Android devices need battery saving optimizations disabled (via the Settings app) to reliably receive location updates in the background. Your Sentry report mentioning ACCESS_BACKGROUND_LOCATION is a red herring - this plugin does not need that permission.
from background-geolocation.
What problem is your user experiencing exactly?
from background-geolocation.
Your Sentry report mentioning ACCESS_BACKGROUND_LOCATION is a red herring - this plugin does not need that permission.
I added it since I thought that was the reason I wasn't getting constant updates.
What problem is your user experiencing exactly?
![Screenshot 2023-07-09 at 14 39 55](https://private-user-images.githubusercontent.com/12111716/252145767-bb71b847-8b3c-4999-ab78-934f40c817df.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTMwNTkwMDEsIm5iZiI6MTcxMzA1ODcwMSwicGF0aCI6Ii8xMjExMTcxNi8yNTIxNDU3NjctYmI3MWI4NDctOGIzYy00OTk5LWFiNzgtOTM0ZjQwYzgxN2RmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA0MTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNDE0VDAxMzgyMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVjMDgzYjdiYjU2YjE0MWEzYjg3ZjAzZDI2ZTliYTc5NGFmMTI0ZWMyNDlmOTZhYTQxYzBmNDVjYmQyY2JjYTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.NqGOhg1kztbrifYIg7AtjgbX3qE9VJyQLK0Y3lFHRew)
The location is not being received or sent after a while.
I will remove ACCESS_BACKGROUND_LOCATION
and try again and revert when I get updates
from background-geolocation.
Make sure you are using the legacy bridge, otherwise location updates will stop after 5 minutes in the background on Android. https://github.com/capacitor-community/background-geolocation#android
from background-geolocation.
Make sure you are using the legacy bridge, otherwise location updates will stop after 5 minutes in the background on Android. https://github.com/capacitor-community/background-geolocation#android
![Screenshot 2023-07-10 at 11 03 43](https://private-user-images.githubusercontent.com/12111716/252289833-a53b5739-3a14-43f5-9e38-40e3dc7f62ea.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTMwNTkwMDEsIm5iZiI6MTcxMzA1ODcwMSwicGF0aCI6Ii8xMjExMTcxNi8yNTIyODk4MzMtYTUzYjU3MzktM2ExNC00M2Y1LTllMzgtNDBlM2RjN2Y2MmVhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA0MTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNDE0VDAxMzgyMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWIwMWEzNTVhYmZkYTMxNDk5MjkwNGE5NGJiYzAyZjZhYjM4NmMyM2FjNWQyYjc0ZjU2MTY5YzczYmE4MzdhN2MmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.FJ3n5xMGe62573EHhXFirpj1BakUk5hMmhno0wQgwiY)
from background-geolocation.
Are you familiar with the limitations on sending HTTP requests while the app is in the background? See #14 (comment).
from background-geolocation.
Are you familiar with the limitations on sending HTTP requests while the app is in the background? See #14 (comment).
Yes, I use the capacitor http plugin. I'm busy testing with different devices to see if the issue is not our my server instead.
I will update asap.
from background-geolocation.
Here are my findings:
- The location data get sent for a while then "pause" until I open the app again only to receive a bunch of them at once
- The notification shows but looks like it's the system notification and not the plugin's. I concluded so because the title & message are different from the one displayed. The title displayed says:
AppName is running
& the message:Tap for more information or to stop the app
.
Is there anything I could have missed?
from background-geolocation.
I would say your problem is the notification. If the notification is not correctly configured, background location updates don't work properly. Make sure you've generated the icon correctly, using Android Studio:
<!--
The icon to use for the background notification. Note the absence of a
leading "@". It defaults to "mipmap/ic_launcher", the app's launch icon.
If a raster image is used to generate the icon (as opposed to a vector
image), it must have a transparent background. To make sure your image
is compatible, select "Notification Icons" as the Icon Type when
creating the image asset in Android Studio.
-->
<string name="capacitor_background_geolocation_notification_icon">
drawable/ic_tracking
</string>
If the notification is misconfigured, it seems to open the Settings app when tapped, rather than your app.
from background-geolocation.
Make sure you've generated the icon correctly, using Android Studio
Let me try this. My icons are generated with the capacitor assets plugin
from background-geolocation.
I will run and see if the notification appears after this.
from background-geolocation.
I got the notification working.
I did this.
To make sure your image is compatible, select "Notification Icons" as the Icon Type when creating the image asset in Android Studio.
My mistake was the name of the icon that I did not set properly. I kept the one from the example: ic_tracking
.
I will revert later if I encounter issues.
Thanks for your patience and assistance.
from background-geolocation.
Related Issues (20)
- AddWatcher only retrieves location once HOT 3
- Using capacitors own HTTP module/plugin to solve the loss of location updates causes issues with the firebase sdk HOT 1
- Android 13+ (API 33+) Needs runtime Notification Permission HOT 4
- Using Updated Version With @capacitor/geolocation Makes The App Crash HOT 17
- distanceFilter battery consumption HOT 1
- Failure delivering result ResultInfo{who=@android:requestPermissions HOT 1
- Android notification forwards to App Settings instead of App HOT 3
- Update Notification Body Text HOT 2
- Missing permissions to Android 14 (specific to Samsung phones in particular) HOT 4
- Does it conflicts with capacitor/geolocation? HOT 4
- Failure in callback after 5 minutes only Android 14 (API level 34) HOT 8
- Crash onUnbind Android HOT 2
- Android Background icon issue in some devices HOT 3
- BACKGROUND LOCATION NOT WORKING AFTER 5 MINUTES HOT 3
- SPEED ALWAYS SEEMS 0
- location speed value always 0 or some floated value HOT 1
- update POST Api every 5 minute HOT 1
- Geolocation not work if communication is disabled HOT 3
- Ionic/vue3 Example HOT 1
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 background-geolocation.