react-native-background-geolocation icon indicating copy to clipboard operation
react-native-background-geolocation copied to clipboard

App Freez when calling BackgroundGeolocation.stop()

Open arochedy opened this issue 5 years ago • 5 comments

I start using this plugin, it works well on iphone simulator but when I used it on android I have One problem : when I call BackgroundGeolocation.stop() the app freeze.

I have the same behaviour in debug and release

  • Plugin version: 0.6.3
  • Platform: Android
  • Device manufacturer and model: Honor 10

Expected Behavior

Stop follow user location

Actual Behavior

In android : everything is worikng well but when I call BackgroundGeolocation.stop(), it freez the app.

Steps to Reproduce

My config :

BackgroundGeolocation.configure({ desiredAccuracy: BackgroundGeolocation.HIGH_ACCURACY, stationaryRadius: 50, distanceFilter: 10, notificationTitle: 'Background tracking', notificationText: 'enabled', debug: false, startOnBoot: false, stopOnTerminate: false, locationProvider: BackgroundGeolocation.ACTIVITY_PROVIDER, interval: 10000, fastestInterval: 5000, activitiesInterval: 10000, stopOnStillActivity: false, url: 'http://192.168.81.15:3000/location', httpHeaders: { 'X-FOO': 'bar' }, // customize post properties postTemplate: { lat: '@latitude', lon: '@longitude', foo: 'bar' // you can also add your own properties } });

  1. BackgroundGeolocation.start(); 2.BackgroundGeolocation.stop();

arochedy avatar May 11 '20 15:05 arochedy

@arochedy any success because i'm facing same issue

BabarMemon avatar May 13 '20 09:05 BabarMemon

same issue here

deedatbilla avatar Jun 12 '20 20:06 deedatbilla

Same issue here, sometimes it freezes only the first time, and if I rerun .start(), .stop() in same app instance it may not freeze (and may freeze), android 10 but seems to be the same behaviour on simulators

deveul avatar Jun 18 '20 11:06 deveul

Make sure you have target sdk 28 and add this <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> in your AndroidManifest.xml

Set url property to null

url: 'http://192.168.81.15:3000/location', to url: null

and remove this if not necessary for your needs

httpHeaders: {
'X-FOO': 'bar'
},

bsor-dev avatar Jun 30 '20 17:06 bsor-dev

Make sure you have target sdk 28 and add this <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> in your AndroidManifest.xml

Set url property to null

url: 'http://192.168.81.15:3000/location', to url: null

and remove this if not necessary for your needs

httpHeaders: {
'X-FOO': 'bar'
},

Thanks a ton!

dfg31197 avatar Dec 10 '20 07:12 dfg31197