inngage_plugin 4.0.0
inngage_plugin: ^4.0.0 copied to clipboard
Inngage Plugin for Flutter applications for marketing campaign optimization using Push Notification and In App Messages channels.
4.0.0 #
BREAKING CHANGES — In-App Messages rewritten (pull-based, decoupled from push)
In-App messages no longer arrive inside FCM push payloads. The SDK now fetches
them on demand from POST /v4/message/objectMessage and renders the returned
message (banner for a single slide, carousel with dot indicator for two or
more). Push notifications themselves are unchanged and still use Firebase.
- New public API:
InngageInApp.show({context, handledBySdk, onAction, onMetadata})— call it wherever the app wants an In-App message to appear (after the splash screen, on login, on a specific route…). When there is no message to display, nothing is rendered. WithhandledBySdk: true(default) the SDK executes the actions (deeplink/deep_link,weblinkin the external browser,in_app_url/inappin an in-app browser, unknown → dismiss);metadataactions are delivered toonMetadata. WithhandledBySdk: falseevery action is delivered toonAction. - Prerequisite: the subscription must have completed at least once before the first
InngageInApp.showcall. The subscription response is now parsed and itsapp_idis persisted, together with the device registration token — both are required by/objectMessage(plus a persistedfirstAccessflag, sent astrueuntil the first successful fetch). - New public models:
InAppMessageV2,InAppV2Style,InAppV2Media,InAppV2CarouselItem,InAppV2Content,InAppV2Actions,InAppV2Button,InAppV2ButtonStyle,InAppV2Action,InAppV2ActionTypeandObjectMessageRequest— mirroring the cross-SDK/objectMessagecontract. - New "Wheel" (roleta) message type:
type: "Wheel"responses render a fortune-wheel flow — optional lead-capture form (beforegates the spin;afterlocks a winning coupon until sign-up), weighted client-side draw (drawWeighted, shared with the future Scratch type), spin animation that lands on the drawn slice (viaflutter_fortune_wheel), and a win/lose result panel (solid or gradient background) with a copy-to-clipboard coupon. One spin per display. New models:InAppV2LeadCapture,InAppV2LeadField,InAppV2WheelConfig,InAppV2WheelSlice,InAppV2ResultConfig,InAppV2ResultStyle. NewInngageInApp.showcallbacks:onLeadCapturedandonWheelResult(the SDK delivers both to the app and sends nothing to the API). A "Powered by Inngage" footer is shown unlesshideBrandistrue; thetargetingfield is ignored on mobile. The lead-capture step is implemented and tested but currently ships disabled (InAppV2LeadPanel.renderLeadCapture, defaultfalse— flip to honorleadCapture.enabledagain), and the payloadiconis parsed but intentionally not rendered. - Automatic In-App impression/click tracking: every displayed In-App posts a notification callback (
POST /v4/message/notificationwithid=<notId>andchannel_id: "6") recorded as an opening, and clicks on banner/carousel slides (cardfor background clicks;button,button_up/button_downfor buttons, including dismiss ones) and on Countdown buttons additionally send the origin inbtn_id— the field the API provides for clicks without a link (no redirect involved). Tracking is fire-and-forget, uses thenotIdfield now parsed from the message root, and is skipped when the payload carries nonotId. Wheel/Scratch internal interactions (spin, scratch, lead form) are not click-tracked. - New "Countdown" message type:
type: "Countdown"responses render a ticking deadline card — DIAS/HORAS/MIN/SEG boxes styled bycountdown.boxColor/digitColor, refreshed every second towardendDate(interpreted in the device's local time), plus root-level actionbuttonsthat go through the same action pipeline as banner buttons (targetis a web concept and is ignored). An already-expired campaign is not rendered; when the deadline is reached while the card is open, the boxes and buttons give way toexpiredTitle/expiredBody. New model:InAppV2CountdownConfig. - New "Scratch" (raspadinha) message type:
type: "Scratch"responses render a scratch card (viascratcher) — the weighted draw happens BEFORE the cover is shown, so what gets revealed is already the drawn prize; scratching pastrevealPercentfinishes the reveal and shows the shared win/lose result panel with the coupon. Same lead-capture flows and callbacks as the Wheel, plus the newonScratchResultcallback onInngageInApp.show. New models:InAppV2ScratchConfig,InAppV2ScratchPrize.
Removed:
InAppModel,RichContentandCarrouselImagesModel(replaced by the models above).InngageInAppWidget(in-app messages are no longer queued for display on app resume; callInngageInApp.showon demand instead).InngageDialog.showInAppDialogand thedialogs/app_dialog.dartexport.InngageInApp.blockDeepLinkandInngageInApp.deepLinkCallback(useInngageProperties.blockDeepLinkplus theonActioncallback ofInngageInApp.show).- The
inapp_messagehandling inside the FCM notification handlers.InngageHandlersNotification.handleBackgroundNotificationis kept as a no-op for backward compatibility of existing background handlers. - The
"inapp"/"metadata"secure-storage keys used by the old flow are cleared onInngageSDK.subscribe.
Changed:
SubscriptionService.subscriptionnow returns the API response body (Map<String, dynamic>?) instead ofvoid, so theapp_idcan be extracted.
3.9.0 #
Fixed:
- Request/response payloads (which may contain PII such as e-mail, phone number and custom fields) are no longer printed unconditionally to the console. All SDK logging below error level is now gated on
InngageSDK.setDebugMode(true); errors are always logged. InngageUtils.setKeyAuthorizationnow takes effect even when called after the SDK's HTTP client has been created. Previously the authorization key was captured once at startup and later changes were silently ignored.InngageSDK.subscribe'sfirebaseListenCallbackno longer throws aTypeErrorwhen the callback is typed (e.g.void Function(Map<String, dynamic>)); any single-argument callback signature is now accepted.
Changed:
InngageEvent.sendEventno longer requiresappToken: when omitted, the token configured viaInngageSDK.subscribeis used. Passing it explicitly still works and takes precedence.InngageEvent.sendEventnow returnsfalsewhen the API call fails (HTTP error or no connectivity). Previously network errors were swallowed and the method always returnedtrue. If your app branches on the result, error paths that never triggered before may now run.InngageInApp.deepLinkCallbackis now typed asvoid Function(String? link)instead of the untypedFunction. Untyped closures ((link) { ... }) keep working unchanged; closures explicitly typed as non-nullable ((String link) { ... }) or taking no arguments must be updated:// Before (3.8.x) InngageInApp.deepLinkCallback = (String link) { ... }; // After (3.9.0) InngageInApp.deepLinkCallback = (String? link) { ... };
Deprecated:
InngageSDK.notificationController: this stream never emitted any events, so no working integration depends on it. It will be removed in 4.0, together withInngageSDKextendingChangeNotifier(which likewise never notified listeners) and theInngageSDK().inngagePropertiesinstance field (access the all-staticInngagePropertiesdirectly).
Removed:
- Dead code:
lib/models/inngage_properties.dart(fully commented-out duplicate ofshared/inngage_properties.dart). - Unused
win32dependency.
3.8.2 #
Fixed:
- Click redirection for the in-app message button and card.
3.8.1 #
Changed:
- Migrated all dependency constraints from caret (
^) notation to explicit version ranges (>=min <=max) to provide greater flexibility for consumers of the SDK, allowing compatibility across multiple major and minor versions. Affected packages:device_info_plus:^10.1.2→>=10.1.2 <=13.1.0firebase_core:^4.2.1→>=4.2.1 <=4.10.0firebase_analytics:^12.0.4→>=12.0.4 <=12.4.2firebase_messaging:^16.0.4→>=16.0.4 <=16.3.0flutter_local_notifications:^18.0.1→>=18.0.1 <=21.0.0url_launcher:^6.3.1→>=6.3.1 <=6.3.2webview_flutter:^4.8.0→>=4.8.0 <=4.13.1devicelocale:^0.8.0→>=0.8.0 <=0.9.0geolocator:^12.0.0→>=12.0.0 <=14.0.2uuid:^4.5.1→>=4.4.1 <=4.5.3shared_preferences:^2.3.2→>=2.3.2 <=2.5.5package_info_plus:^8.0.2→>=8.0.2 <=10.1.0advertising_id:^2.6.0→>=2.6.0 <=2.7.1meta:^1.12.0→>=1.15.0 <=1.18.2http:^1.2.1→>=1.2.1 <=1.6.0logger:^2.3.0→>=2.3.0 <=2.7.0flutter_image_slideshow:^0.1.6→>=0.1.3 <=0.1.6flutter_secure_storage:^9.2.2→>=9.2.2 <=10.3.1win32:^5.10.0→>=5.10.0 <=6.3.0
3.8.0 #
Added:
- Implemented a new iOS Notification Service Extension in Swift to support richer push notification handling on sample application.
Fixed:
- Fixed an issue where push notifications with images were not displayed correctly in foreground on Android.
- Fixed duplicate push notifications stacking on screen.
- Fixed an issue where the WebView page was not loading when triggered by push notification click.
Changed
- Improved in-app message data handling for more reliable payload processing.
3.7.3 #
- update:
firebase_coreto version 4.2.1,firebase_analyticsto version 12.0.4 andfirebase_messagingto version 16.0.4.
3.7.2 #
- fix: Corrected the UTM key name in the event sent to GA.
- build: Removed the package attribute from
AndroidManifest.xmlto support AGP 8.x+, and updated the namespace inbuild.gradle.
Some dependencies may require updating the Dart SDK and Flutter SDK. Internal tests were performed using Dart 3.6.1 and Flutter 3.27.2:
- uuid: 4.5.1
- meta: 1.12.0
- shared_preferences: 2.3.2
- win32: 5.10.0
3.7.1 #
- fix: Ensure conversion event parameters are properly registered.
3.7.0 #
- feat: Added new notification handlers for increased flexibility with Firebase Messaging.
- refactor: SDK reorganized and functions renamed for better readability and alignment with other Inngage SDKs.
- fix: Fixed push notification reception and click tracking on iOS (foreground and when app is closed).
3.6.10 #
- fix: added
namespaceon plugin.
3.6.9 #
- fix: fixed build issue by explicitly defining the
namespacein the module-levelbuild.gradle, as required by Android Gradle Plugin 7.0+.
3.6.8 #
- refactor: separate Firebase logic into dedicated methods
3.6.7 #
- fix: callback data firebase closed app
3.6.6 #
- fix: add
appTokeninaddUserData
3.6.5 #
- chore: include UUID in subscription request
3.6.4 #
- chore: add dependencies:
uuidandshared_preferences. - fix: Generating a unique UUID for user registration.
3.6.3 #
- fix: closing In App Message after clicked.
3.6.2 #
- fix: handle clicks on carousel images in the In App Message.
3.6.1 #
- feature: updated notification color for foreground display.
3.6.0 #
- feature: updated notification icon for foreground display.
- feature: added support for email and phoneNumber in the
addUserDatamethod. - refactor: removed deprecated field and non-functional method.
- refactor: revised handling of UTM data.
- update:
device_info_plusto version 10.1.2,package_info_plusto version 8.0.2 anddevicelocaleto version 0.8.0.
3.5.2 #
- chore: removing deprecated dependencies.
3.5.1 #
- fix: removing class causing error in Crash Analytics.
3.5.0 #
- feature: sending UTM parameters to Google Analytics
3.4.0 #
Dependency updates to the following versions: #
- firebase_core: 2.10.0 to 3.1.0.
- firebase_core: 2.10.0 to 3.1.0.
- firebase_messaging: 14.4.1 to 15.0.1.
- flutter_local_notifications: 16.3.3 to 17.1.2.
- url_launcher: 6.1.10 to 6.3.0.
- webview_flutter: 4.2.0 to 4.8.0.
- devicelocale: 0.5.0 to 0.7.1.
- geolocator: 10.1.0 to 12.0.0.
- advertising_id: 2.4.0 to 2.6.0.
- meta: 1.7.0 to 1.12.0.
- http: 1.1.0 to 1.2.1.
- flutter_image_slideshow: 0.1.5 to 0.1.6.
- device_info to device_info_plus (version 10.1.0)
Some dependencies require updating the Dart SDK to at least 3.0.0 and the Flutter SDK to at least 3.13.1. For more information, we recommend checking the Changelog of the listed dependencies.
3.3.0 #
- chore: update logger and flutter_secure_storage dependencies
3.2.0 #
- update: improvement in notification handling
- fix: notification status in closed app
3.1.1 #
- update: remove unnecessary permission from AndroidManifest
3.1.0 #
- chore: Added debug function for the SDK:
InngageSDK.setDebugMode(). - update: Updated dependencies to
flutter_local_notificationsversion 16.3.3.
3.0.0 #
- feature: add geolocation support to subscribe function
- chore: improvement of in-app design and performance
- update: update some dependencies to support Dart 3.0
2.0.12 #
- chore: update http dependency.
2.0.11 #
- fix: opening the deeplink through the
firebaseListenCallbackwith the app closed.
2.0.10 #
- chore: add
attributionIdon subscriber. - chore: update some dependencies.
- refactor: remove the
registrationparameter from theaddUserDatamethod. Value automatically filled. - fix: fixed notification icon not appearing in foreground.