Skip to content

feat(audience-sdk): iOS SKAdNetwork registration on first launch (SDK-307)#747

Merged
nattb8 merged 1 commit intomainfrom
feat/sdk-307-ios-skan-registration
May 7, 2026
Merged

feat(audience-sdk): iOS SKAdNetwork registration on first launch (SDK-307)#747
nattb8 merged 1 commit intomainfrom
feat/sdk-307-ios-skan-registration

Conversation

@nattb8
Copy link
Copy Markdown
Collaborator

@nattb8 nattb8 commented May 7, 2026

Summary

  • Adds _AudienceRegisterSKAN() to the Obj-C++ bridge using runtime dispatch (NSClassFromString) to avoid a hard StoreKit link (which would trigger the In-App Purchase capability and block personal team builds)
  • Calls registration on first launch when config.EnableMobileAttribution = true, skipping on subsequent launches via a PlayerPrefs flag
  • Emits skanRegistered: true on game_launch only when registration fires (per-install signal — reappears after reinstall, not after Reset())
  • Sample app gets a Mobile Attribution toggle on the Setup tab to drive EnableMobileAttribution

Depends on

PR #744 (SDK-308 — iOS Info.plist post-processor). Targets that branch so the diff is clean.

Test plan

  • First launch with Mobile Attribution toggled on → game_launch contains skanRegistered: true
  • Quit and relaunch → game_launch fires, skanRegistered absent
  • SkanRegistrationTests — first launch calls bridge + persists, subsequent launch skips
  • ImmutableAudienceTests — three new cases covering provider returns true/null and disabled flag

🤖 Generated with Claude Code


Note

Medium Risk
Adds iOS native/Unity bridging and new game_launch telemetry fields gated by EnableMobileAttribution; risk centers on platform-conditional native interop and ensuring the new provider is only invoked when intended.

Overview
Adds opt-in iOS SKAdNetwork registration on first launch when AudienceConfig.EnableMobileAttribution is set, wiring a new Unity-installed MobileAttributionProvider into ImmutableAudience.Init and emitting skanRegistered: true on game_launch only when registration fires.

Introduces a runtime-dispatched Obj-C++ bridge (_AudienceRegisterSKAN) to avoid a hard StoreKit link, plus Unity-side SKANBridge/SkanRegistration (PlayerPrefs-backed “first launch” flag). Updates the sample app UI to expose a Mobile Attribution toggle and expands tests to cover provider behavior and first-launch persistence/ordering.

Reviewed by Cursor Bugbot for commit 6274d79. Bugbot is set up for automated code reviews on this repo. Configure here.

@nattb8 nattb8 requested review from a team as code owners May 7, 2026 03:11
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ba76d07. Configure here.

Comment thread src/Packages/Audience/Runtime/Unity/AudienceUnityHooks.cs
Comment thread src/Packages/Audience/Runtime/ImmutableAudience.cs Outdated
Base automatically changed from feat/sdk-308-ios-info-plist-post-processor to main May 7, 2026 03:21
…-307)

Calls SKAdNetwork.registerAppForAdNetworkAttribution() via Obj-C++ bridge
on the first app launch when config.EnableMobileAttribution is true.
Subsequent launches skip the call (PlayerPrefs flag persists per install).
Emits skanRegistered: true on the game_launch event only when registration
fires. Runtime dispatch avoids a hard StoreKit link and the In-App Purchase
capability requirement.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nattb8 nattb8 force-pushed the feat/sdk-307-ios-skan-registration branch from ba76d07 to 6274d79 Compare May 7, 2026 03:25
@nattb8 nattb8 merged commit 9f9970b into main May 7, 2026
34 of 35 checks passed
@nattb8 nattb8 deleted the feat/sdk-307-ios-skan-registration branch May 7, 2026 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants