AppLovin / AppLovin-MAX-SDK-Android

Other
210 stars 95 forks source link

Native Ad is Broken when loaded Via Custom Adapter #677

Open SlokeT opened 1 week ago

SlokeT commented 1 week ago

MAX SDK Version

12.4.2

Device/Platform Info

Android

Current Behavior

When I load a Native Ad via the custom adapter. The Ad is malformed, it does not have the icon and the click through action does not work. Screenshot 2024-06-19 181805

Expected Behavior

The Native ad should function normally i.e have the icon and should direct to the Ad CTA when clicked.

How to Reproduce

Try to Load a Native Ad via Max Custom Adapter.

Additional Info

Below is the code used to create a Max Native Ad from a Custom Native Ad.

NativeAd.Image icon = nativeAd.getIcon();
                        MaxNativeAd.MaxNativeAdImage iconImage = null;
                        if ( icon != null )
                        {
                            if ( icon.getDrawable() != null )
                            {
                                iconImage = new MaxNativeAd.MaxNativeAdImage( icon.getDrawable() );
                            }
                            else
                            {
                                iconImage = new MaxNativeAd.MaxNativeAdImage( icon.getUri() );
                            }
                        }

final MaxNativeAd maxNativeAd = new MaxNativeAd.Builder()
                                .setAdFormat( MaxAdFormat.NATIVE )
                                .setTitle( nativeAd.getHeadline() )
                                .setBody( nativeAd.getBody() )
                                .setCallToAction( nativeAd.getCallToAction() )
                                .setIcon( iconImage )
                                .setMediaView( mediaView )
                                .build();
richashukla23 commented 1 week ago

@SlokeT Are you able to reproduce this in our Demo App - if yes, could you share a sample project where this is reproducible?