Skip to content

Expose userCountryCode and userRegionCode - #163

Open
nicolas-chaix-didomi wants to merge 5 commits into
mainfrom
feat/6851-expose-useCountry-and-userRegion
Open

nicolas-chaix-didomi wants to merge 5 commits into
mainfrom
feat/6851-expose-useCountry-and-userRegion

Conversation

@nicolas-chaix-didomi

@nicolas-chaix-didomi nicolas-chaix-didomi commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add read-only userCountryCode / userRegionCode getters mirroring the existing write-only countryCode/regionCode init parameters, wired through Dart, Android (Kotlin), and iOS (Swift) bridge layers.
  • Follows the existing applicableRegulation getter pattern (method channel + DidomiNotReadyException/isReady() guard).

Test plan

  • flutter analyze — no issues
  • New integration test (example/integration_test/user_country_region_test.dart) passing on Android (physical Pixel 6a)
  • Same test passing on iOS (iPhone 17 Simulator)

Add read-only access to the country and region the Didomi SDK
determined for the current user, mirroring the existing countryCode
and regionCode init parameters (CMP-6851).
Verified passing on Android (Pixel 6a) and iOS (simulator).
Regenerated by pod install after adding the didomi_sdk pod dependency
needed to test on iOS.
@nicolas-chaix-didomi nicolas-chaix-didomi changed the title Expose userCountryCode and userRegionCode (CMP-6851) Expose userCountryCode and userRegionCode Sep 15, 2026
regionCode is only populated for countries where a region concept
applies (e.g. US states), so it can be null depending on the location
the SDK resolves for the CI environment. CI failed with
'regionCode != null': is not true.
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