-
Notifications
You must be signed in to change notification settings - Fork 31
FENCE 2472: Configurable motion permission prompt #482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
FENCE 2472: Configurable motion permission prompt #482
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why an sdk config instead of a initialize option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the sdk config request fails, could that trigger the motion prompt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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