Background actions
Hi, I just received the starter kit and stetted up a play ground in react-native 0.61.5.
How exactly does the background mode works? I enabled the backround bluetooth in xCode and my I initialize the proximityObserver with this config:
const config = {
notification: {
title: 'Exploration mode is on',
text: 'We\'ll notify you when you\'re next to something interesting.',
channel: {
id: 'exploration-mode',
name: 'Exploration Mode',
},
},
};
I stetted up remote notification (which I know works) but when the phone is locked I do not receive these notifications. this is my proximityObserver startObserving method:
zone1.onChangeAction = async contexts => {
console.log('zone1 onChange', contexts);
if (contexts.length > 0) {
try {
const data = {
'restaurantName':'demo',
'channel': 'channel1',
};
const res = await axios.post(`${this.url}/beaconTestNotification`, data);
} catch (e) {
modalCompatibleAlert(e);
}
} else {
const data = {
'restaurantName': 'Exit Demo rest',
'channel': 'yDBu1uyduacwjC1iDaR6kDuiZfE3',
};
const res = await axios.post(`${this.url}/beaconTestNotification`, data);
}
};
this is not called when the phone is locked. should I do anything else? am I missing something? I haven't notice any other configuration in the docs.
Thanks
Okay so I figured I did not have the "always" on the location permissions on. So I got it to work on Background mode but it does not work when app is closed.
is there any more configuration I need to do in order to make this work?
By background mode, do you mean when the app is not currently open but still running in the background?
I'm also trying to detect beacons when the phone screen is off or when the app is minimized, but I can't see how can I ask for "always" location permission in iOS with this package.