InMobi / sdk-sample-code-android

This repository contains InMobi Android SDK sample code for different ad-formats, which publishers can use to incorporate in their apps — Edit
Apache License 2.0
38 stars 43 forks source link

[InMobi error]: Ad request successful but no ad served. NO_FILL #77

Closed toufique-imam closed 3 years ago

toufique-imam commented 3 years ago

I keep getting this error for any kinds of ads. When I switch to test every ads works fine. I followed the InMobi Code samples and documentation and maintained strong reference to the listeners and ad objects . How can I solve this issue.

initialization and requesting a full screen ad :

public static void initInMobi(Activity activity, String ID,
                                  SdkInitializationListener sdkInitializationListener) {
        JSONObject consent = new JSONObject();
        try {
            // Provide correct consent value to sdk which is obtained by User
            consent.put(InMobiSdk.IM_GDPR_CONSENT_AVAILABLE, true);
            consent.put("gdpr" , 0);
            consent.put(InMobiSdk.IM_GDPR_CONSENT_IAB , "consent in IAB FORMAT");

        } catch (JSONException e) {
            e.printStackTrace();
        }
        InMobiSdk.setLogLevel(InMobiSdk.LogLevel.DEBUG);
        InMobiSdk.init(activity, ID, consent, sdkInitializationListener);
    }
public void initInterstitialAd() {
        inMobiInterstitial = new InMobiInterstitial(activity,
                InMobi_INTERSTITIAL_AD_ID
                , new InterstitialAdEventListener() {
            @Override
            public void onAdLoadSucceeded(@NonNull InMobiInterstitial inMobiInterstitial, @NonNull AdMetaInfo adMetaInfo) {
                //super.onAdLoadSucceeded(inMobiInterstitial, adMetaInfo);
                Log.d("[InMobi Load done]", adMetaInfo.getBidKeyword());
                if (adEventListener != null) {
                    adEventListener.onAdLoadDone();
                }
            }

            @Override
            public void onAdLoadFailed(@NonNull InMobiInterstitial inMobiInterstitial, @NonNull InMobiAdRequestStatus inMobiAdRequestStatus) {
                Log.d("[InMobi error]", inMobiAdRequestStatus.getMessage()+" "+inMobiAdRequestStatus.getStatusCode().name());
                if (adEventListener != null) {
                    adEventListener.onAdActivityError(-1);
                }
            }

            @Override
            public void onAdDismissed(@NonNull InMobiInterstitial inMobiInterstitial) {
                //super.onAdDismissed(inMobiInterstitial);
                Log.d("[InMobi Ad Done done]", "DONE");
                if (adEventListener != null) {
                    adEventListener.onAdActivityDone(110);
                }
            }
        }
        );
    }

    public void loadInterstitialAd() {
        if (adEventListener != null) {
            adEventListener.onAdLoadingStarted();
        }
        inMobiInterstitial.load();
    }
rajsuvariya commented 3 years ago

Hi @sabertooth9

Thank you for reaching out. If you are getting "Ad request successful but no ad served. NO_FILL" that means there is nothing wrong with your integration, it is just that at the time user app is requesting ad there are no advertisers willing to show an ad for that user. Hence InMobi reports NO_FILL. You can test with test ads and if you are able to see the test ads that means your setup is correct. When you go live and different kind of users starts using your app, and if advertisers are willing to show ads to those users then you will start getting impressions. You can check this on InMobi dashboard - (no of ad requests, no of impressions etc.).

toufique-imam commented 3 years ago

Hi @sabertooth9

Thank you for reaching out. If you are getting "Ad request successful but no ad served. NO_FILL" that means there is nothing wrong with your integration, it is just that at the time user app is requesting ad there are no advertisers willing to show an ad for that user. Hence InMobi reports NO_FILL. You can test with test ads and if you are able to see the test ads that means your setup is correct. When you go live and different kind of users starts using your app, and if advertisers are willing to show ads to those users then you will start getting impressions. You can check this on InMobi dashboard - (no of ad requests, no of impressions etc.).

Will specifying the user attributes like location , age , gender help getting the ads? I already requested for FINE and COARSE location , does inmobi sdk automatically gets the location or I have to do it manually?

rajsuvariya commented 3 years ago

@sabertooth9 providing the demographic details certainly will help you to increase chances to get an ad but it is not guaranteed that you will get an ad for sure. As simply there might be no advertisers willing to show ads in your area. Also, if you already have a location with you, you can set it on InMobiSDK class.

toufique-imam commented 3 years ago

@rajsuvariya ok , it will be nice if sample gdpr string is given in the sample too , Thanks for your reply . Stay safe

rajsuvariya commented 3 years ago

@sabertooth9 the GDPR only applies in GDPR enabled region so if you are testing outside GDPR enabled region it won't affect. Also, the GDPR String is based on the IAB standard. You can refer this for more info https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/Consent%20string%20and%20vendor%20list%20formats%20v1.1%20Final.md