Skip to content

feat: add async tracking permission API#21

Open
2sem wants to merge 1 commit into
mainfrom
feat/async-request-permission
Open

feat: add async tracking permission API#21
2sem wants to merge 1 commit into
mainfrom
feat/async-request-permission

Conversation

@2sem

@2sem 2sem commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Goal

Provide an async App Tracking Transparency permission API while preserving the existing callback API.

Changes

  • Add requestPermissionAsync(...) async -> ATTrackingManager.AuthorizationStatus
  • Bridge the callback result with withCheckedContinuation
  • Ensure the .restricted path invokes completion so the continuation cannot hang
  • Document callback and async usage

User flow

flowchart LR
    Caller[Async caller] --> Async[requestPermissionAsync]
    Async --> Callback[Existing requestPermission callback API]
    Callback --> ATT[ATT authorization result]
    ATT --> Resume[Resume checked continuation once]
    Resume --> Caller
Loading

Success criteria

  • Existing callback callers remain source-compatible
  • Async callers receive the ATT authorization status
  • Every authorization path resumes the continuation exactly once
  • Scope remains limited to one method family

Verification

  • xcodebuild build -workspace .swiftpm/xcode/package.xcworkspace -scheme GADManager -destination generic/platform=iOS Simulator CODE_SIGNING_ALLOWED=NO passed
  • 0 build errors and 0 warnings through xcsift
  • Independent code review approved with no findings

Risks and rollback

  • A distinct requestPermissionAsync name avoids changing overload resolution for existing no-callback calls in async contexts.
  • Rollback is a direct revert of this PR; the callback API remains intact.

@github-actions

Copy link
Copy Markdown

🤖 Hi @2sem, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

@github-actions

Copy link
Copy Markdown

🤖 I'm sorry @2sem, but I was unable to process your request. Please see the logs for more details.

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.

1 participant