consentera_consent 2.0.0 copy "consentera_consent: ^2.0.0" to clipboard
consentera_consent: ^2.0.0 copied to clipboard

Consentera Consent SDK for Flutter — DPDP Act 2023 compliant consent for mobile apps.

2.0.0 #

Breaking, three times over. 1.0.0 could not work against the current platform, and the version never moved while that became true.

The wire #

  • createSession takes dataPrincipal — a map keyed by YOUR organisation's locked integration key — instead of dataPrincipalRef/dataPrincipalRefType. dateOfBirth now rides age.date_of_birth; language replaces localePref, noticeLanguage and templateLanguage together.
  • The guardian channel (guardianEmail / guardianPhone / guardianRelationship) is new: before it, a child whose parent was not already a customer could not consent through this SDK at all.
  • validate and withdraw take a PrincipalRef — data_principal_id, or data_principal_identifiers as an open map keyed by your locked integration key, the same shape and the same vocabulary dataPrincipal uses on create (F015). data_principal_ref is refused outright by the API since 2026-09-21, with no transition period.
  • ONE VOCABULARY. The closed five-field DataPrincipalIdentifiers class is deleted: a closed struct cannot carry a per-tenant scheme. The mobile atom is mobile on both roads — phone is refused by name — and there is no pan key, because PAN is evidence-class and can never be a scheme field. This SDK does no client-side allow-listing; the server names the field it refuses.
  • New refusals to switch on: UNKNOWN_IDENTIFIER_FIELD, IDENTIFIER_REQUIRED, INVALID_IDENTIFIER_FORMAT and SCHEME_NOT_CONFIGURED.
  • openPortal / createPortalSession take the same identifier map (SDK register MOB-043). The key is the kind: {'mobile': '+91…'} goes out as a mobile reference. They used to take a string and declare it email whatever the organisation is keyed on. One identifier is sent: the only entry, or the first field of the new SessionConfig.identifierScheme. With several and no scheme the call refuses with IDENTIFIER_AMBIGUOUS. phone is refused before the wire.
  • ConsenteraException carries code and platformMessage (MOB-042): the platform's canonical code, and its own sentence for the refusal, verbatim. Show the sentence to the person. It is kept out of message and toString(), which go to logs.
  • On Android, no Custom Tabs browser is a refusal (MOB-044). presentConsent asks supportsLaunchMode(LaunchMode.inAppBrowserView) first and throws ConsenteraBrowserUnavailable (code: 'NO_BROWSER') instead of letting url_launcher fall back to a WebView with no address bar. On Android 11+ the app manifest must declare the android.support.customtabs.action.CustomTabsService query (README).
  • The raw-Aadhaar refusal is road-scoped, so read it carefully. On the lifecycle roads F015 folded AADHAAR_RAW_REFUSED into INVALID_IDENTIFIER_FORMAT (consent/lifecycle_identity.go:143). On SESSION CREATE it is unchanged and still answers AADHAAR_RAW_REFUSED (consent/collection.go:1094). The same value sent on the two roads is refused under two codes.
  • The response now carries expiresAt, noticeVersionId, languageCode and uiSchemaVersion, which were decoded by nobody.

The browser leg and the callback #

  • presentConsent opens the notice with LaunchMode.inAppBrowserView (Chrome Custom Tabs / SFSafariViewController). It was externalApplication — the external browser — while the code comment claimed Custom Tabs, and it discarded the boolean that says whether the browser opened at all. It now throws rather than falling back.
  • parseCallback is new on this surface: Flutter had no callback parser, so every host wrote its own. It checks scheme AND host AND path AND a state nonce this SDK generates per session, and throws ConsenteraCallbackRejected otherwise.

Transport #

  • Retries on 429/5xx/transport with full jitter, honouring Retry-After in both RFC 9110 forms; never on a 4xx. One Idempotency-Key per operation, reused across that operation's retries. X-Consentera-SDK and a User-Agent the platform's audit coarsening parses. requestId and statusCode on the exception; the response body deliberately kept OUT of the message.
  • A per-attempt timeout inside a per-call deadline, and close().
  • No default server. ConsenteraSession refuses a blank or non-absolute http(s) backendBaseUrl at construction with an ArgumentError named backendBaseUrl, instead of a URI error at the first request. The app talks only to its own backend, so there is no host the SDK could sensibly default to.

Removed #

  • deriveTcfKeys and everything IABTCF. It produced a 10-bit purpose string where TCF v2.2 has 11 purposes, and wrote IABTCF_gdprApplies = 1 unconditionally from an India-DPDP SDK. This SDK has no advertising function.
  • flutter_riverpod, which lib/ never imported and every consumer paid for.

Other #

  • analysis_options.yaml exists, so the declared flutter_lints finally runs.
  • Dart ≥3.5 / Flutter ≥3.24; flutter_lints 6.x.

1.0.0 #

  • Initial release.
0
likes
160
points
--
downloads

Documentation

Documentation
API reference

Publisher

verified publisherconsentera.in

Weekly Downloads

Consentera Consent SDK for Flutter — DPDP Act 2023 compliant consent for mobile apps.

Homepage
Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, http, meta, url_launcher

More

Packages that depend on consentera_consent