Easy Amazon Ads for Unity
Update: Since writing this I went through the process of submitting my implementation to the Unity Asset Store. Unfortunately, it was rejected due to internal business reasons at Unity HQ. Because of this, I released it on this website. Download it here.
Some weeks ago I wrote about an Amazon plugin I was working on because I couldn’t get AdMob to run reliably on my Kindle Fire HD.
After getting it up and running, I released Transmutation using it, and then forgot about it while I worked on Chocolate Crunch Bonanza.
A few days ago it was suggested that I turn it into a Unity plugin for the asset store… and that’s what I’ve done.
I went back and rewrote class so it could be distributed stand-alone. I created a nice demo scene, and I’ve also added a documentation page to my blog.
The only outstanding issue is that ad clicks are still passing through to Unity, which is a problem with Amazon’s expandable full-screen ads. I think the only real solution is to extend the UnityPlayerActivity, but I decided against doing that because it would make my plugin incompatible with other plugins that are also trying to extend the activity – I’ve regularly seen this issue discussed in the Unity forums. Instead, I’ve provided a simple workaround that lets the developer disable app input when an ad becomes fullscreen. I’m using this solution in both Transmutation and Chocolate Crunch Bonanza, and it works well.
I submitted the plugin to the asset store a few hours ago, but it’s going to be a few days before I find out whether it’s been accepted.
While rewriting the ad handling classes, I’ve also found a typo that could explain why AdMob was locking up on my Kindle Fire HD the second time the app was run, yet it would work fine on my Android tabs… well, it’s more of a plausible explanation, assuming that Amazon’s implementation of Android isn’t as robust as Google’s. I’ll investigate further when I have a minute to spare…