Giter Club home page Giter Club logo

Comments (16)

diachedelic avatar diachedelic commented on August 25, 2024 1

No worries, glad you got it working.

from background-geolocation.

alexandermccormick avatar alexandermccormick commented on August 25, 2024

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.

diachedelic avatar diachedelic commented on August 25, 2024

That is correct. Don't worry about the background permission.

from background-geolocation.

jongbonga avatar jongbonga commented on August 25, 2024

@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.

diachedelic avatar diachedelic commented on August 25, 2024

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.

diachedelic avatar diachedelic commented on August 25, 2024

What problem is your user experiencing exactly?

from background-geolocation.

jongbonga avatar jongbonga commented on August 25, 2024

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

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.

diachedelic avatar diachedelic commented on August 25, 2024

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.

jongbonga avatar jongbonga commented on August 25, 2024

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

from background-geolocation.

diachedelic avatar diachedelic commented on August 25, 2024

Are you familiar with the limitations on sending HTTP requests while the app is in the background? See #14 (comment).

from background-geolocation.

jongbonga avatar jongbonga commented on August 25, 2024

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.

jongbonga avatar jongbonga commented on August 25, 2024

Here are my findings:

  1. 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
  2. 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.

My plugin:
Screenshot 2023-07-10 at 19 37 48

My permissions
Screenshot 2023-07-10 at 19 42 24

My Capacitor config
Screenshot 2023-07-10 at 19 43 40

strings.xml
Screenshot 2023-07-10 at 19 47 36

Is there anything I could have missed?

from background-geolocation.

diachedelic avatar diachedelic commented on August 25, 2024

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.

jongbonga avatar jongbonga commented on August 25, 2024

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.

jongbonga avatar jongbonga commented on August 25, 2024

They were all there already.
Screenshot 2023-07-11 at 11 20 55

I will run and see if the notification appears after this.

from background-geolocation.

jongbonga avatar jongbonga commented on August 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.