Flutter SDK Installation

Pre-requisites

  1. Visual Studio Code
  2. Android Studio (Iguana or newer)
  3. Android 7.0 (API level 24) or newer: set minSdk to 24 or higher in your Android app module’s Gradle file
  4. Xcode (26.2 or newer). Xcode 27 needs Flutter 3.44.8 or newer; on Flutter 3.44.x with CocoaPods, also add the post_install step under iOS Setup. Flutter 3.47.0 and newer do this themselves.
  5. Obtain client settings from Publift:
    • TENANT_CODE
    • TAG_ID
    • Google APPLICATION_ID (Android)
    • GADApplicationIdentifier (iOS)

Installation

  1. Add fuseapp_plugin to your pubspec.yaml
echo 'BrnMk9bbufLlX4Vd' | flutter pub token add https://dart.cloudsmith.io/publift/fuseapp/

flutter pub add fuseapp_plugin --hosted-url https://dart.cloudsmith.io/publift/fuseapp/
  1. Android Setup
  • Add the repository to your app/build.gradle.kts
repositories {
    ...
    maven { url = uri("https://dl.cloudsmith.io/BrnMk9bbufLlX4Vd/publift/fuseapp/maven/") }
}

If your file is named build.gradle, then use the following syntax:

repositories {
    ...
    maven { url "https://dl.cloudsmith.io/BrnMk9bbufLlX4Vd/publift/fuseapp/maven/" }
}
  • Update AndroidManifest.xml

Replace <YOUR_GAM_APP_ID>, <YOUR_PUBLIFT_TAG_ID> and <YOUR_TENANT_CODE> with the values provided by Publift — substitute the value only, not the surrounding angle brackets.

<?xml version="1.0" encoding="UTF-8"?>
<manifest ... >
    <application ... >
        <!-- Sample Ad Manager app ID: ca-app-pub-3940256099942544~3347511713 -->
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="<YOUR_GAM_APP_ID>" />
        <meta-data
            android:name="com.publift.mobile.TAG_ID"
            android:value="<YOUR_PUBLIFT_TAG_ID>" />
        <meta-data
            android:name="com.publift.mobile.TENANT_CODE"
            android:value="<YOUR_TENANT_CODE>" />

        ...
    </application>
</manifest>
  • (Optional) Use the Google Mobile Ads Next-Gen SDK

With plugin version 2.7.0 or newer, pass --dart-define=USE_NEXT_GEN_SDK=true to every flutter run and flutter build command, including release and CI builds. Before switching, read Google Mobile Ads Next-Gen SDK.

google_mobile_ads reads the same USE_NEXT_GEN_SDK flag, so it switches to the Next-Gen SDK together with Fuse and you don’t need to exclude play-services-ads for it. If another package still depends on the legacy SDK, follow the Other libraries step on that page.

  1. iOS Setup

The plugin installs the Fuse App SDK through Swift Package Manager or CocoaPods. Flutter uses Swift Package Manager by default from Flutter 3.47.

Swift Package Manager (recommended)

Flutter fetches the Fuse App SDK from github.com/Publift/fuseapp-swift-package, so there is nothing to add to your Podfile.

  • On Flutter 3.44 to 3.46, turn Swift Package Manager on. Flutter 3.47 and newer have it on already.
flutter config --enable-swift-package-manager
  • Set the minimum iOS version to 15.0: in Xcode, select the Runner target, then General > Minimum Deployments.

  • If your app also uses google_mobile_ads, use version 8.0.0 or newer. Older versions only support CocoaPods, so use the CocoaPods setup below with them.

  • If another plugin in your app installs the Google Mobile Ads SDK through CocoaPods, use the CocoaPods setup below. Xcode links only one copy of the SDK, and it may not be the version that plugin expects.

CocoaPods

  • Add the repository and minimum iOS version at the top of your Podfile
platform :ios, '15.0'

source 'https://dl.cloudsmith.io/BrnMk9bbufLlX4Vd/publift/fuseapp/cocoapods/index.git'
source 'https://cdn.cocoapods.org/'
  • If you build with Xcode 27 on Flutter 3.44.x, raise the deployment target of every pod in the post_install block your Podfile already has. Xcode 27 rejects any target below iOS 15.0, and some ad SDKs still declare a lower version:
post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)

    # Add this loop after flutter_additional_ios_build_settings
    target.build_configurations.each do |build_config|
      if Gem::Version.new(build_config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] || '0') < Gem::Version.new('15.0')
        build_config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'
      end
    end
  end
end

Add the loop to your existing block; CocoaPods rejects a second post_install block. Flutter 3.47.0 and newer already raise these targets, so the loop is unnecessary there but harmless. Without it on Flutter 3.44.x, Xcode 27 fails with an error such as The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 12.0, but the range of supported deployment target versions is 15.0 to 27.0.x.

Both setups

  • Update Info.plist

Replace <YOUR_GAM_APP_ID>, <YOUR_PUBLIFT_TAG_ID> and <YOUR_TENANT_CODE> with the values provided by Publift — substitute the value only, not the surrounding angle brackets.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <!-- Sample Ad Manager App ID: ca-app-pub-9939518381636264~1458516390 -->
    <key>GADApplicationIdentifier</key>
    <string><YOUR_GAM_APP_ID></string>
    <key>com.publift.mobile.TAG_ID</key>
    <string><YOUR_PUBLIFT_TAG_ID></string>
    <key>com.publift.mobile.TENANT_CODE</key>
    <string><YOUR_TENANT_CODE></string>
    
    ...
</dict>
</plist>
  • Add SKAdNetworkItems - copy and add the contents from here
  1. Initialize the Plugin

Before loading ads, your app should initialize the Fuse App SDK plugin. This is ideally done right after your app starts.

await FuseAppPlugin.initializeSDK();
  1. Display a Banner Ad

The following is an example of loading a banner ad.

import 'package:fuseapp_plugin/fuseapp.dart';

class MyWidget extends StatelessWidget {
  const MyWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Align(
          alignment: Alignment.center,
          child: FuseAdView(code: "example_fixed_size_banner"),
        )
    );
  }
}
  1. Customize your Banner Ad

The following example displays some customization option. See the example app for more detailed examples.

FuseAdView(
    code: "example_fixed_size_banner",
    params: FuseAdViewParams(
        customTargeting: {
            "sport": "basketball",
            "size": "small"
        },
        contentUrls: [
            "https://www.publift.com/about"
        ]
    ),
    onEvent: ({event}) {
        debugPrint("Fuse Event: $event")
    },
)
  1. Display a Full-screen Ad

The following is an example of loading and showing a full-screen (interstitial) ad.

import 'package:fuseapp_plugin/fuseapp.dart';

final ad = FuseFullScreenAdView(
  code: 'example_interstitial',
  onEvent: (event) {
    if (event.event == FuseAdViewEvent.dismissed) {
      ad.dispose();
    }
  },
);

// Show with a 10 second timeout
await ad.show(timeout: Duration(seconds: 10));