bemall_sdk 1.1.8
bemall_sdk: ^1.1.8 copied to clipboard
Flutter SDK for BeMall Promotion and Loyalty Club services.
Changelog #
1.1.8 #
-
Flutter: dartdoc comments on the whole public API of
bemall_sdk, enforced by thepublic_member_api_docslint. -
Ready-made navbar drawn by the SDK (title, colors and back arrow, no native code in the app): iOS
BeMallSdk.shared.navBarStyle = BeMallNavBarStyle(...), AndroidBeMallSdk.navBarStyle = BeMallNavBarStyle(...), FlutternavBar: BeMallNavBar(...)and CapacitornavBar: { title, color, textColor, height }oninitializeandopen. The strip height comes from the navbar, sotopInsetis not needed. A customBeMallSdk.navBarview (Android) ortopInsetplus an own window (iOS) keeps working and, on Android, takes precedence. -
Flutter: the navbar can also be an own widget, drawn on a second Flutter engine inside the top strip:
navBar: BeMallNavBar.widget(entrypoint: ...), withBeMallNavBar.close()to close the SDK from inside the widget. -
Biometrics (Face ID / Touch ID / fingerprint) is now opt-in: new
biometricsEnabled(iOSBeMallSdk.shared, AndroidBeMallSdk), defaultfalse. Before, the SDK offered it after every login. Flutter and Capacitor expose it asbiometricsEnabledoninitializeandopen. -
Breaking:
campaignHashis now required forloyalty_club, enforced at compile time.BeMallSdkConfigis built withBeMallSdkConfig.promotion(...)orBeMallSdkConfig.loyaltyClub(customerId, campaignHash, ...)(iOS, Android, Flutter) and the CapacitorBeMallSdkConfigis a union byservice. The generic initializer is no longer public. Bridges still reject a missing hash at runtime withcampaign_hash_required, instead of opening the campaign list with no authenticated customer. -
dispose()/reset()now also clear the tenant's localStorage/sessionStorage (before: cookies only, iOS and Android). Stale web storage could leave the nextinitializewith a new token stuck on "Por favor aguarde, processando...". -
Android: R8 renamed
BeMallSdkConfig.Companion, so Kotlin apps could not resolveBeMallSdkConfig.promotion(...)/loyaltyClub(...)(Unresolved reference).consumer-rules.pronow keepsBeMallSdkConfig$*. -
iOS: dragging from the left edge now closes the SDK when the page has no history to go back to (the WKWebView still goes back in history first), matching the Android system back gesture.
1.1.7 #
- New error
authorization_unreachablewhen the token validation request gets no HTTP response (network, DNS or certificate). Before, it was reported asinvalid_customer_access_token, which looked like a bad token. - Loyalty Club: when
customerAccessTokenis provided, the URL is now/loyaltyclub/mobile/auth?token=<token>(iOS and Android; wrappers inherit it). - Loyalty Club without a token now opens
/loyaltyclub/mobile/<campaignHash>/home(campaign home) instead of the root; a blank token never addstoken=to the URL. - New
onUnauthenticated(iOSBeMallSdk.shared.onUnauthenticated, AndroidBeMallSdk.onUnauthenticated) and eventunauthenticated(Flutter, Capacitor): Promotion opened without an authenticated user (e.g. no token) asks for logout and there is no session. By default the SDK clears the site data (cache, cookies, storage), unloads the page and opens the campaign root (/promotion/mobile/<hash>/), once per opening. The host app is notified once; it does not close itself, the host app decides, e.g. callingclose(). initializewithoutcustomerAccessTokennow always opens logged out: any previous session (cookies, site data, saved config, biometrics) is discarded first (iOS and Android).- Flutter:
initializeandopennow acceptmktOptIn(accepted,rejectedorask), same as the iOS, Android and Capacitor SDKs. - New
topInsetandnavBaron Android (BeMallSdk.topInset, in dp, andBeMallSdk.navBar, a factory for the navbarView): the SDK reserves a strip at the top of its screen and fits the app's navbar into it, matching the iOStopInset. - Flutter and Capacitor:
initializeandopenaccepttopInset(iOS and Android), so the host app can draw its own native navbar. Examples updated. - Docs: new "Referência" section in every guide (configuration, login behavior, session, errors,
fbclid/utm_id).
1.1.6 #
- New
close()(iOSBeMallSdk.shared.close(), AndroidBeMallSdk.close(), CapacitorBeMall.close(), Flutterclose()) closes the SDK screen keeping the session, so the host app can offer its own close control. The webapp can also close it by postingon_closetoBeMallChannel. - iOS/Android: when the webapp opens the scanner with
scan_barcode, the live scanner captures automatically when a non-fiscal code (e.g. a parking ticket) is detected. Purchase registration (handle_pictures/handle_pictures_upload) never captures automatically. Detection rule: the same code must appear in consecutive frames (5 on iOS, 3 on Android), with no tap on the capture button. Fiscal (SEFAZ) codes still use the capture button. The scanner shows visual feedback (only in this automatic mode): a green frame over the detected code, a "Lendo ticket…" label while reading and "Código lido" when the capture starts. - iOS: new
BeMallSdk.shared.topInsetreserves a strip at the top of the SDK screen (below the status bar) so the host app can draw its own navigation bar without covering the webapp. - The WebView now sets the cookies
webapp_app_version(host app version name),webapp_app_id(package name / bundle id) andwebapp_app_platform(androidorios) so the web can tell if the app is outdated. - Attribution:
fbclidandutm_id(sent by Meta/Instagram) are now captured from deep links, push extras and MMP payloads (iOS, Android and wrappers) and forwarded to the page like the otherutm_*fields. Values are sanitized and limited to 255 characters. - Capacitor: the package now supports Capacitor 5.7+ as well as 6+. Android
hosts must use Java 17, Kotlin 2.x,
minSdk 24andcompileSdk 34or newer; iOS hosts must target iOS 14.0 or newer.
1.1.4 (iOS only) #
- iOS: fixed the WebView opening zoomed in until the user pinches.
WKWebViewcomputes its initial zoom from the frame atload()time; sinceload()ran from an asyncprepareSessioncallback that could fire before the first Auto Layout pass, the frame was still.zero. Now forcesview.layoutIfNeeded()right beforeload().
1.1.3 (iOS only) #
- iOS: the live scanner already fell back to the first code read when none matched the SEFAZ
format; the gallery/photo-library picker (
processImage, behindhandle_pictures/scan_barcode) did not and silently dropped non-fiscal barcodes (e.g. a parking ticket). Now it falls back too. Added the same debug logs (tag[BeMallQrDebug], prefixedgallery) for the raw code, the fallback pick and "no barcode detected".
1.1.2 #
- Android: when no code matches the SEFAZ format, uses the first code read (e.g. a parking
ticket barcode) instead of discarding the scan. Added debug logs (tag
BeMallQrDebug) for the raw code, the fallback pick and "no barcode detected".
1.1.1 #
- Breaking:
BeMallUtm.customis now a key/value map (Map<String, String>on Android,[String: String]on iOS,Map<String, String>on Flutter,Record<string, string>on Capacitor) instead of a free-text string. Each pair is sent as its ownutm_custom_<key>query parameter instead of a singleutm_custom. Keys are lowercased and limited to letters, numbers and_(max 100 characters); values are sanitized like the other UTM fields (max 255 characters). - Added
mktOptInon Android and iOS: the host app sets the user's marketing consent ("ask","accepted"or"rejected"; anything else is ignored) and it is sent asmkt_opt_in. It is independent fromBeMallUtm; a captured origin withmkt_opt_in(deep link, extras/userInfo, attribution service) takes priority over it.
1.1.0 #
- Added
BeMallUtmand the optionalutm:argument ofinitializeandopento send the source of the visit (source,medium,campaign,term,contentand a free-textcustom). Without it the SDK sends the app name,appand the promotion hash.
1.0.0 #
- Unified public API for Promotion and Loyalty Club.
- Native URL resolution and secure persisted customer session lifecycle.
- One precompiled AAR and one XCFramework.
- Native camera/gallery, QR/barcode, parking-ticket and receipt-upload parity.