Skip to content

Conversation

@KennyHuRadar
Copy link
Contributor

@KennyHuRadar KennyHuRadar commented Sep 23, 2025

@KennyHuRadar KennyHuRadar changed the title Kennyhu/fence 2472 configurable motion permission prompt FENCE 2472: Configurable motion permission prompt Sep 23, 2025
@KennyHuRadar KennyHuRadar marked this pull request as ready for review September 23, 2025 17:07
Copilot AI review requested due to automatic review settings September 23, 2025 17:07
Copy link
Contributor

Copilot AI left a 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 delayedMotionUsage configuration 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]);
Copy link
Contributor

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;
Copy link
Contributor

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?

Copy link
Contributor

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?

Copy link
Contributor

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?

@ShiCheng-Lu
Copy link
Contributor

why were we requesting permisison at launch, what's causing it? requestMotionActivityPermission is not called at app initiliaze

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants