You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Device manufacturer / model: Phone 1: Nokia Model TA1323, Phone 2: Zebra
React Native version: 0.75.3
Expo SDK Version: 51.0.39
Plugin config (see code block below)
functionRootLayout(){
...
consthandleStartSession=()=>{if(!isAlwaysEnabled){BackgroundGeolocation.stop();returnBackgroundGeolocation.requestPermission();}BackgroundGeolocation.start();constcheckInLocation=awaitBackgroundGeolocation.getCurrentPosition({samples: 1,});executedEvent({locationData: checkInLocation,
...,});}consthandleEndSession=()=>{BackgroundGeolocation.removeListeners();BackgroundGeolocation.stop().then(()=>{console.log("BackgroundGeolocation stopped successfully");}).catch(error=>{console.warn("Failed to stop BackgroundGeolocation: ",error);});}useEffect(()=>{constonLocation=BackgroundGeolocation.onLocation(location=>{console.log("[root - onLocation - trigger - event] - 📍",{activity: location.event,isMoving: location.is_moving,});if(location.is_moving){console.log("[root - onLocation - onLocation] Device has just started MOVING 🏃",JSON.stringify(location,null,2),);executedEvent({locationData: location,
....,});}});constonHeartbeat=BackgroundGeolocation.onHeartbeat(async()=>{console.log("[root - onHeartbeat - trigger - event] - ✅");constlocation=awaitBackgroundGeolocation.getCurrentPosition({samples: 1,persist: true,});executedEvent({locationData: location,
...,});});constonMotionChange=BackgroundGeolocation.onMotionChange(event=>{if(event.isMoving){console.log("[root - onMotionChange] Device has just started MOVING 🏃",JSON.stringify(event.location,null,2),);}else{console.log("[root - onMotionChange] Device is STATIONARY: 🚷 ");}});BackgroundGeolocation.logger.getLog().then(logs=>{console.log("BackgroundGeolocation logs: ",logs);});BackgroundGeolocation.ready({activityType: BackgroundGeolocation.ACTIVITY_TYPE_OTHER,desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,distanceFilter: 4,// minimum distance between location updates in meterselasticityMultiplier: 10,debug: Platform.OS==="android",// enable this to hear sounds for background-geolocation life-cycle.stopOnTerminate: false,// Allow the background-service to continue tracking when user closes the app.startOnBoot: true,// Auto start tracking when device is powered-up.heartbeatInterval: 15,// How often to send a heartbeat to the server in seconds.preventSuspend: true,// Prevent the app from being suspended while in the backgroundallowIdenticalLocations: true,stopTimeout: 1,stationaryRadius: 25,pausesLocationUpdatesAutomatically: undefined,showsBackgroundLocationIndicator: true,backgroundPermissionRationale: {title: "Allow background location updates",message: "Required for continuous location tracking",positiveAction: "Accept",negativeAction: "Cancel",},locationAuthorizationRequest: "Always",}).then(state=>{console.log("- BackgroundGeolocation is configured and ready: ",state.enabled,);}).catch(error=>{console.error("BackgroundGeolocation error: ",error);});return()=>{onMotionChange.remove();onLocation.remove();onHeartbeat.remove();};},[]);
...
return(
....// handleStartSession and handleEndSession <Buttons />)}
Expected Behavior
Method Context: executedEvent is an internal SDK we use to send location updates to our backend.
The URL prop for .ready() will NOT work for our use case.
Device is STATIONARY 🚷 expected Android & iOS behavior: When the app is moved to the background, I expect each new event to play a HEARTBEAT notification sound and log that event via my executedEvent({....})
Device is MOVING 🏃 expected Android & iOS behavior: When the app is moved to the background, I expect each new event to play a LOCATION_RECORDED notification sound and log that event via my executedEvent({....})
Actual Behavior
Method Context: executedEvent is an internal SDK we use to send location updates to our backend.
The URL prop for .ready() will NOT work for our use case.
Device is STATIONARY 🚷 expected iOS behavior: Archived ✅
Device is MOVING 🏃 expected iOS behavior: Archived ✅
Device is STATIONARY 🚷 expected Android behavior: Failed 🚫
A HEARTBEAT notification sound is heard but events are not being logged via executedEvent({....})
Device is MOVING 🏃 expected Android behavior: Failed 🚫
A LOCATION_RECORDED notification sound is heard but events are not being logged via executedEvent({....})
Steps to Reproduce
Use code in code block above to test behavior on physical device
Replace executedEvent with logs
Context
Mainly trying to get events to log on both iOS and Android when in STATIONARY or Moving modes
The text was updated successfully, but these errors were encountered:
JaredHightower-Tendrel
changed the title
[Physical Device] - onHeartbeat event listener works on iOS but not Android
[Physical Device] - onHeartbeat and onLocation event listeners works on iOS but not Android
Jan 8, 2025
JaredHightower-Tendrel
changed the title
[Physical Device] - onHeartbeat and onLocation event listeners works on iOS but not Android
[Physical Device][BUG] - onHeartbeat and onLocation event listeners works on iOS but not Android
Jan 8, 2025
JaredHightower-Tendrel
changed the title
[Physical Device][BUG] - onHeartbeat and onLocation event listeners works on iOS but not Android
[BUG][Physical Device] - onHeartbeat and onLocation event listeners works on iOS but not Android
Jan 8, 2025
Your Environment
Purchased a license on 1/7/2025
^4.18.3
Android
Phone 1: Version 11
,Phone 2: unknown
Phone 1: Nokia Model TA1323
,Phone 2: Zebra
0.75.3
51.0.39
(see code block below)
Expected Behavior
Android & iOS
behavior: When the app is moved to the background, I expect each new event to play a HEARTBEAT notification sound and log that event via myexecutedEvent({....})
Android & iOS
behavior: When the app is moved to the background, I expect each new event to play a LOCATION_RECORDED notification sound and log that event via myexecutedEvent({....})
Actual Behavior
iOS
behavior: Archived ✅iOS
behavior: Archived ✅Android
behavior: Failed 🚫executedEvent({....})
Android
behavior: Failed 🚫executedEvent({....})
Steps to Reproduce
executedEvent
with logsContext
Mainly trying to get events to log on both iOS and Android when in STATIONARY or Moving modes
Debug logs
Logs
The text was updated successfully, but these errors were encountered: