consentera_consent 2.0.0
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 #
createSessiontakesdataPrincipal— a map keyed by YOUR organisation's locked integration key — instead ofdataPrincipalRef/dataPrincipalRefType.dateOfBirthnow ridesage.date_of_birth;languagereplaceslocalePref,noticeLanguageandtemplateLanguagetogether.- 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. validateandwithdrawtake aPrincipalRef—data_principal_id, ordata_principal_identifiersas an open map keyed by your locked integration key, the same shape and the same vocabularydataPrincipaluses on create (F015).data_principal_refis refused outright by the API since 2026-09-21, with no transition period.- ONE VOCABULARY. The closed five-field
DataPrincipalIdentifiersclass is deleted: a closed struct cannot carry a per-tenant scheme. The mobile atom ismobileon both roads —phoneis refused by name — and there is nopankey, 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_FORMATandSCHEME_NOT_CONFIGURED. openPortal/createPortalSessiontake the same identifier map (SDK register MOB-043). The key is the kind:{'mobile': '+91…'}goes out as amobilereference. They used to take a string and declare itemailwhatever the organisation is keyed on. One identifier is sent: the only entry, or the first field of the newSessionConfig.identifierScheme. With several and no scheme the call refuses withIDENTIFIER_AMBIGUOUS.phoneis refused before the wire.ConsenteraExceptioncarriescodeandplatformMessage(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 ofmessageandtoString(), which go to logs.- On Android, no Custom Tabs browser is a refusal (MOB-044).
presentConsentaskssupportsLaunchMode(LaunchMode.inAppBrowserView)first and throwsConsenteraBrowserUnavailable(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 theandroid.support.customtabs.action.CustomTabsServicequery (README). - The raw-Aadhaar refusal is road-scoped, so read it carefully. On the
lifecycle roads F015 folded
AADHAAR_RAW_REFUSEDintoINVALID_IDENTIFIER_FORMAT(consent/lifecycle_identity.go:143). On SESSION CREATE it is unchanged and still answersAADHAAR_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,languageCodeanduiSchemaVersion, which were decoded by nobody.
The browser leg and the callback #
presentConsentopens the notice withLaunchMode.inAppBrowserView(Chrome Custom Tabs /SFSafariViewController). It wasexternalApplication— 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.parseCallbackis new on this surface: Flutter had no callback parser, so every host wrote its own. It checks scheme AND host AND path AND astatenonce this SDK generates per session, and throwsConsenteraCallbackRejectedotherwise.
Transport #
- Retries on 429/5xx/transport with full jitter, honouring
Retry-Afterin both RFC 9110 forms; never on a 4xx. OneIdempotency-Keyper operation, reused across that operation's retries.X-Consentera-SDKand aUser-Agentthe platform's audit coarsening parses.requestIdandstatusCodeon 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.
ConsenteraSessionrefuses a blank or non-absolute http(s)backendBaseUrlat construction with anArgumentErrornamedbackendBaseUrl, 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 #
deriveTcfKeysand everything IABTCF. It produced a 10-bit purpose string where TCF v2.2 has 11 purposes, and wroteIABTCF_gdprApplies = 1unconditionally from an India-DPDP SDK. This SDK has no advertising function.flutter_riverpod, whichlib/never imported and every consumer paid for.
Other #
analysis_options.yamlexists, so the declaredflutter_lintsfinally runs.- Dart ≥3.5 / Flutter ≥3.24;
flutter_lints6.x.
1.0.0 #
- Initial release.