Ios:tutorial To Add Admob Custom Reward Video To Buildbox Games

Discussion in 'How Can I...?' started by TheGameAppStudio, Feb 14, 2019.

  1. TheGameAppStudio

    TheGameAppStudio Serious Boxer

    Joined:
    Nov 2, 2016
    Messages:
    838
    Likes Received:
    257
    Hello,
    Anyone who still struggles to add custom reward video ads to your buildbox games here is the tutorial.
    I have attached a zip file AdIntegrator.mm .Download and extract the file and replace your AdIntegrator.mm with this code.

    Make sure to change ad unit id's under
    - (void)initAds{
    - (void)rewardBasedVideoAdDidClose:

    Note : This code works for the game mode where a checkpoint is set.So make sure you have added check point and a second chance button which navigates back to last checkpoint after watching the reward video.
     

    Attached Files:

    Vikas, lee.huu, weboha and 1 other person like this.
  2. Josh (Nology Games)

    Josh (Nology Games) Community Manager Staff Member

    Joined:
    Nov 27, 2017
    Messages:
    670
    Likes Received:
    216
    TheGameAppStudio likes this.
  3. Tars Tarkas

    Tars Tarkas Avid Boxer

    Joined:
    Jul 17, 2018
    Messages:
    242
    Likes Received:
    173
    Very nice. Does it work only with last checkpoint? Nothing else? I want next checkpoint, the ability to skip a level.
     
  4. TheGameAppStudio

    TheGameAppStudio Serious Boxer

    Joined:
    Nov 2, 2016
    Messages:
    838
    Likes Received:
    257
    Thank you :) As of now i have tested with last check point alone.Never made a game that has an ability to skip level.So i don't know.There would be a way around :)
     
  5. Tars Tarkas

    Tars Tarkas Avid Boxer

    Joined:
    Jul 17, 2018
    Messages:
    242
    Likes Received:
    173
    It shows the ad (sometimes, not always) when I tap the button, but I never receive the reward. Weird.
    I used the test ads to be sure I get an ad.
     
  6. TheGameAppStudio

    TheGameAppStudio Serious Boxer

    Joined:
    Nov 2, 2016
    Messages:
    838
    Likes Received:
    257
    Hi,I didn't test with a reward points/coins but i resumes from last saved location (checkpoint)
     
    Vikas likes this.
  7. spicedbeangames

    spicedbeangames Miniboss Boxer

    Joined:
    Mar 31, 2016
    Messages:
    1,328
    Likes Received:
    558
    Thanks for the efforts, but we really need a proper video from the BB team. I really don't understand why this isn't a priority. Developers need to generate revenue.
     
    Forgive, Vikas and TheGameAppStudio like this.
  8. TheGameAppStudio

    TheGameAppStudio Serious Boxer

    Joined:
    Nov 2, 2016
    Messages:
    838
    Likes Received:
    257
    Hi,You are welcome and i agree.But sometimes we must remind them in such a way.Those who have knowledge could help one another where "Knowledge is for sharing and Sharing is Caring" :D .But some does that for few $$$.And yes i agree i haven't met success yet making games especially in iOS.But one day.... until then learn and share :p .
    Btw i will share tutorial for android too soon....
     
  9. lee.huu

    lee.huu Boxer

    Joined:
    Feb 28, 2019
    Messages:
    7
    Likes Received:
    2
    Thanks so much, it works perfect on iOS, but how about android? I don't see any function like rewardedVideoDidEnd in android.
    any help? thanks.
     
    Forgive and TheGameAppStudio like this.
  10. TheGameAppStudio

    TheGameAppStudio Serious Boxer

    Joined:
    Nov 2, 2016
    Messages:
    838
    Likes Received:
    257
    Hi,No mention.On Android there is a boolean value private static native boolean rewardedVideoDidEnd();

    Just add
    AdIntegrator.rewardedVideoDidEnd(); on AdClosed method.

    Follow this thread for Adding custom ads for android https://www.buildbox.com/forum/inde...b-interstitial-ads-with-custom-options.14365/
    And add above code on ads close method.
     
    lee.huu likes this.
  11. Appossible

    Appossible Avid Boxer

    Joined:
    Aug 14, 2017
    Messages:
    198
    Likes Received:
    56
    Hi, I guess that the file you shared is only working for rewarded ad, right? Is it also working for interstitial and banner?

    could you please share the two files when integrating admob's interstitial, banner, reward which are AdIntegrator.mm and AdIntegrator.h? Thank you
     
  12. TheGameAppStudio

    TheGameAppStudio Serious Boxer

    Joined:
    Nov 2, 2016
    Messages:
    838
    Likes Received:
    257
    For ios yes only reward.For banner and interstitial refer here https://www.buildbox.com/forum/inde...stitial-ads-heyzap-with-custom-options.14286/

    Make this change is code for reward ads add code in
    - (void)rewardBasedVideoAdDidClose:
    look for line PTAdController::shared()->rewardedVideoDidEnd();

    and put the above line inside below function
    - (void)rewardBasedVideoAd:(GADRewardBasedVideoAd *)rewardBasedVideoAd

    So that if an user stops reward ads they would be able to continue game without watching it completely using previous code location.
    But on adding inside the above method i.e
    - (void)rewardBasedVideoAd:(GADRewardBasedVideoAd *)rewardBasedVideoAd
    They would only be able to resume game on completion of the video ad.
     
  13. Appossible

    Appossible Avid Boxer

    Joined:
    Aug 14, 2017
    Messages:
    198
    Likes Received:
    56
    Thanks for the help, but you have shared the code for rewarded ads already in this thread.

    What I really need and am struggling with is the admob code for interstitial.

    I know there is a heyzap tutorial but since it's different from admob and I'm totally not a programmer (I guess most of boxers are not), we don't understand (at least for me) how to change it from the heyzap code to admob code. Maybe it's pretty easy for a programmer, but for a non-programmer, it's too hard.(I'm struggling with it for 2 days).
     
  14. TheGameAppStudio

    TheGameAppStudio Serious Boxer

    Joined:
    Nov 2, 2016
    Messages:
    838
    Likes Received:
    257
    Hi,I will try to make one and would let you know :) But custom interstitial ads and banner ads integration is complicated than reward video.
     
  15. Appossible

    Appossible Avid Boxer

    Joined:
    Aug 14, 2017
    Messages:
    198
    Likes Received:
    56
    Thank you so much man. Just don't bother with banner, I'm not going to integrate banner. Because Apple will probably not feature the game that has banner in it, Not sure, just heard it from another person.

    Btw you don't integrate interstitial with admob mediation for your game?
     
  16. Appossible

    Appossible Avid Boxer

    Joined:
    Aug 14, 2017
    Messages:
    198
    Likes Received:
    56
    Sir, have you managed to make these files? I'm still struggling with this, thanks in advance.
     
  17. spicedbeangames

    spicedbeangames Miniboss Boxer

    Joined:
    Mar 31, 2016
    Messages:
    1,328
    Likes Received:
    558
    Mr Jump World was just featured and that has banner ads.
     
  18. TheGameAppStudio

    TheGameAppStudio Serious Boxer

    Joined:
    Nov 2, 2016
    Messages:
    838
    Likes Received:
    257
    Hi,No i didn't get time today.Will try to do it on tomorrow.
    Btw most of the games featured has banner ads intrusive ads on each game over etc...so don't worry on not getting featured due to banner ads ;)
     
  19. lee.huu

    lee.huu Boxer

    Joined:
    Feb 28, 2019
    Messages:
    7
    Likes Received:
    2
    Hi Appossible, file aready share in this thread: https://www.buildbox.com/forum/inde...stitial-ads-heyzap-with-custom-options.14286/
    just copy paste and change your admob id, I tested and it work.
    In function interstitialDidDismissScreen you can re-init interstitial and resume game like this
    Code:
    /// Tells the delegate the interstitial had been animated off the screen.
    - (void)interstitialDidDismissScreen:(GADInterstitial *)ad {
        NSLog(@"interstitialDidDismissScreen");
        [self initInterstitialAdmob];
        PTAdController::shared()->rewardedVideoDidEnd();
    }
     
  20. Appossible

    Appossible Avid Boxer

    Joined:
    Aug 14, 2017
    Messages:
    198
    Likes Received:
    56
    I'm using IronSource now. It's so much easier. Thanks for your help anyway, guys, and thank buildbox team for ignoring this issue...
     

Share This Page