Android – Facebook Audience Network Ads integration Issue

androidfacebook-audience-networkmopub

E/FBAudienceNetwork: You are using custom Application class and don't call AudienceNetworkAds.isInAdsProcess(). Multi-process support will be disabled. Please call AudienceNetworkAds.isInAdsProcess() if you want to support multi-process mode.

implementation 'com.facebook.android:audience-network-sdk:5.1.0'
implementation 'com.mopub.mediation:facebookaudiencenetwork:5.1.0.2'

am using FAN along with Mopub.

How to fix the above issue? Thanks in advance.

Best Solution

It's likely because you use custom Application subclass. Put AudienceNetworkAds.isInAdsProcess() call on top of your custom Application class like this:

public class YourApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();

        if (AudienceNetworkAds.isInAdsProcess(this)) {
            return;
        }

        // your normal onCreate() code
    }
}

Now warning should disappear.

Alternatively you can turn multiprocess support off (not recommended) by setting:

AdSettings.setMultiprocessSupportMode(MultiprocessSupportMode.MULTIPROCESS_SUPPORT_MODE_OFF);

Note. You should call this before calling SDK methods or MoPub mediation.

Related Question