Closed SalahAdDin closed 3 years ago
Testing this we have the next behavior: when the app is active(there is no smallIcon), the background task is working normally(a log with the location), but when we send the app to background, unactive, the log is not shown.
smallIcon
My service code is this:
const init = () => { BackgroundGeolocation.initialize({ notificationText: "Your app is running, tap to open.", notificationTitle: "App Running", updateInteval: 10000, requestedAccuracy: 102, smallIcon: "ic_small_icon", startImmediately: false, }) BackgroundGeolocation.addListener("onPermissions", (data: BgPermissions) => { console.log("BGLocation permissions:", data) }) BackgroundGeolocation.addListener("onLocation", (location: BgLocationEvent) => { console.log("Background geolocation: ", location) }) BackgroundGeolocation.start() } const start = () => BackgroundGeolocation.start() const stop = () => BackgroundGeolocation.stop() const goForeground = () => BackgroundGeolocation.goForeground() const getLocation = (fn: (location: BgLocationEvent) => void) => BackgroundGeolocation.addListener("onLocation", (location: BgLocationEvent) => { fn(location) }) export const geoLocationService = { init, goForeground, getLocation, start, stop }
And i'm calling it here in the App:
App
useEffect(() => { fcmService.init() geoLocationService.init() loadUserData() loadConfData() }, []);
To Reproduce Steps to reproduce the behavior:
Expected behavior We should see the logs coming even when the app in unactive.
Screenshots You can see in the following screen shot how while the app is unactive, the console is not sending logs?:
Desktop (please complete the following information):
Smartphone (please complete the following information):
@seididieci Any idea about this behavior?
Testing this we have the next behavior: when the app is active(there is no
smallIcon
), the background task is working normally(a log with the location), but when we send the app to background, unactive, the log is not shown.My service code is this:
And i'm calling it here in the
App
:To Reproduce Steps to reproduce the behavior:
Expected behavior We should see the logs coming even when the app in unactive.
Screenshots You can see in the following screen shot how while the app is unactive, the console is not sending logs?:
Desktop (please complete the following information):
Smartphone (please complete the following information):