react-native-google-mobile-ads
    Preparing search index...

    Class MultiFormatAdRequest

    One AdLoader / GADAdLoader request that may return native and/or GAM banner.

    Multi-format means several formats compete for one ad. It is not multi-count: requestCount stays 1 in v1.

    const request = MultiFormatAdRequest.create({
    adUnitId: gamUnitId,
    requestOptions: MultiFormatAdPresets.nativeOrBanner([
    BannerAdSize.MEDIUM_RECTANGLE,
    ]),
    });
    const { ads, errors, responseInfo } = await request.load();
    const handle = ads[0];
    if (handle && !handle.isStaleByPolicy()) {
    renderWinner(handle);
    }
    console.log(errors.map(error => error.reason), responseInfo?.responseId);
    Index
    • Imperative load. The caller owns every returned handle: destroy() it, and evaluate isStaleByPolicy() before rendering, since a handle can cross the configured window between load and render. The policy timer lives on the handle; subscribe with onStaleByPolicy while holding if needed.

      Resolves the raw triple rather than a MultiFormatLoadResult, so there is no status word on this path: both arrays empty is a clean no-fill, a non-empty errors with a handle is the partial case, and a non-empty errors with no handle is a failure. responseInfo is the ad server's record of the response and is populated even on a clean no-fill, because a response record is not a failure and so does not belong in errors.

      Returns Promise<
          {
              ads: MultiFormatAdHandle[];
              errors: AdError[];
              responseInfo: ResponseInfo
              | null;
          },
      >

    adUnitId: string