Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure RNBGL startOnBoot,stopOnTerminate more robustly 2508 #3025

Merged
merged 1 commit into from
Oct 30, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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