Rewarded Ads Custom Events getting initialize() call.

408 views
Skip to first unread message

Steven Anderson

unread,
Dec 13, 2019, 6:43:43 PM12/13/19
to Google Mobile Ads SDK Developers
Hi

I am following the instructions here:
https://developers.google.com/admob/android/rewarded-ads-custom-events
to create a rewarded custom adapter.

I have setup my dashboard to use the new custom event adapter and I have my adapter setup by extending Adapter and Implementing MediationRewardedAds.

public class RewardedCustomEvent extends Adapter implements MediationRewardedAd

I do not see any calls going into

public void initialize(Context context,
 
final InitializationCompleteCallback initializationCompleteCallback,
 
List<MediationConfiguration> mediationConfigurations)
when I initialize.

I do see calls into 
public void loadRewardedAd(MediationRewardedAdConfiguration adConfiguration, final MediationAdLoadCallback<MediationRewardedAd, MediationRewardedAdCallback> mediationAdLoadCallback)
when I try to load an ad.

Are there debug logs I can turn on to help debug why I am not getting the initialize call?  Do you have any sample apps that use the new Rewarded Custom Event API?

Thanks'
Steve

Mobile Ads SDK Forum Advisor Prod

unread,
Dec 16, 2019, 2:54:38 AM12/16/19
to sand...@jungroup.com, google-adm...@googlegroups.com
Hi Steven,

Thank you for reaching out to us.

You may want to check this link for the implementation of the Rewarded ads custom event. In addition, we do have a working sample mobile android mediation app that you may use.

Please let me know how it goes and if you encounter any issues.

Regards,
Teejay Pimentel
Mobile Ads SDK Team

ref:_00D1U1174p._5001UOEYVd:ref

Steven Anderson

unread,
Dec 17, 2019, 10:34:47 AM12/17/19
to Google Mobile Ads SDK Developers
Hi, 

The code samples do not match the instructions on the page:
https://developers.google.com/admob/android/rewarded-ads-custom-events

The example you provided implements MediationRewardedVideoAdAdapter whereas the instructions on the Rewarded Ad Custom Event page instruct to  extend Adapter and implement MediationRewardedAd. 


Do you have any working examples that use the API as instructed on the page?

Thanks
Steve

Mobile Ads SDK Forum Advisor Prod

unread,
Dec 18, 2019, 1:54:31 AM12/18/19
to sand...@jungroup.com, google-adm...@googlegroups.com
Hi Steven,

Thank you for getting back to us. As per checking the sample I've provided, it is indeed implementing MediationRewardedVideoAdAdapter whereas the instructions on the Rewarded Ad Custom Event page instructs to  extend Adapter and implement MediationRewardedAd. 

I'm afraid there is no sample project that implements Rewarded Ad Custom Event. Let me submit a feature request regarding this. I'll get back to you the soonest they provide their feedback. In the meantime, you may want to check our FAN mediation adapter as it is the same implementation with our Rewarded Ad Custom Event guide.

Steven Anderson

unread,
Dec 18, 2019, 8:43:02 AM12/18/19
to Google Mobile Ads SDK Developers
Hi Teejay,

The provided example does not match the documentation.  It does not extend the Adapter class.  

As a custom event adapter we don't control our construction.  
The documentation says to extend the Adapter class and initialize on the initialize method.  This method contains the context and configuration needed to initialize the sdk.


I am not seeing the initialize method being called in my adapter.

E/Ads: Google Mobile Ads SDK initialization functionality unavailable for this session. Ad requests can be made at any time.

What else should I try?  Are there debug logs I can turn on to help debug this?

Thanks 
Steve

Mobile Ads SDK Forum Advisor Prod

unread,
Dec 19, 2019, 1:30:43 AM12/19/19
to sand...@jungroup.com, google-adm...@googlegroups.com
Hi Steven,

Apologies on the confusion from my previous post, and kindly allow me to clarify on what I meant with regard to using the FAN mediation adapter as a starting point for implementing your own Adapter class.

Starting from the link I gave on the previous post: you may use this sample script to learn about implementing the MediationRewardedAd interface.

After checking out the above, you may then check out the related FacebookAdapter class to learn about extending the Adapter class. More specifically, the FacebookAdapter class inherits from the following hierarchy:
- FacebookAdapter extends FacebookMediationAdapter
- FacebookMediationAdapter extends RtbAdapter
- RtbAdapter extends Adapter

You may refer to the above documents to check out the chain of inherited adapter classes used by the FacebookAdapter class, in order to help with your implementation of your own adapter class (I would recommend extending from the Adapter class).

Please let me know if you have further clarification.

Steven Anderson

unread,
Dec 19, 2019, 11:21:41 AM12/19/19
to Google Mobile Ads SDK Developers

Hi TeeJay, 

I have setup my adapter as described but I am not getting the call into it to initialize.  Instead I see the following in the logs:

E/Ads: Google Mobile Ads SDK initialization functionality unavailable for this session. Ad requests can be made at any time.

Is there something else I should try?

Thanks
Steve

Mobile Ads SDK Forum Advisor Prod

unread,
Dec 20, 2019, 12:37:30 AM12/20/19
to sand...@jungroup.com, google-adm...@googlegroups.com
Hi Steven,

Are you using the latest version of the SDK? Could you please update your AndroidManifest and follow our Initialize Mobile Ads SDK guide?

Steven Anderson

unread,
Jan 24, 2020, 2:30:10 PM1/24/20
to Google Mobile Ads SDK Developers
Hi Teejay, 

Everything is up to date with the latest.  I created a sample app and will send it to you.
The adapter does not get the initialize call, only the call to loadRewardedAd.  

Please advise on what to try next. 

Thanks
Steve

임종수

unread,
Feb 6, 2020, 7:46:53 PM2/6/20
to google-adm...@googlegroups.com
Hi, Admob Team.

I have a same issues on Android and iOS.


I set the breakpoint in the initialize method, called MobileAds.initialize (Context, OnInitializationCompleteListener), or made a load request using the Mediation Test Suite, but the initialize function of the Custom Event Adapter was not called.

And what's interesting is that when implemented using the Old API, Android worked well in the Mediation Test Suite, and iOS didn't. you can see below screen shot.

MediationRewardedVideoAd is implemented using the Old API, BuzzAdBenefitAdapter is implemented using the New API.

+ Mediation Test Suite display the following log: 'Adapter class not a mediation adapter: com.google.ads.mediation.buzzad.BuzzAdBenefitAdapter', when I try to load ad.

스크린샷 2020-02-07 오전 9.40.00.png


Please help me..

Thanks
JD

Version Info
Android
- play-services-ads : 18.3.0
- mediation-test-suite : 1.2.2
iOS
- GoogleMobileAdsSdk : 7.53.1
- GoogleMobileAdsMediationTestSuite : 1.1.1

Mobile Ads SDK Forum Advisor Prod

unread,
Feb 6, 2020, 10:07:00 PM2/6/20
to jong...@gmail.com, google-adm...@googlegroups.com
Hi JD,

Could you share a sample project (or at least a test project, you may use our iOS and android sample app for this) to us via Reply privately to author option, so we could check it on our end as well? You may upload the project file into your Google Drive and provide to us the shareable link instead.


Regards,
Teejay Pimentel
Mobile Ads SDK Team

ref:_00D1U1174p._5001UV07yP:ref

Mobile Ads SDK Forum Advisor Prod

unread,
Feb 7, 2020, 3:56:42 AM2/7/20
to jong...@gmail.com, google-adm...@googlegroups.com
Hi JD,

Thank you for providing the details privately.

I tried to implement the Custom native ads on our sample app for iOS and Android, and I also getting an Adapter error on Mediation Suite. With this, let me raise this to the team to get their insight as well. I'll get back to you as soon as they provide their feedback.

Mobile Ads SDK Forum Advisor Prod

unread,
Feb 7, 2020, 5:19:43 AM2/7/20
to jong...@gmail.com, google-adm...@googlegroups.com
Hi JD,

I've already raised this to the rest of the team. I'll get back to you once they provide their insight regarding this.

임종수

unread,
Feb 13, 2020, 9:36:54 PM2/13/20
to Google Mobile Ads SDK Developers
Hi AdMob team,

I wonder if there's any update.
Can you share the status?

Best regards,
JD

Mobile Ads SDK Forum Advisor Prod

unread,
Feb 13, 2020, 11:06:34 PM2/13/20
to jong...@gmail.com, google-adm...@googlegroups.com
Hi JD,

I'll make a follow up to the team and get back to you the soonest I have an update.

Steven Anderson

unread,
Feb 21, 2020, 10:47:38 AM2/21/20
to Google Mobile Ads SDK Developers
Hi Teejay, 

Do you have a follow up on this issue?

Thanks
Steve

Mobile Ads SDK Forum Advisor Prod

unread,
Feb 21, 2020, 2:30:25 PM2/21/20
to sand...@jungroup.com, google-adm...@googlegroups.com
Hello Steven,

Our engineering team is actively investigating the issue and we will provide you the updates via this thread if we have anything to share.

Regards,
Deepika Uragayala

임종수

unread,
Mar 10, 2020, 6:44:45 AM3/10/20
to Google Mobile Ads SDK Developers
Hi, AdMob team.

Do you have any updates? 
The company's business plan had been delayed due to this issue. 
Could you tell me the approximate schedule?

Best regards,
JD

Mobile Ads SDK Forum Advisor Prod

unread,
Mar 10, 2020, 1:49:25 PM3/10/20
to jong...@gmail.com, google-adm...@googlegroups.com
Hello there,

Our colleague Teejay has provided an update on this thread and looks like there it didn't show up on this thread. Here is the update on this case:

It turns out that custom events do not support the initialize method in mediation. Since the new rewarded API is now calling loadRewardedAd at load ad time, initialization isn't strictly required anymore (compared to the old rewarded API). With this in mind, you may initialize the adapter within the loadAd method instead.

Let us know if you have any questions. 


Regards,
Deepika Uragayala
Mobile Ads SDK Team
 

ref:_00D1U1174p._5001UXUeTz:ref

임종수

unread,
Mar 12, 2020, 4:30:15 AM3/12/20
to Google Mobile Ads SDK Developers
Hi, Admob team. 

Thank you for your answer. But I don't think initialization is the only problem here. We are still experiencing the same issue and we would really need your help on what the exact problem is. 

The problem is that Custom Event does NOT work correctly regardless of Initialization. Below is the more detailed description of what we did.

1) Using the Mediation test suite, we were able to observe load() → loadRewardedAd() is being called. But even when we return onSuccess as the callback of loadRewardedAd(), Mediation Test Suite shows the message saying 'No Fill' and 'Your ad source may not be set up correctly'. As we debug this issue, we found out that our adapter's initialize() is not being called and this was why we originally thought that this issue is related to Custom Event being not initialized. 

2) The above mentioned situation is still happening even when we initialize our SDK inside loadRewardedAd(). We even tried to return onSuccess for all possible callbacks but the result was the same. We also tested using the sample app thinking that this problem only resided within Mediation Test Suite, but no luck.

To sum up, we believe that the problem is that AdMob SDK not properly realizing Custom Event and we would really like the answer to this. Initialization not being called was just our first guess of many potential cause to this problem. But as we still experience the same issue even after following your guide, it would be really appreciated to let us know how we can properly operate the Custom Event. 

Thanks,
JD.

Mobile Ads SDK Forum Advisor Prod

unread,
Mar 12, 2020, 7:11:59 AM3/12/20
to jong...@gmail.com, google-adm...@googlegroups.com
Hi JD,

Thank you for the extensive rundown of your concern. Let me raise this to the rest of the team to get their insight. I'll get back to you the soonest they provide their feedback.

Regards,
Teejay Pimentel

임종수

unread,
Mar 18, 2020, 2:37:16 AM3/18/20
to Google Mobile Ads SDK Developers
Hi, Admob team

I’m back again. :'-(

Do you have any update?

thanks,
JD

Mobile Ads SDK Forum Advisor Prod

unread,
Mar 18, 2020, 5:14:04 AM3/18/20
to jong...@gmail.com, google-adm...@googlegroups.com
Hi JD,

Apologies for the delay and to the convenience that it may cause to you. Let me follow up the team once more regarding this. I'll update you the soonest they provide their feedback.

Mobile Ads SDK Forum Advisor Prod

unread,
Mar 27, 2020, 1:21:30 AM3/27/20
to jong...@gmail.com, google-adm...@googlegroups.com

Hi JD,

 

Thank you for your patience on this issue.

 

Could you kindly check the attached sample project? You may verify that it can go through a custom event that does get the load call and responds to it. It will also get the show call, and all of these are documented with logs. Kindly confirm if it can provide some assistance for your concerns.

 

Regards,

Ziv Yves Sanchez

RewardedVideoExample_zip.html

임종수

unread,
Mar 30, 2020, 9:51:32 AM3/30/20
to Google Mobile Ads SDK Developers
Hi Admob Team.

Thank you for your help. I've checked that the sample app you attached is working alright. 

However, I still get the same result when testing with my Adapter (which is modified to have similar code to SampleCustomEvent you provided). I believe that your sample app works fine only because of the difference in testing environment. The followings are what I did to match the testing environment between the sample app you attached and my adapter. 

1. Integrating Mediation Test Suite

I've been testing my adapter using Mediation Test Suite with similar code that you provided in the SampleCustomEvent, but it has not been working properly. In order to see the exact difference between SampleCustomEvent you provided and my adapter, I first tried to add the SampleCustomEvent to Mediation Test Suite to match the testing environment. 

However, I was not able to observe the SampleCustomEvent you provided on Mediation Test Suite.

Because
- When Mediation Test Suite is being executed, all class registered as custom event should leave logs in logcat. But SampleCustomEvent class you provided doesn't leave any log.
- Usually unregistered classes leave logs like "D/gma_test: com.google.ads.mediation.unity.UnityAdapter class NOT detected." and registered ones like "I/gma_test: com.buzzvil.buzzad.benefit.adapter.admob.rewardedvideo.BuzzAdRewardedVideoAdapter class detected." But SampleCustomEvent doesn't leave either.
- Mediation Test Suite doesn't show the Unit id (`ca-app-pub-3940256099942544/6223236111` from the Sample App you provided) in the list.

Due to the above reason, I concluded that it is not possible to match the exact same testing environment using Mediation Test Suite. 

Next step is to test my Adapter in the same sample app you provided. 

2. Integrating Mobile Ads RewardedVideo

Your Sample App always gives chance to Mediation to show ads as if it doesn't have Admob ad source.  So I was able to observe that load and show request always passes to Adapter. 

My Adapter also gets load request, but I was not able to see if show request comes in alright, as Admob's test ad always gets the first chance. 

The problem existed even before I left a comment in the thread. Since I had no way to know if show request has passed to my Adapter correctly, I was not sure if my Adapter was developed in a right way. This was one of the reason that I've been testing using Mediation Test Suite (even though it did not show the result I wanted at all). 

In short, I am still NOT convinced that AdMob Mediation works fine with any custom event, as the testing environment that you provided is different than mine. The only way to solve the problem is to match the exact same testing environment and run the test for both SampleCustomEvent and my Adapter. 

I would like to know the following to test SampleCustomEvent under the same circumstance:

1. Please let me know the detailed unit setting for the Sample App unit id (`ca-app-pub-3940256099942544/6223236111`), including mediation setting for the unit and how you registered SampleCustomEvent to the unit. Or any other AdMob admin setting that might cause the difference. 
2. Please let me know if there is a way to DISABLE AdMob Test Ad from my AdMob unit to make sure my Adapter gets the show request in the sample app. 

I really appreciate your help in this matter. 

If possible, having a short call would help a lot expedite the whole process. 

Thanks.
JD.

Mobile Ads SDK Forum Advisor Prod

unread,
Mar 30, 2020, 3:54:52 PM3/30/20
to jong...@gmail.com, google-adm...@googlegroups.com
Hi JD,

Thank you for getting back to us and bringing up your sharpened concerns in this ongoing dialogue. Could you show us via "reply directly to author" a sample of your updated implementation of your adaptors?

Regards,
Aryeh Baker

ref:_00D1U1174p._5001UXUeTz:ref

CL Ho

unread,
Nov 3, 2020, 3:15:20 AM11/3/20
to Google Mobile Ads SDK Developers
Hello,

I would like to re-activate this thread since I am having the same problem and there's no solution (yet?)

I am implementing my own Rewarded Ads custom event adapter and I am facing the same issue - my adapter won't get initialized, it goes directly to loadRewardedAd. I need the context object from initialize() in order to initialize my custom rewarded ad.

I have tried the RewardedVideoExample app but it's the same - initialized() is not called.

Any suggestions?

Thanks
CL

Mobile Ads SDK Forum Advisor Prod

unread,
Nov 3, 2020, 9:32:04 AM11/3/20
to clho....@gmail.com, google-adm...@googlegroups.com
Hi there,

Custom events do not support the initialize() method in mediation. The new rewarded API calls loadRewardedAd() ad load ad time, so initialization isn't strictly required. The recommended time to initialize your custom event is within the loadAd() method. 

Could you elaborate on your need for the context object from initialize to initialize your custom Rewarded ad?

Regards,

Google Logo
Aryeh Baker
Mobile Ads SDK Team
 
 
 

ref:_00D1U1174p._5001UXUeTz:ref

CL Ho

unread,
Nov 3, 2020, 10:26:52 AM11/3/20
to Google Mobile Ads SDK Developers
Hello there,

Thank you so much for your reply. I need the context (actually the activity) object to initialize my custom rewarded ad because the rewarded ad was implemented in a similar way as AdMob's rewarded ad - need an activity in the constructor. I am referring to Huawei Ads here https://developer.huawei.com/consumer/en/doc/HMSCore-Guides-V5/publisher-service-reward-0000001050066917-V5

If that's the case, do you have any idea how can I do so?

P/s: if initialize() is not supported anymore, perhaps you guys should update the documentation to avoid confusion? I've actually spent a lot of time trying to get that working

Thanks
CL

Mobile Ads SDK Forum Advisor Prod

unread,
Nov 3, 2020, 1:05:49 PM11/3/20
to clho....@gmail.com, google-adm...@googlegroups.com
Hi there,

Regarding getting the context of the activity for your specific use case is there anything stopping you from using conventional Android techniques to access the context you need?

Regarding our documentation, I commented out the initialization of the Mobile Ads SDK in the RewardedVideoSample and the SampleCustomEvent still ran. This is because initialize is called when necessary. While it's not necessary to explicitly initialize the Mobile Ads SDK it's still recommended that initialize happen as early as possible so that mediation partners have as much time as possible to register themselves and be ready for ad calls. 

CL Ho

unread,
Nov 4, 2020, 11:53:19 AM11/4/20
to Google Mobile Ads SDK Developers

Hello,

Thanks for the super detailed explanation. 

Regarding getting the context of the activity for your specific use case is there anything stopping you from using conventional Android techniques to access the context you need? 
>> I believe yes.  Similar to requestBannerAd, requestInterstitialAd and requestNativeAd, I need the context/activity returned from these callbacks to initialize my ad. Since I do not extend AppCompatActivity (and I believe I shouldn't extend it) in the Event Forwarder class, I can't get the activity.

My dirty workaround is:

In the forwarder.load() function, call "this.rewardedAdCallback = mediationAdLoadCallBack.onSuccess(this)" since I can't load the ads here without context

In the override fun showAd(context: Context?), load the ad since I get the context and show the ads when its loaded

I don't know if this make sense? I am very happy to learn if there's any way I can optimize this

Mobile Ads SDK Forum Advisor Prod

unread,
Nov 4, 2020, 3:57:30 PM11/4/20
to clho....@gmail.com, google-adm...@googlegroups.com
Hi CL Ho,

Thank you for bringing this to our attention. I work along with Aryeh and will be assisting you today with this issue. Based on what I have read, I was wondering if you have looked over some of the items here .  You cna also check out this section that talks more about the banner ads.

Regards,
Google Logo
William Pescherine
Mobile Ads SDK Team
 


ref:_00D1U1174p._5001UXUeTz:ref

CL Ho

unread,
Nov 9, 2020, 5:35:32 AM11/9/20
to Google Mobile Ads SDK Developers
Hello William,

Yes I've looked over all the items in the link you've provided and that's why I was really confused. Please refer to my attached screenshot.


initialize() is not called, and according to the previous reply from your colleague, it will not get called, contradicting the statement "Custom events should perform any required initialization or set up for the third-party ads SDK within this method".

So how do we initialize our SDK as demonstrated?

Thanks
CL

Mobile Ads SDK Forum Advisor Prod

unread,
Nov 9, 2020, 11:40:22 AM11/9/20
to clho....@gmail.com, google-adm...@googlegroups.com
Hi CL Ho,

Thank you for bringing the response back. I have been looking back over all the documents that you have sent, as well as our documents.So a few things to comment on. One, our new Rewarded Ads API does not seem to require the initialization anymore. But the issue as I am sure you will see is that in the Rewarded Custom Events you see that their is an initialization, with the context. But on our end it would look like getting the activity context is done. I looked at the Hauwei code and it is basically the same as ours. Have you also tried to contact the Hauwei to see if they have any work around for their solution.

So just to clarify, the issue really is the fact that their is no initialization in the API but you need the initialization for the custom events. Which does not seem to match up. And that they are really not grabbing the Activity context.

Also here is an article I found regarding how to get activity context.
Reply all
Reply to author
Forward
0 new messages