Can I use AppLovin Max Programmatic Method to show MRec Ads inside a widget in Flutter?

18 views Asked by At

I want to show MRec ads immediately after loading the ad inside a widget, but it takes time and rebuilds every time that widget is opened.

Code Snippet:

void loadAndShowMRecAd() {
    AppLovinMAX.createMRec(mrecAdUnitId, AdViewPosition.centered);
    AppLovinMAX.setMRecListener(AdViewAdListener(
      onAdLoadedCallback: (ad) {
        AppLovinMAX.showMRec(mrecAdUnitId);
      },
      onAdLoadFailedCallback: (adUnitId, error) {},
      onAdClickedCallback: (ad) {},
      onAdExpandedCallback: (ad) {},
      onAdCollapsedCallback: (ad) {},
      onAdRevenuePaidCallback: (ad) {},
    ));
    AppLovinMAX.loadMRec(mrecAdUnitId);
  }

then place loadAndShowMRecAd() inside a container widget.

0

There are 0 answers