React-native-background-geolocation: Accessing state and async storage.

Created on 11 Mar 2018  路  3Comments  路  Source: mauron85/react-native-background-geolocation

Hi , first of all hats off to you on making this. Everything works perfectly.

The question I have is

  1. whether the state is accessible to BackgroundGeolocation for example if I have to set a header for the post template using a value on my state can this be achieved?
  1. Can async storage be used within BackgroundGeolocation .

Thanks in advance and sorry that this is not a issue.

question

All 3 comments

  1. Yes
  2. Yes, you can do this.

according 1. yes, but any change on state value will not be reflected. It's your responsibility to call configure when state changes. You don't have to provide all configure options, only postTemplate (partial reconfiguration).

BackgroundGeolocation.configure({
  postTemplate: ['@latitude', '@longitude', state.someValue]
});;

noted and thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

canerd7u picture canerd7u  路  7Comments

theebi picture theebi  路  4Comments

Batuhan-Akkaya picture Batuhan-Akkaya  路  4Comments

ianaz picture ianaz  路  4Comments

anishroff picture anishroff  路  4Comments