Skip to content

eventDidReachThreshold not triggering #79

@notJamesHan

Description

@notJamesHan

This is my device activity and for some reason, in the event i see intervalDidStart, intervalDidEnd being triggered, but unblockThreshold is not working at all.

Using Expo 53.0.9, development build

await DeviceActivity.startMonitoring(
    unlockActivityName,
    {
      intervalStart: {
        hour: now.getHours(),
        minute: now.getMinutes(),
        second: now.getSeconds(),
      },
      intervalEnd: {
        hour: scheduleEnd.getHours(),
        minute: scheduleEnd.getMinutes(),
        second: scheduleEnd.getSeconds(),
      },
      repeats: false,
    },
    [
      {
        eventName: "unblockThreshold",
        familyActivitySelection: schedule.familyActivitySelection,
        threshold: { minute: unlockMinutes },
      },
    ]
  );

... 

 // Re-block after 1 minute and stop the temporary monitor
  DeviceActivity.configureActions({
    activityName: unlockActivityName,
    callbackName: "eventDidReachThreshold",
    eventName: "unblockThreshold",
    actions: [
      {
        type: "blockSelection",
        familyActivitySelectionId: schedule.selectionId,
      },
      {
        type: "stopMonitoring",
        activityNames: [unlockActivityName],
      },
    ],
  });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions