The Uptick Ads Flutter SDK allows seamless integration of personalized offers into your Flutter applications. Inspired by our Android integration guide, this SDK provides a simple yet powerful way to render dynamic, context-sensitive offers with minimal configuration—ensuring a smooth user experience.
order_confirmation
, order_status
, and survey
.
Add the following lines to your pubspec.yaml
file:
flutter pub add uptick_ads
Then, run:
flutter pub get
In your Dart files, import the Uptick widget:
import 'package:uptick_ads/screens/uptick_widget.dart';
Update your android/app/build.gradle
to ensure the minimum SDK version is set correctly:
android { defaultConfig { minSdkVersion 26 // Minimum Android version supported } }
Ensure your ios/Podfile
contains the following configuration:
platform :ios, '11.0' // Minimum iOS version supported
The Uptick Ads Flutter SDK provides a widget-based integration to render personalized offers. Follow these steps to integrate the widget and configure callbacks.
Simply insert the UptickWidget
in your widget tree. The widget requires an integrationId
and a placement
parameter:
import 'package:uptick_ads/screens/uptick_widget.dart'; UptickWidget( integrationId: "AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE", placement: "order_confirmation", )
To handle errors and adjust UI based on the type of offer (e.g. popup vs. inline), configure the widget’s callback functions:
UptickWidget( integrationId: "AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE", placement: "order_confirmation", onRenderTypeReceived: (renderType) { // Customize UI based on render type: // For example, if renderType is "popup", you might choose a full-screen container. print("Render Type: $renderType"); }, onError: (errorMessage) { // Handle errors, e.g. by showing a Snackbar or logging the error. print("Error: $errorMessage"); }, )
The widget automatically fetches and updates offers based on your integration details, ensuring that content remains dynamic and responsive.
Below is a complete example of integrating the Uptick Ads Flutter SDK in a Flutter app:
import 'package:flutter/material.dart'; import 'package:uptick_ads/screens/uptick_widget.dart'; class HomePage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Flutter Uptick Plugin Example'), ), body: Center( child: UptickWidget( integrationId: "AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE", placement: "order_status", onRenderTypeReceived: (renderType) { // Customize layout based on render type if needed. }, onError: (errorMessage) { ScaffoldMessenger.of(context).showSnackBar( SnackBar(content: Text("Error: $errorMessage")), ); }, ), ), ); } }
Follow these steps to run the example application provided in the repository:
git clone https://github.com/uptick-ads/flutter-sdk
cd example
flutter pub get
flutter run
This plugin supports both Android and iOS platforms. In your pubspec.yaml
, the plugin configuration should look like:
flutter: plugin: platforms: android: package: com.example.uptick_ads pluginClass: FlutterUptickPlugin ios: pluginClass: FlutterUptickPlugin
UptickWidget
is properly integrated into your widget tree and that the correct integration ID is provided.
onError
callback to capture any issues during offer rendering. Check network connectivity and integration credentials.
This SDK is released under the MIT License.
If issues persist, reach out to our technical support team for further assistance.