diff --git a/index.js b/index.js index 074958b..6e578f9 100644 --- a/index.js +++ b/index.js @@ -57,7 +57,11 @@ const HeadlessTask = async (event) => { if (Platform.OS === "android") { BackgroundGeolocation.registerHeadlessTask(HeadlessTask); } else if (Platform.OS === "ios") { - BackgroundGeolocation.onLocation(async (_location) => { + BackgroundGeolocation.onLocation(async () => { + await executeHeartbeatSync(); + }); + + BackgroundGeolocation.onMotionChange(async () => { await executeHeartbeatSync(); });