pmwisdom/cordova-background-geolocation-services

How to disable toasts?

Closed this issue · 11 comments

Hi.

I have installed this plugin in my App. It working nicely. But I just want to disable these toasts.

I received 3 toasts by intervals.

I removed 2 toasts with this "useActivityDetection: true". I set it false and it works.

Now I have 1 more toast " We receive a location update " and i don't know how to disable that.

Can anyone help me with that?

Thanks.

Set debug to false in your configuration call.

Hi Pmwisdom.

Thanks for the help.

It works now as you suggested.

I received a notification on panel. Is it removable? If so, can you guide me how to achieve that?

Thanks.

` function servicio (){
//Make sure to get at least one GPS coordinate in the foreground before starting background services
navigator.geolocation.getCurrentPosition(function() {
alert("Recuperado con éxito su posición GPS, ahora podemos empezar el rastreador de fondo.");
}, function(error) {
alert(error);
});

                //Get plugin
                var bgLocationServices =  window.plugins.backgroundLocationServices;

                //Congfigure Plugin
                bgLocationServices.configure({
                    //Both
                    desiredAccuracy: 20, // Desired Accuracy of the location updates (lower means more accurate but more battery consumption)
                    distanceFilter: 1, // (Meters) How far you must move from the last point to trigger a location update
                    debug: true, // <-- Enable to show visual indications when you receive a background location update
                    interval: 5000, // (Milliseconds) Requested Interval in between location updates.
                    useActivityDetection: true, // Uses Activitiy detection to shut off gps when you are still (Greatly enhances Battery Life)

                    //Android Only
                    notificationTitle: 'Aplicacion 1G', // customize the title of the notification
                    notificationText: 'Sensando Ubicaciones', //customize the text of the notification
                    fastestInterval: 5000 // <-- (Milliseconds) Fastest interval your app / server can handle updates

                });

                //Register a callback for location updates, this is where location objects will be sent in the background
                bgLocationServices.registerForLocationUpdates(function(location) {
                 //   alert("Ubicacion actual: "+"latitud :" + JSON.stringify(location.latitude)+","+"longitud : "+  JSON.stringify(location.longitude));
          senso_latitud= JSON.stringify(location.latitude);
          senso_longitud = JSON.stringify(location.longitude);
           tiempo = JSON.stringify(location.timestamp);

// alert(tiempo);
alert(senso_latitud);
alert(senso_longitud);
autoUpload();
}, function(err) {
alert("Error: Didnt get an update", err);
});

                bgLocationServices.registerForActivityUpdates(function(activities) {
  //  alert("senso automatico: " + activities);

                }, function(err) {
                alert("Error: Something went wrong", err);
                });
                            //Start the Background Tracker. When you enter the background tracking will start, and stop when you enter the foreground.
                bgLocationServices.start();


                }             

`

I have a friend imlogan problem, I already have this service running biuen; but the problem is I have a function called AutoUpload that is in javascritp that only runs once when the application will give background .. tell me how to make this application by sensing the ubivaciones and both the sending my function this AutoUpload

@imlogan Its not currently possible to remove. Without it, the service would most likely be killed. Its called a foreground notification, and is required for background services to stick around for as long as possible.

@srsarcasmo Please make a new issue.

as I can run a javascript function to send the latitude and longitude of the service .. and AUTOSHIP run even when the background?

Hi Pmwisdom.

Thanks for the clarification.

I removed "NotificationText" from one of the ".java" file and i also able changed "NotificationTitle" so do i.

As you mentioned that it's not possible to remove notification completely so I'm just assuming is it possible to change the icon?

Can you guide me with this?

Thanks.

Hi @srsarcasmo

I don't try to upload that co-ordinates to the database yet so I don't know that it causes to run in the background. Also I should try to upload that co-ordinates to database.

I hope that you make it work my friend.

Thanks.

Hi @pmwisdom.

I'm testing this plugin from last 2 days and I notified that if set interval for 900000 then it should update location after 15 minutes technically. but it called 3 4 times minimum before set interval.

I could not figured out what issue causing here. I need guidance or help to complete this.

If I set interval for 15 minutes then it should update location after 15 minutes.

Thanks.

Hi @pmwisdom.

Does that plugin not work in multiple devices simultaneously?

I have testing my App in two devices when my App goes in background mode same time then it stop working.

Any idea for this behavior?

@imlogan Unfortunately max time is 10 minutes. As anything not active after 10 minutes gets killed for IOS.

I have no idea why they would stop working at the same time. I have an app with dozens of concurrent users with no issues.