ember-step-counter-bridge-plugin
v1.0.16
Published
Expo config plugin that injects Ember's native step counter bridge for iOS and Android
Maintainers
Readme
ember-step-counter-bridge-plugin
Native step counter bridge for Ember on iOS and Android.
Native module
Use EmberStepCounterBridge on both platforms. BonkStepCounterBridge remains available as a legacy ABI alias for existing over-the-air bundles.
On Android, alarm-adjacent step activity uses the same device-protected preference store as ember-system-alarm-bridge-plugin. Existing credential-protected state migrates automatically, so walking suppression stays aligned across updates and remains available to alarms restored before the first unlock after reboot.
Starting the same persisted walk session is idempotent. Its native count remains cumulative across React remounts, process restarts, service restarts, and device reboots; callers should merge restored JavaScript progress with the native result by taking the higher value.
Android keeps the more accurate cumulative step counter authoritative when its listener registers; the detector counts only when the counter is absent or fails to register. The detector still reports activity for alarm suppression. Independent totals prevent fallback progress from contaminating a returning counter's baseline or reboot offset. Duplicate, regressing, invalid, and pre-session detector samples cannot add steps; monotonic sensor timestamps remain valid across wall-clock changes. Native counter batches can take several seconds to arrive, and device pedometers can still mistake shaking for steps. These checks do not claim to be a shake-proof gait classifier.
On iOS, the activity watermark is monotonic within a tracking generation. Delayed or regressing Core Motion samples cannot be counted as fresh movement or extend an alarm deadline.
The alarm bridge's new inactivityPolicyVersion: 2 schedules expire after 15
minutes without genuine activity; legacy schedules retain their 20-hour policy.
Only validated live native increments may refresh the new meaningful-step
watermark. A fresh stream first establishes a baseline, and accepted activity
uses the observed sample timestamp, never the time an old aggregate is queried
or replayed. The legacy recordStepActivity() suppression behavior is separate
and cannot refresh this v2 expiry. An accepted one-time snooze retains its own
deadline plus 15 minutes even after its ring is consumed. Ordinary retry and
walk-fuse timing remain unchanged.
On iOS, bonk_alarm_last_meaningful_step_at_ms is shared with the alarm bridge's
read-only getLastMeaningfulStepAtMs() method. Neither reading it nor refreshing
foreground context creates activity. Force-quit can stop native delivery;
unobserved post-termination movement cannot be promised to extend an alarm.
On Android, startStepTracking resolves only after the foreground service has entered the foreground and registered at least one step sensor. Permission failures, foreground-service failures, listener-registration failures, and a bounded startup timeout reject the call instead of reporting a tracker that never became live. The durable service state shares the alarm bridge's device-protected store, so unexpected service destruction is visible to the next step poll.
Configuration
{
"expo": {
"plugins": ["ember-step-counter-bridge-plugin"]
}
}