Context
CMMotionActivity can report multiple boolean flags as true simultaneously, with a single confidence value for the overall detection. The plugin currently surfaces a single activity.type and activity.confidence, which works well for the common case where only one flag is active.
However, when multiple flags are active, useful context is lost. Since CoreMotion provides one confidence for the entire detection (not per-flag), the consumer has no way to know that additional flags were present.
Example
Car stopped at a red light. CoreMotion reports:
automotive = true
stationary = true
confidence = .high
The consumer receives a single type (whichever the SDK resolves to), but both flags together more accurately describe the situation: stationary inside a vehicle. A consumer watching for still to trigger stationary behavior would miss it entirely, even though CoreMotion detected it.
Other real-world cases
- Car stopped at a red light:
automotive=true, stationary=true — cannot distinguish parked from moving
- Walking to a parked car:
walking=true, automotive=true — context lost
- Slowing down on a bike:
cycling=true, stationary=true — context lost
Suggestion
Expose all active flags alongside the existing resolved type. The current type and confidence fields stay as-is for backward compatibility. An additional activities array would carry the full picture:
Multiple flags active:
{
"type": "in_vehicle",
"confidence": 100,
"activities": ["in_vehicle", "still"]
}
Single flag active (no change):
{
"type": "walking",
"confidence": 100,
"activities": ["walking"]
}
Context
CMMotionActivitycan report multiple boolean flags astruesimultaneously, with a singleconfidencevalue for the overall detection. The plugin currently surfaces a singleactivity.typeandactivity.confidence, which works well for the common case where only one flag is active.However, when multiple flags are active, useful context is lost. Since CoreMotion provides one confidence for the entire detection (not per-flag), the consumer has no way to know that additional flags were present.
Example
Car stopped at a red light. CoreMotion reports:
The consumer receives a single type (whichever the SDK resolves to), but both flags together more accurately describe the situation: stationary inside a vehicle. A consumer watching for
stillto trigger stationary behavior would miss it entirely, even though CoreMotion detected it.Other real-world cases
automotive=true,stationary=true— cannot distinguish parked from movingwalking=true,automotive=true— context lostcycling=true,stationary=true— context lostSuggestion
Expose all active flags alongside the existing resolved type. The current
typeandconfidencefields stay as-is for backward compatibility. An additionalactivitiesarray would carry the full picture:Multiple flags active:
{ "type": "in_vehicle", "confidence": 100, "activities": ["in_vehicle", "still"] }Single flag active (no change):
{ "type": "walking", "confidence": 100, "activities": ["walking"] }