Menu

Preset-Strategy

πŸ’‘Tips

  • Preset Strategy is used to improve ad loading success rate and speed on the app's first launch.
  • setLocalStrategyAssetPath must be called before McSdk.initialize(), otherwise it will have no effect.
  • Strategy files are exported from the HyperBid dashboard and placed in the Flutter project's assets directory.
  • Note: Preset Strategy files should be updated periodically. When ad strategies change significantly on the dashboard, it is recommended to re-export and update the strategy files in your app to maintain optimal first-launch experience.

1. Overview

The Preset Strategy feature allows the SDK to use a local strategy for ad loading on first launch, significantly improving the ad fill rate during the initial startup.

How It Works:

  1. On first launch, the SDK reads the local preset strategy file as the initial configuration
  2. The SDK simultaneously requests the latest strategy from the server
  3. Once the server strategy is successfully fetched, it automatically replaces the local preset strategy
  4. Subsequent launches will directly use the cached server strategy

2. Configuration Steps

2.1 Export Strategy File

Log in to the HyperBid dashboard and export the strategy configuration file for your app. For detailed instructions, see here

2.2 Place Strategy File

Android

Place the exported strategy file in the project's localStrategy directory:

Copy
your_flutter_project/
β”œβ”€β”€ android/app/src/main/
β”‚   └── assets/
β”‚     └── localStrategy/         ← Strategy file directory
β”‚       β”œβ”€β”€ strategy_config.json ← Filename is your appid (⚠️ Do NOT rename)
β”‚       └── ...
β”œβ”€β”€ lib/
β”œβ”€β”€ pubspec.yaml
└── ...

iOS

Place the exported strategy file at the location shown below:

  • ⚠️ You need to rename the exported strategy file to: localStrategy.json

2.3 Call Setup Method

Call setLocalStrategyAssetPath before McSdk.initialize():

dart Copy
// Set local strategy file path (relative to the assets directory)
McSdk.setLocalStrategyAssetPath("localStrategy");
// Then initialize the SDK

Previous
Check Ad Status information
Next
Manual-Loading
Last modified: 2026-06-25Powered by