Skip to content

[SDK-1001] Add consent debug settings support - #7

Draft
Khrolovich wants to merge 9 commits into
release/2.2.0from
feature/SDK-1001-consent-debug-settings
Draft

[SDK-1001] Add consent debug settings support#7
Khrolovich wants to merge 9 commits into
release/2.2.0from
feature/SDK-1001-consent-debug-settings

Conversation

@Khrolovich

@Khrolovich Khrolovich commented Sep 10, 2026

Copy link
Copy Markdown

Adds ConsentManager.Instance.SetDebugSettings(ConsentDebugSettings) so a publisher can force the consent geography on a registered test device, mirroring the native ConsentDebugSettings API added in Appodeal Android SDK 4.4.0 (AppodealSDK#3335) and StackConsentManager-iOS 4.2.0 (StackConsentManager-iOS#49).

Jira: SDK-1001

API

ConsentManager.Instance.SetDebugSettings(new ConsentDebugSettings
{
    Geography = ConsentDebugGeography.Eea,           // Eea | RegulatedUsState | Other
    TestDeviceIds = new List<string> { "<id from the native log>" }
});
ConsentManager.Instance.RequestConsentInfoUpdate(parameters);

SetDebugSettings(null) clears the override. The gate (debuggable build + emulator/simulator or registered device id) and the log hints live in the native SDKs; the plugin only marshals the values.

Platform mapping

Platform Bridge
Android AndroidCmpJavaHelper.GetConsentDebugSettingsJavaObject builds com.appodeal.consent.ConsentDebugSettings(ConsentDebugGeography, java.util.ArrayList) and calls the static ConsentManager.setDebugSettings; null clears
iOS CMPUnityPluginConsentManagerSetDebugSettings(int geography, const char* testDeviceIds) maps the enum index to APDConsentDebugGeography and splits the comma-joined ids; -1 clears
Editor no-op with a log line
Dummy unsupported-platform warning, as for the other methods

Release binding

  • package.json: version 2.2.0, com.appodeal.mediation 4.4.0. The mediation 4.4.0 release is what pulls Appodeal Android 4.4.0 and Appodeal iOS 4.4.0 (with the StackConsentManager 4.2.0 pin), so this package must not be published before it.
  • CHANGELOG date is left as TBD until the release date is known.

Verification

  • Unity 2022.3 project with this branch and the mediation plugin pointed at locally built natives (Android core:4.4.0 from mavenLocal, StackConsentManager 4.2.0 xcframework from PR #49).
  • Android: development APK contains the ConsentManager.setDebugSettings call and the sample's SetDebugSettings in the IL2CPP metadata; iOS: device build links the local framework.
  • Manual publisher flow (run with an empty list, register the printed id, rebuild, consent form appears under a non-EEA VPN) on physical devices for both platforms.

🤖 Generated with Claude Code

Khrolovich and others added 9 commits September 9, 2026 14:30
ConsentManager.Instance.SetDebugSettings(ConsentDebugSettings) lets a
publisher test the consent form of another region without a VPN. The DTO
carries a ConsentDebugGeography (Eea, RegulatedUsState, Other -- Google's
DebugGeography values) and an optional list of test device ids; null clears
a previous value. The natives apply it only in a debuggable build on an
emulator, simulator or registered device and log why otherwise.

SDK-1001

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Build com.appodeal.consent.ConsentDebugSettings from the DTO and pass it to
ConsentManager.setDebugSettings. A null DTO is forwarded as a null argument:
Unity resolves the single overload through its java.lang.Object placeholder
match (ReflectionHelper scores any reference parameter for it).

SDK-1001

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
One entry point, CMPUnityPluginConsentManagerSetDebugSettings(geography,
testDeviceIds): the geography index maps to APDConsentDebugGeography in the
bridge and the ids travel comma-joined. Any index outside the enum, -1 for a
null DTO included, clears APDConsentManager.shared.debugSettings, mirroring
the -1 convention of the dismissed callbacks.

SDK-1001

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The Editor simulates the form itself, so the call only logs that it is
ignored off-device.

SDK-1001

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
SDK-1001

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The natives read the override at request time, so the demo shows the
required order: SetDebugSettings, then RequestConsentInfoUpdate.

SDK-1001

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016jfw3fMgkKyrhuubSbQxXB
SDK-1001

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016jfw3fMgkKyrhuubSbQxXB
SDK-1001

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016jfw3fMgkKyrhuubSbQxXB
4.4.0 is the first mediation release whose Android core (4.4.0, Jira
version 41706) and iOS pod (StackConsentManager 4.2.0) both carry
ConsentManager debug settings.

SDK-1001

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Khrolovich Khrolovich changed the title Feature/SDK-1001 Add consent debug settings [SDK-1001] Add consent debug settings support Sep 10, 2026
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.

1 participant