Skip to content

MOBILE-621: Pass the app's IDFA to the iOS SDK through a setter - #240

Merged
justSmK merged 2 commits into
developfrom
feature/MOBILE-621-idfa-setter
Nov 17, 2026
Merged

justSmK merged 2 commits into
developfrom
feature/MOBILE-621-idfa-setter

Conversation

@justSmK

@justSmK justSmK commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

https://tracker.yandex.ru/MOBILE-621

After MOBILE-390 the iOS SDK no longer reads the IDFA: the app passes it through Mindbox.shared.setAdvertisingIdentifier(_:). The wrapper had no such method, so a React Native or Expo app would stop sending the IDFA once the wrapper moves to that iOS SDK.

MindboxSdk.setAdvertisingIdentifier(string | null) forwards the value on iOS and does nothing on Android. null, an empty string and zeros revoke; a string that is not a UUID is logged by the SDK and ignored. disableTrackingIds now covers iOS too: the setter passes null, and initialize clears the native state first, because the native SDK sends an identifier that was set before initialization. That clear is an optional call, so a JS bundle running over an older native binary still initializes.

Merge only after the iOS SDK release with the setter: the podspec still pins Mindbox 2.16.0, which does not have it, so the module does not compile for iOS yet. The pin bump joins this PR after that release.

Checked: jest, eslint and tsc. On a simulator (RN 0.85, new architecture) with a local ios-sdk build a UUID went to the tracking host and was accepted, a malformed string was logged and ignored, null cleared the value.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The iOS bridge depends on an unreleased setter absent from pinned Mindbox 2.16.0, so the final SDK API, dependency update, iOS build, and native IDFA revocation behavior require verification before merging.

No open issues 🎉

What changed in this PR

Adds an app-supplied IDFA setter to the React Native wrapper for the upcoming iOS SDK API. The PR remains a draft pending the iOS SDK release and dependency update.

Changes:

  • Adds setAdvertisingIdentifier(string | null) for iOS, with no action on Android.
  • Extends disableTrackingIds to suppress and clear the iOS identifier, while keeping initialization compatible with older native binaries.
  • Adds tests for forwarding, opt-out behavior, call order, and compatibility.
File Description
src/​types/​InitializationData.ts Documents iOS behavior for disableTrackingIds.
src/​index.tsx Adds the public setter and clears the identifier before initialization when tracking is disabled.
src/​__tests__/​index.test.ts Tests setter behavior and initialization compatibility.
ios/​MindboxSdk.swift Validates UUID strings and forwards identifiers or clearing requests to the SDK.
ios/​MindboxSdk.m Exposes the native setter to React Native.

Review effort: Balanced

The iOS SDK no longer reads the IDFA itself, so an app on the wrapper had
no way to hand it over. The value is a string: null, empty and zeros
revoke, a string that is not a UUID is logged by the SDK and ignored.

disableTrackingIds now covers iOS as well. The JS layer passes null
instead of the value, and initialize clears the native state first,
because the native SDK would otherwise send an identifier that was set
before initialization. That clear is an optional call, so a JS bundle
running over an older native binary still initializes.
@justSmK
justSmK merged commit 22c91f6 into develop Nov 17, 2026
@justSmK
justSmK deleted the feature/MOBILE-621-idfa-setter branch November 17, 2026 08:44
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.

4 participants