question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to set user's admobReleaseUnitId. Adapter use HARDCODED value of AdMob ad unit id.

See original GitHub issue

adapterWrapper = new AdmobAdapterWrapper(context, admobReleaseUnitId);

admobReleaseUnitId - never used in code, because in method init() Collection(String) admobReleaseUnitIds never used:

private void init(Context context, Collection<String> admobReleaseUnitIds, String[] testDevicesId, EnumSet<EAdType> adTypesToShow){
        setNoOfDataBetweenAds(DEFAULT_NO_OF_DATA_BETWEEN_ADS);
        setLimitOfAds(DEFAULT_LIMIT_OF_ADS);
        setContentAdsLayoutContext(ContentAdLayoutContext.getDefault());
        setInstallAdsLayoutContext(InstallAppAdLayoutContext.getDefault());
        mContext = context;
        adFetcher = new AdmobFetcher();
        if(testDevicesId!=null)
            for (String testId: testDevicesId)
                adFetcher.addTestDeviceId(testId);
        adFetcher.setAdTypeToFetch(adTypesToShow == null || adTypesToShow.isEmpty()
                ?  EnumSet.allOf(EAdType.class): adTypesToShow);
        adFetcher.addListener(this);
        // Start prefetching ads
        adFetcher.prefetchAds(context.getApplicationContext());
    }

Instead of that adapter use hardcoded values of test_admob_unit_id

<resources>
    <string name="app_name">admobadapter</string>
    <string name="test_admob_unit_id">ca-app-pub-3940256099942544/3986624511</string>
    <string name="test_admob_express_unit_id">ca-app-pub-3940256099942544/1072772517</string>
</resources>

Please, add capability to set users AdMob unit ID.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
JohNancommented, Sep 5, 2017

@kot331107 ofc! 😃

1reaction
JohNancommented, Jul 27, 2017

@kot331107 No problems. I also think this library would benefit from using a builder pattern instead of this growing constructor. I might have a look at that as well if I get some time over 😃 Thanks for a great lib.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Find your app IDs & ad unit IDs - Google AdMob Help
The app ID is used to identify your apps. An ad unit ID is a unique ID number assigned to each of your...
Read more >
Get started with the AdMob API - Google Developers
Follow the steps to configure a Google API Console project. · Open the Credentials page in the API Console. · Click CREATE CREDENTIALS...
Read more >
Admob ads not loading - Failed to load ad: 0 - Stack Overflow
Your ad id is newly created so it will take some time to fetch ads from google servers. You can verify this by...
Read more >
AdMob Integration - Prebid Documentation
Otherwise, it will fail with “no ad” immediately and the next ad source will instantiate the same adapter but for another set of...
Read more >
Adding AdMob ads to a Flutter app - Google Codelabs
1. Introduction · 2. Set up your Flutter development environment · 3. Set up the AdMob app and ad units · 4. Add...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found