feat: expose setExternalUserIds and upgrade the APS SDKs - #18
Merged
Conversation
Amazon forwards third-party identifiers (ID5, LiveRamp...) to the TAM/UAM bidders a publisher has enabled, but only if the app pushes them. There is no portal switch for this — it is an SDK API — so the app repo had no way to reach it. APSAds.setExternalUserIds(eids) takes the eid in its OpenRTB user.eids shape and passes it through untouched: atype and ext are opaque to us and belong to whoever issued the id. An empty array clears them, which is what a consent withdrawal needs. SDK upgrades, both required because the API simply does not exist in what we pinned: - Android aps-sdk 11.1.1 -> 12.0.1. AdRegistration.setExternalUserIds lands in 11.3.0 (bisected across the published AARs), so 12.0.1 is comfortably past it. - iOS AmazonPublisherServicesSDK 5.3.1 -> 5.6.4. APSExternalUserId appears between 5.6.2 and 5.6.4; 5.6.1 does not have it. Checked while bumping, so nobody has to re-check: aps-sdk ships no .so, so the 16 KB page-size requirement of Android API 36 does not apply; it pulls iabtcf-decoder 2.0.10, the version this package already pins, so no conflict; minSdk stays at 23. And Android 12.0.1 still has no equivalent of +[APS setContentUrl:], so the note in the loader stands — its version reference is updated. On iOS the new API is only non-deprecated on the APS class, so addCustomAttribute moves there too. The other five DTBAds calls stay where they are, deliberately: Amazon deprecates them in favour of +[APS setTestMode:], +[APS setUseGeoLocation:], +[APS setMraidPolicy:] and +[APS setMraidSupportedVersions:], but none of those are declared in APS.h. The selectors do exist in the binary — Amazon shipped the code and never exposed it — so Swift cannot see them and declaring them ourselves would bind us to an undeclared API. removeCustomAttribute has no APS counterpart at all. Adds 6 tests. 42 green. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
They are not missing from the SDK, they moved: APS 5.6.4 carries testMode, useGeolocation, mraidPolicy and mraidSupportedVersions on APSInitConfig, handed once to +[APS initializeWithAppKey:config:completion:]. Adopting that reshapes this bridge's contract, so it belongs in its own change. The deprecation text is misleading and the comment now says so: it points at +[APS setTestMode:] and friends, which APS.h never declares. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The CI runs lint:code, which chains lint:js:check, lint:android:check and lint:ios:check. I had only run the JS one locally, so a single over-long javadoc line in RNAPSAdsModule slipped through and failed the Lint job. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Swift imports the +builder class factory as an initializer, so APSExternalUserIdBuilder.builder() does not exist on the Swift side and the module failed to compile against AmazonPublisherServicesSDK 5.6.4. Caught by compiling the pod for the simulator; the CI only runs jest and the linters, neither of which touches the native sources. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Amazon forwards third-party identifiers (ID5, LiveRamp...) to the TAM/UAM bidders a publisher
has enabled, but only if the app pushes them. There is no portal switch for this — it is an SDK
API — so until now the app repo had no way to reach it.
What it adds
The eid is taken in its OpenRTB
user.eidsshape and passed through untouched:atypeandextare opaque to us and belong to whoever issued the id. An empty array clears them, which iswhat a consent withdrawal needs.
SDK upgrades — both required, the API does not exist in what we pinned
aps-sdkAmazonPublisherServicesSDKChecked while bumping, so nobody has to re-check:
aps-sdkships no.so, so the 16 KB page-size requirement of Android API 36 does not apply.iabtcf-decoder 2.0.10, the version this package already pins — no conflict.minSdkrises from 23 to 24: the AAR manifests declareminSdkVersion="23"for 11.1.1 andminSdkVersion="24"for 12.0.1. No practical impact here (this package already defaults to 24 viasafeExtGet('minSdkVersion', 24), and footmercatomobile2 sets 24), but the earlier claim that itstayed at 23 was wrong.
+[APS setContentUrl:], so the note in the loaderstands. Only its version reference is updated.
Why only one of the deprecated iOS calls moved
On iOS the new API is non-deprecated only on the
APSclass, soaddCustomAttributemoves theretoo. The other five
DTBAdscalls stay where they are, deliberately.Amazon deprecates them in favour of
+[APS setTestMode:],+[APS setUseGeoLocation:],+[APS setMraidPolicy:]and+[APS setMraidSupportedVersions:]— none of which are declared inAPS.h. The selectors do exist in the binary (verified withstringsonDTBiOSSDK): Amazonshipped the code and never exposed it. Swift therefore cannot see them, and declaring them
ourselves would bind this package to an undeclared API that could vanish in any release.
removeCustomAttributehas noAPScounterpart at all, deprecated or otherwise.A comment in
RNAPSAdsModule.swiftrecords this so the next person does not lose an hour on it.Worth re-checking when Amazon publishes the headers.
Checks
yarn test:jest— 42 tests green (6 new)yarn tsc:compileyarn lint:js:checkNote
Version bumped to 2.4.0.
masterwas already at 2.3.0 but unpublished — npm latest is still2.2.1, so publishing this ships the
contentUrlwork from #16 at the same time.#17 (instream video) is open against
masterin parallel and does not overlap with this branch.