Skip to content

Commit

Permalink
Merge pull request #3025 from hippware/2508-rnbgl-config-interim-work…
Browse files Browse the repository at this point in the history
…around

Configure RNBGL startOnBoot,stopOnTerminate more robustly 2508
  • Loading branch information
aksonov authored Oct 30, 2018
2 parents ae12dbf + 72b978d commit 0c1ba5a
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/store/LocationStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,15 +268,26 @@ const LocationStore = types
debug: false,
// logLevel: backgroundGeolocation.LOG_LEVEL_VERBOSE,
logLevel: backgroundGeolocation.LOG_LEVEL_ERROR,
stopOnTerminate: false,
startOnBoot: true,
// stopOnTerminate: false,
// startOnBoot: true,
url,
autoSync: true,
params,
headers,
})
// apply this change every load to prevent stale auth headers
yield backgroundGeolocation.setConfig({headers, params, url})

// .ready() doesn't always apply configuration.
// Here are some things that we have to configure everytime.
// Note: If any user-configurable/debug settings appear here,
// they will be overwritten
yield backgroundGeolocation.setConfig({
startOnBoot: true,
stopOnTerminate: false,
headers,
params,
url,
})

logger.log(prefix, 'is configured and ready: ', state)
self.updateBackgroundConfigSuccess(state)

Expand Down

0 comments on commit 0c1ba5a

Please sign in to comment.