FENCE 2472: Configurable motion permission prompt#482
FENCE 2472: Configurable motion permission prompt#482KennyHuRadar wants to merge 3 commits intomasterfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements configurable motion permission prompting functionality by adding a delayedMotionUsage configuration option that allows deferring motion and pressure sensor usage until explicitly requested by the user.
- Adds
delayedMotionUsageconfiguration flag to control when motion/pressure sensors are activated - Introduces state tracking for whether motion permission has been prompted
- Updates motion and pressure sensor usage to respect the delayed prompting configuration
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| RadarSDKTests/RadarSDKTests.m | Adds test configuration for the new delayedMotionUsage setting |
| RadarSDK/RadarState.h/.m | Adds state management for tracking motion permission prompts |
| RadarSDK/RadarSettings.h/.m | Exposes the delayedMotionUsage configuration setting |
| RadarSDK/RadarSdkConfiguration.h/.m | Implements the delayedMotionUsage property in the configuration object |
| RadarSDK/RadarLocationManager.m | Updates motion/pressure sensor initialization to respect delayed usage setting |
| RadarSDK/RadarAPIClient.m | Modifies tracking requests to conditionally include motion/pressure data |
| RadarSDK/Radar.m | Updates motion permission request logic to set prompted state |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| NSMutableDictionary *locationMetadata = [NSMutableDictionary new]; | ||
| if (options.useMotion) { | ||
| BOOL useMotion = options.useMotion && ([RadarState promptedForMotionUsage] || ![RadarSettings delayedMotionUsage]); |
There was a problem hiding this comment.
wouldn't this be true if requestMotionActivityPermission is never called and delayedMotionUsage is not set
| _useForegroundLocationUpdatedAtMsDiff = NO; | ||
| _useNotificationDiff = NO; | ||
| _syncAfterSetUser = NO; | ||
| _delayedMotionUsage = NO; |
There was a problem hiding this comment.
why an sdk config instead of a initialize option?
There was a problem hiding this comment.
if the sdk config request fails, could that trigger the motion prompt?
There was a problem hiding this comment.
oh because useMotion is a SDK config?
|
why were we requesting permisison at launch, what's causing it? |
QA documented in https://github.com/radarlabs/server/pull/7006