Skip to content

fix(ios): change every privacy service for settings permission all - #4667

Merged
thymikee merged 2 commits into
callstack:mainfrom
imranbarbhuiya:fix/ios-privacy-grant-all
Nov 18, 2026
Merged

thymikee merged 2 commits into
callstack:mainfrom
imranbarbhuiya:fix/ios-privacy-grant-all

Conversation

@imranbarbhuiya

@imranbarbhuiya imranbarbhuiya commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

On an iOS 27.2 simulator, settings permission grant all and deny all change nothing the app sees. simctl privacy grant all writes one kTCCServiceAll row that iOS ignores, so the app still prompts. revoke all leaves the per-service rows in place.

Grant and deny of all now change each service in turn:

  • The list comes from a table keyed by every permission target, so a new target is a compile error until it is placed. It covers full contacts and photos, and location-always.
  • deny all also revokes photos-add.
  • A refused service is skipped with a Skipped <service> warning.
  • Any other failure stops with the services already changed in details.permissions.
  • reset all stays one call.

iOS 27's refusal wording ("Failed to create TCC authorization record") is now classified as a refusal, so grant notifications is UNSUPPORTED_OPERATION again.

5 files changed. Follow-up: #4668 (notifications).

Validation

pnpm check:affected --run --head 92eff8d6 passed (exactCommit: true), run with GIT_CONFIG_GLOBAL=/dev/null, because my global status.branch=true breaks committed-source-tree.test.ts.

Live on an iPhone 17 Pro simulator, iOS 27.2, at 92eff8d6:

Base 4fcbc671 Head
After grant all kTCCServiceAll=2 only; the app shows the microphone alert =2 for each service; "Microphone enabled"
Microphone after deny all stays 2 0
TCC and locationd dumps
## 1. grant all
  kTCCServiceAddressBook|2  kTCCServiceCalendar|2  kTCCServiceCamera|2
  kTCCServiceMediaLibrary|2 kTCCServiceMicrophone|2 kTCCServiceMotion|2
  kTCCServicePhotos|2       kTCCServiceReminders|2  kTCCServiceSiri|2
locationd Authorization: 4 (always)

## 2. grant photos limited, then deny all
  kTCCServiceAddressBook|0  kTCCServiceCalendar|0  kTCCServiceCamera|0
  kTCCServiceMediaLibrary|0 kTCCServiceMicrophone|0 kTCCServiceMotion|0
  kTCCServicePhotos|0       kTCCServicePhotosAdd|0  kTCCServiceReminders|0
  kTCCServiceSiri|0
locationd Authorization: 1 (denied)

## 3. grant all, then reset all
  (no rows)
locationd Authorization: absent

## 4. open the app after reset all
@e1 [alert] "Allow “e2e Benchmark” to access your microphone?"

## 5. grant all, open the app
@e5 [text] "Microphone enabled"

## grant location (while in use), then deny all
locationd Authorization: 2 -> 1

Not covered: older runtimes, Limrun.

The iOS 27 simulator records simctl privacy grant all as one kTCCServiceAll
row that it never consults, so an app still prompts after grant all, and
deny all leaves every per-service grant in place. Grant and deny of all now
change each service in turn and report what changed, skipping a service the
runtime refuses with a warning; reset all stays one call. iOS 27 words that
refusal 'Failed to create TCC authorization record', which is now read as
one, so a named notifications change is UNSUPPORTED_OPERATION again.
@thymikee

Copy link
Copy Markdown
Member

Thanks for the fix. At 06a6ac4 the code reads correctly, but one gap needs a live run before merge: reset all and deny all are not shown live yet.

This change rewrites the simctl calls behind grant, deny and reset of all, and the docs now say reset all clears every service. The live table covers grant (TCC rows) and deny for microphone only, plus grant notifications. It does not show reset all removing the per-service rows that the new grant path writes. The PR's own premise is that all rows and per-service rows are independent for revoke. If iOS 27.2 reset all only clears the kTCCServiceAll row, grant all then reset all keeps every grant and the app never prompts again. The table also does not show the other services that deny all changes (photos, photos-add, location-always, contacts), so one missed service would leave access the agent thinks is revoked. Could you do one run on a booted iOS 27.2 simulator with this head? Run settings permission grant all and dump the TCC rows for the bundle (every service allowed). Run settings permission deny all and dump again (every service, including photos-add and location-always, denied or absent). Run grant all again, then settings permission reset all, and dump again (no rows for the bundle). Then open the app and confirm the microphone prompt comes back. Please paste the three dumps in the PR body.

Not blocking, and you can take or leave these: IOS_ALL_REVOKED_PRIVACY_SERVICES revokes location-always but not location, so please check in the same dump whether grant location then deny all leaves a when-in-use grant, and add location or extend the comment accordingly (https://github.com/callstack/agent-device/blob/06a6ac4/packages/platform-apple/src/core/simctl-settings.ts#L89); IOS_ALL_PRIVACY_SERVICES re-spells ten names from IOS_PRIVACY_SERVICES, so a new permission target would be skipped by iOS all without a compile error, and keying it to the table would fix that (https://github.com/callstack/agent-device/blob/06a6ac4/packages/platform-apple/src/core/simctl-settings.ts#L73); the revoke list relies on "notifications is last" and a slice, and spelling it as the base list plus photos-add removes that ordering rule; a non-refusal failure partway through the batch leaves earlier services changed with no record, so attaching applied to the error details or noting it in the help would help (https://github.com/callstack/agent-device/blob/06a6ac4/packages/platform-apple/src/core/simctl-settings.ts#L118); and the docs sentence could add that deny all also revokes photos-add and that each skipped service adds a Skipped <service> entry to warnings (https://github.com/callstack/agent-device/blob/06a6ac4/website/docs/docs/commands.md#L853).

The kTCCServiceAll behavior, the iOS 27 stderr wording and the per-service rows come from your observations, and they match the code. Limrun and older runtimes use the same path and are not covered, as the PR states. Fork CI has not run on this head yet, so a maintainer needs to approve the run. Before merge, the live TCC dumps for grant all, deny all and reset all on iOS 27.2 need to be in the PR.

…failure left changed

The services iOS all changes now derive from a table keyed by every
permission target, so a new target is a compile error until it is placed,
and the revoke list is that list plus photos-add with no ordering rule. A
failure that is not a refusal stops the batch with the services already
changed in its details.permissions. Revoking location-always also takes back
while-in-use access on iOS 27.2, so location stays out of the list.
@imranbarbhuiya

Copy link
Copy Markdown
Contributor Author

Thanks! The live run is done at 92eff8d on an iOS 27.2 simulator, and the dumps are in the PR body under "TCC and locationd dumps".

  • grant all: every service is =2, and location is "always" (4).
  • grant photos limited, then deny all: every service is 0, including kTCCServicePhotosAdd, and location is denied (1).
  • grant all, then reset all: no rows are left for the bundle, and location is absent. Opening the app brings the microphone prompt back. After another grant all, it goes straight to "Microphone enabled".

The non-blocking points, all in 92eff8d:

  • location: grant location (while in use, 2) followed by deny all gives 1. Revoking location-always takes back while-in-use access too, so location stays out of the list, and the comment says why.
  • Keyed to every target: the services now come from IOS_ALL_TARGETS, keyed by every MobilePermissionTarget except all via satisfies Record<…, boolean>. A new target fails to compile until it's placed, and the service names come from IOS_PRIVACY_SERVICES.
  • Ordering: the revoke list is the grant list plus photos-add, with no slice and no ordering rule. The tests refuse notifications wherever it falls.
  • Partial failure: a failure that isn't a refusal now stops with the services already changed in details.permissions. It's the same error object, so callers that match on it still do, and a test covers it.
  • Docs: commands.md now says deny all also revokes photos-add, that each refused service adds a Skipped <service> warning, and the partial-failure detail.

check:affected --run --head 92eff8d6 passed (exactCommit: true).

@thymikee

Copy link
Copy Markdown
Member

Thanks for the runs. The evidence gap from 06a6ac4 is closed at 92eff8d: the TCC and locationd dumps for grant all, deny all and reset all, plus the returning microphone prompt, cover what was missing. I found no code problems at this head. Older iOS runtimes and Limrun are not covered, as the PR states. No checks have reported on this fork head yet, because a maintainer needs to approve the CI run. After that run is green, nothing else blocks merge.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 18, 2026
@thymikee
thymikee merged commit ca7f886 into callstack:main Nov 18, 2026
12 checks passed
@imranbarbhuiya
imranbarbhuiya deleted the fix/ios-privacy-grant-all branch November 18, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants