React-native-background-geolocation: Question: Is HTTP posting disabled on the free version?

Created on 19 Mar 2017  ยท  10Comments  ยท  Source: transistorsoft/react-native-background-geolocation

My Environment

  • Plugin version: latest
  • Platform: Android
  • OS version: 6.0.1
  • Device manufacturer / model: BQ Aquaris X5 Plus
  • React Native version (react-native -v): 0.42.0
  • Plugin config
config = {
      url: 'http://myserver-ip/info',
      method: 'POST',
      startOnBoot: true,
      stopOnTerminate: false,
      debug: true,
      stopTimeout: 1,
      activityRecognitionInterval: 5000,
      deferTime: 60000,
      disableElasticity: false,
      desiredAccuracy: 0,
      distanceFilter: 20,
      stationaryRadius: 25,
      locationUpdateInterval: 60000,
      fastestLocationUpdateInterval: 1000
 };

Expected Behavior

The server should receive a POST request with information about location.

Actual Behavior

The server receives a POST request without any information (empty body and no query params).

Steps to Reproduce

The provided demo app should be fine to test it doesn't work.

Context

Send location information to server, either on foreground or background.

Debug logs

03-19 17:15:44.925  6208 21383 W ctxmgr  : [AclManager]No 2 for (accnt=account#-1666355788#, com.google.android.gms(10014):UserLocationProducer, vrsn=10298000, 0, 3pPkg = null ,  3pMdlId = null). Was: 2 for 1, account#-1666355788#
03-19 17:15:44.945  7331 22942 D TSLocationManager: [c.t.l.LocationService onLocation]
03-19 17:15:44.945  7331 22942 D TSLocationManager: โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
03-19 17:15:44.945  7331 22942 D TSLocationManager: โ•‘ LocationService: watchPosition
03-19 17:15:44.945  7331 22942 D TSLocationManager: โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
03-19 17:15:44.945  7331 22942 D TSLocationManager: โ•Ÿโ”€ ๐Ÿ“  Location[fused 41,227510,1,790370 acc=1 et=+16h3m24s257ms alt=65.0]
03-19 17:15:44.948  6208 21383 W ctxmgr  : [AclManager]No 2 for (accnt=account#553699469#, com.google.android.gms(10014):UserLocationProducer, vrsn=10298000, 0, 3pPkg = null ,  3pMdlId = null). Was: 2 for 1, account#553699469#
03-19 17:15:44.966  7331 22942 D TSLocationManager: [c.t.l.l.TSLocationManager calculateMedianAccuracy] 1.0
03-19 17:15:44.993  3134  5192 D audio_hw_primary: out_set_parameters: enter: usecase(1: low-latency-playback) kvpairs: routing=2
03-19 17:15:44.993  3134  5192 E audio_hw_primary: voice_extn_compress_voip_is_active: COMPRESS_VOIP_ENABLED is not defined
03-19 17:15:44.993  3134  5192 E msm8916_platform: voice_extn_compress_voip_is_active: COMPRESS_VOIP_ENABLED is not defined
03-19 17:15:44.994  3134  5192 D audio_hw_extn: audio_extn_set_anc_parameters: anc_enabled:0
03-19 17:15:44.994  3134  5192 V audio_hw_primary: out_set_parameters: exit: code(0)
03-19 17:15:44.996  7331 22729 I TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO persist]
03-19 17:15:44.996  7331 22729 I TSLocationManager:   โœ…  INSERT: 20a7fe37-dccc-4928-bd38-862b3f55832a
03-19 17:15:45.015  7331 22729 D TSLocationManager: [c.t.l.http.HttpService flush]
03-19 17:15:45.015  7331 22729 D TSLocationManager: โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
03-19 17:15:45.015  7331 22729 D TSLocationManager: โ•‘ HTTP Service
03-19 17:15:45.015  7331 22729 D TSLocationManager: โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
03-19 17:15:45.039  7331 22729 D TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO first]
03-19 17:15:45.039  7331 22729 D TSLocationManager:   โœ…  Locked 1 records
03-19 17:15:45.051  7331 22729 I TSLocationManager: [c.t.l.http.HttpService createRequest]
03-19 17:15:45.051  7331 22729 I TSLocationManager:   ๐Ÿ”ต  POST: 20a7fe37-dccc-4928-bd38-862b3f55832a
03-19 17:15:45.090  3134  5192 V audio_hw_primary: out_get_latency: Latency 8
03-19 17:15:45.110  3134  5192 V audio_hw_primary: out_get_latency: Latency 8
03-19 17:15:45.177 22191 22191 I ServiceManager: Waiting for service AtCmdFwd...
03-19 17:15:45.212  7331  7354 I TSLocationManager: [c.t.l.http.HttpRequest parseNetworkResponse]
03-19 17:15:45.212  7331  7354 I TSLocationManager:   ๐Ÿ”ต  Response: 200
03-19 17:15:45.240  7331  7331 D TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO destroy]
03-19 17:15:45.240  7331  7331 D TSLocationManager:   โœ…  DESTROY: 20a7fe37-dccc-4928-bd38-862b3f55832a
NO Node JS question

All 10 comments

No. Look at the logs: that's your server which said 200:

03-19 17:15:45.212  7331  7354 I TSLocationManager:   ๐Ÿ”ต  Response: 200

You're using php, I assume?

Wow, thanks for your fast response. I might not explained myself properly sorry. The server receives a POST call to the /info endpoint but request body is always empty. I'm using NodeJS.

Where in the request are you looking for the data?

With Express, the data is in request.body.

Damn, I just found what's happening. I'm leaving the "solution" here for future people having the same problem.

What was happening is that in new Express versions you have to install body-parser separately or you will not have the req.body property populated.

Thanks for your fast responses @christocracy. I think it's fine to close it now ๐Ÿ˜Š

Just as I do in my Background Geolocation Console

Btw, Android is not strictly a "Free Version". Without purchasing a license, it boots in "Evaluation Mode" only in DEBUG builds. It will not work in RELEASE builds without purchasing a license.

Yep. Sounds good. Nice work ๐Ÿ‘

Fast, dedicated support is why you pay.

I will definitely pay as soon as my app is ready to go live ๐Ÿ˜Š

Was this page helpful?
0 / 5 - 0 ratings