AppLovin / AppLovin-MAX-SDK-Android

Other
233 stars 104 forks source link

How to enable native banner ads in MAX? #143

Closed maxakash closed 2 years ago

maxakash commented 2 years ago

As I can see now, native banner ads are supported in Facebook adapter v6.8.0.9 but I don't see an option to enable it the MAX dashboard.

Please provide steps to enable banner ads.

Thanks

chauduyphanvu commented 2 years ago

@maxakash - we are currently in the final testing phase for the UI/dashboard at the moment, and it should be ready soon. Stay tuned!

Vu Chau AppLovin Team

apshard commented 2 years ago

@chauduyphanvu Why do we even need to have a separate option for it on the dashboard and then pass the extra parameter "is_native_banner" to the adapter?

We can create the correct implementation (NativeAd or NativeBannerAd) using NativeAdBase.fromBidPayload method (based on the placement id and bid response).

So instead of

if ( isNativeBanner )
        {
            mNativeBannerAd = new NativeBannerAd( getContext( activity ), placementId );
            mNativeBannerAd.loadAd( mNativeBannerAd.buildLoadAdConfig()
                                            .withAdListener( new MaxNativeAdListener( parameters.getServerParameters(), activity, listener ) )
                                            .withBid( parameters.getBidResponse() )
                                            .build() );
        }
        else
        {
            mNativeAd = new NativeAd( getContext( activity ), placementId );
            mNativeAd.loadAd( mNativeAd.buildLoadAdConfig()
                                      .withAdListener( new MaxNativeAdListener( parameters.getServerParameters(), activity, listener ) )
                                      .withBid( parameters.getBidResponse() )
                                      .build() );
        }

we can use

mNativeAdBase = NativeAdBase.fromBidPayload(getContext( activity ), placementId, parameters.getBidResponse());
mNativeAdBase.loadAd(
        mNativeAdBase..buildLoadAdConfig()
                .withAdListener( new MaxNativeAdListener( parameters.getServerParameters(), activity, listener ) )
                .withBid( parameters.getBidResponse() )
                .build() );

if (mNativeAdBase instanceof NativeBannerAd) {

} else {

}

This way we can specify on the dashboard the placement id we need to use native or native banner ads.

apshard commented 2 years ago

So I copied and modified the Facebook adapter accordingly and it works perfectly. It gets and displays Facebook Native Banner ads fine after I entered facebook native banner placement id in mediation settings on the dashboard.

chauduyphanvu commented 2 years ago

@apshard - thanks for the feedback. I can see how it can make the flow easier. Let me relay your suggestion to the rest of the team and we'll see what can be done.

apshard commented 2 years ago

@chauduyphanvu Admob facebook adapter has the same implementation. The benefit is that we don't need to pass any extra parameters to the adapter. It will automatically load the ad format defined by (based on) placement id entered in the facebook mediation settings on the dashboard.

chauduyphanvu commented 2 years ago

Yes, although to clarify, you will not need to pass any extra params to the adapter. We will handle it (based on the UI toggle on the dashboard that you will set).

maxakash commented 2 years ago

Yes, although to clarify, you will not need to pass any extra params to the adapter. We will handle it (based on the UI toggle on the dashboard that you will set).

Hey @chauduyphanvu, what is the ETA for native banner support in UI?

chauduyphanvu commented 2 years ago

@maxakash - we are targeting some time next week for the UI support.

apshard commented 2 years ago

Yes, although to clarify, you will not need to pass any extra params to the adapter. We will handle it (based on the UI toggle on the dashboard that you will set).

Yes, but you have to do extra work to add this UI toggle and we have to wait for the changes to live. With the proposed implementation we don't depend on UI (server-side) and can use existing UI implementation and don't need to wait.

maxakash commented 2 years ago

@maxakash - we are targeting some time next week for the UI support.

Hi @chauduyphanvu Is native banner going to be supported this week?

chauduyphanvu commented 2 years ago

@maxakash - yes it is live on the MAX dashboard now. Check it out and let us know if you need anything else!