Conversation
be395ca to
6d30455
Compare
…rk (SDK-308) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6d30455 to
a56fea7
Compare
4 tasks
ImmutableJeffrey
approved these changes
May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[PostProcessBuild]that injectsNSUserTrackingUsageDescriptionandSKAdNetworkItemsinto the generated Xcode project'sInfo.plist.AudienceMobileBuildSettingsScriptableObject (created viaAssets → Create → Immutable Audience → Mobile Build Settings). The runtimeAudienceConfigobject cannot be read at build time, so build-only values need an asset-backed source.AUDIENCE_MOBILE_ATTRIBUTIONscripting define on the iOS player target — without the define,Info.plistis left untouched (Apple flags apps that include either key without the corresponding code paths).Tools → Immutable → Audience → Validate iOS Build Settingspreviews what would be injected without running a full build.Behaviour notes baked in: callbackOrder
9050(above Unity's defaults; ad-network SDKs with higher orders can extend ourSKAdNetworkItems); merging with any pre-existingSKAdNetworkItemsarray; case-insensitive dedupe per Apple's spec; defaultNSUserTrackingUsageDescriptionfallback so a build never ships with the key missing.Why these two keys?
iOS attribution on post-ATT devices (iOS 14.5+) works through two complementary mechanisms, and both require
Info.plistentries before the binary is signed.NSUserTrackingUsageDescriptionis the text Apple shows in the system App Tracking Transparency dialog. It is required whenever the app callsATTrackingManager.requestTrackingAuthorization. If the key is absent when that call is made, iOS crashes the app. When the user grants permission, ad networks gain access to the IDFA (Identifier for Advertisers), which enables full cross-app attribution.SKAdNetworkItemscovers the case where the user denies ATT, or where IDFA is otherwise unavailable. Apple's SKAdNetwork framework can report a conversion (ad click → game install) back to an ad network without identifying the individual user. For a network's conversions to be credited, its registered identifier must appear in this list. Any network missing from the list cannot attribute installs from their campaigns at all.Together, the two keys mean the Audience SDK can measure player acquisition accurately regardless of whether a given user has granted tracking consent. The post-processor automates what would otherwise be a manual
Info.plistedit each time a studio adds or changes ad network partners.Test plan
UnityEditor.iOS.Xcode.PlistDocument(cover: defaults, custom copy, overwrite, merge, dedupe, null/whitespace skip, no-asset path).Info.plistcontains the configuredSKAdNetworkIdentifierand the customNSUserTrackingUsageDescriptionfrom the settings asset.🤖 Generated with Claude Code
Note
Medium Risk
Touches iOS build post-processing and
Info.plistgeneration, which can cause App Store submission/runtime issues if misconfigured, though it is gated behind a scripting define and covered by unit tests.Overview
Adds an iOS
[PostProcessBuild]step (iOSInfoPlistPostProcessor) that, whenAUDIENCE_MOBILE_ATTRIBUTIONis enabled, writesNSUserTrackingUsageDescriptionand merges/dedupesSKAdNetworkItemsinto the generated XcodeInfo.plist.Introduces an editor-only
AudienceMobileBuildSettingsScriptableObject (with menu item creation + asset discovery) to supply ATT prompt copy and SKAdNetwork IDs at build time, plus a validation menu command to preview what will be injected.Adds an editor test assembly and unit tests for the plist mutation helpers; exposes editor internals to tests via
InternalsVisibleTo.Reviewed by Cursor Bugbot for commit a56fea7. Bugbot is set up for automated code reviews on this repo. Configure here.