Search code examples
androidunity-game-engineamazon-appstorerevmob

Revmob Unity3D SDK for Amazon


I've just published my Android game to the play store here. Now I want to publish the same app to Amazon. I've used Revmob ad network in that. Now I want to publish it on Amazon too. I can see that Amazon is supported in Revmob Android SDK, we just need to change the App-ID. Revmob documentation however, doesn't give any clue on how to do the same thing in their Unity SDK?

I am currently using it this way -

private static readonly Dictionary<String, String> REVMOB_APP_IDS = new Dictionary<String, String>() {
#if UNITY_AMAZON
        {"Android","AMAZON_ID"},
#else
        { "Android", "ANDROID_ID"},
#endif
        { "IOS", "IOS_ID" }
};

Is it the correct way? Or should I use "Amazon" as key for amazon ID instead?

Have anyone else used Revmob for their Amazon games?


Solution

  • You need to use "Android" as the key with Amazon_ID as the value.

    If I'm not mistaking, #if UNITY_AMAZON does not exist. The way I'm doing it is quite simple. I'm building two different apks. One for google and one for amazon. In my script I have a bool isAmazon. When I'm building for google I set it to false, and if I'm building for Amazon I set it to true.

        public bool IsAmazon;
    #if (UNITY_IPHONE || UNITY_ANDROID) && !UNITY_EDITOR
        private static Dictionary<string,string> REVMOB_APP_IDS = new Dictionary<string, string> ();
    
        private RevMobBanner _banner;
    
        private RevMob revmob;
    
        private void Awake ()
        {
            if (IsAmazon)
                REVMOB_APP_IDS.Add ("Android", "YOUR_AMAZON_ID");
            else
                REVMOB_APP_IDS.Add ("Android", "YOUR_ANDROID_ID");
    
            REVMOB_APP_IDS.Add ("IOS", "YOUR_IOS_ID");
            revmob = RevMob.Start (REVMOB_APP_IDS, gameObject.name);
            revmob.SetTestingMode (RevMob.Test.WITH_ADS);
        }
    #endif