nabrozidhs / unity_admob_android

Basic Unity3D plugin for AdMob Google Play Services version.
MIT License
25 stars 12 forks source link

Exit Ad event? #15

Closed timmy2702 closed 10 years ago

timmy2702 commented 10 years ago

Hi,

Is there a way to check the event when user exit the ad (interstitial) since I want to show an interstitial before application close? I just only see two options: HandleAdLoaded and HandleInterstitialLoaded in your script, but there is no HandleInterstitialExit or something like that. Please check it out or make it if you can.

Thanks!

P/S: also some other events like HandleAdClicked, HandleInterstitialClicked, or event to check fill rate and Admob mediation. Thanks for advances though :)

nabrozidhs commented 10 years ago

These are the callbacks provided by AdMob.

Seems like onAdClosed() and onAdLeftApplication() might do what you need. I'll see if I can implement all the events this weekend (I'm up for pull request though ;) )

timmy2702 commented 10 years ago

Well, I hope it will come up soon. Thanks btw!

nabrozidhs commented 10 years ago

@timmy2702 just pushed the changes.

Let me know if you have any issues.

timmy2702 commented 10 years ago

@nabrozidhs I tried to quit application after interstitialclosed by this code:

if (Input.GetKeyDown(KeyCode.Escape)){ admob.ShowInterstitial(); ExitApplication(); }

private void ExitApplication(){ AdmobPlugin.InterstitialClosed += () => { Application.Quit(); }; }

The app does wait for me to close the interstitial. However, the thing is that my application does not exactly "quit" after I closed the interstitial. It does close the app and return to the home screen, but when I try to relogin the app, it just shows a blank screen. I have to manually close the app on "recent app" button and then it works! I think my code is right. Please check it out for me!!

P/S: I'm just gonna use my old code for now. I made before to do the Exit Ad (I used Coroutine for that), but I do appreciate your work! Maybe you should do a demo for exit ad or sth!

Thanks for your efforts anw!