preloadPlacement method

Future<void> preloadPlacement(
  1. String placementId, {
  2. String? locale,
})

Fetches a placement and warms everything its first screen draws — the placement response, the first screen's images and video posters, the store prices of its packages and its fonts — so even the first open of the funnel view draws complete and at once. Call it at app start for the placement that shows your paywall.

Never throws: an unavailable placement or a network failure is logged natively and the open loads as it would have without it. Nothing is presented, so no funnel event is sent. locale is the locale the funnel will open in; the device's when omitted.

Implementation

Future<void> preloadPlacement(String placementId, {String? locale}) async {
  try {
    await _platform.preloadPlacement(placementId, locale: locale);
  } catch (_) {
    // Logged natively; a preload never fails the caller.
  }
}