SDK

Unity 3.2.0-amazon.alpha

Unity 3.2.0-amazon.alpha

This release adds pre-release support for Amazon store. It's based off 3.2.0 since that's the latest version compatible with Unity IAP 4.1.2. Unity IAP hasn't been updated to BillingClient 4, and the latest purchases-unity version compatible with BillingClient 3 is 3.2.0


In order to be able to use this release you need an Amazon specific public key. You need to have access to the private beta of the platforms UI. Contact RevenueCat support if you want to have access.


Instructions



  • Download the .unitypackage in the release




  • Open your Unity Project




  • Select Import package -> Custom package
    Screen Shot 2021-11-24 at 3 55 50 PM




  • Select Purchases_Amazon.unityPackage and make sure all of the files are selected and press import



Screen Shot 2021-11-24 at 3 56 10 PM

  • If Package Manager Resolver asks to solve conflicts, choose library versions and select OK




  • If your app also targets the Google Play Store, you will want to conditionally exclude the BillingClient to prevent duplicated classes. If you don't have a mainTemplate.gradle, make sure you have Custom Main Gradle Template selected in the Android Player Settings, which should create a mainTemplate.gradle inside the Assets/Plugins/Android. Add the following to your mainTemplate.gradle to prevent duplicated classes when Unity IAP is targeting the Play Store:



dependencies {
...

// ** ADD THIS **
if (!project(":unityLibrary").fileTree(dir: 'libs', include: ['billing-3*.aar']).isEmpty()) {
configurations.all {
exclude group: 'com.android.billingclient', module: 'billing'
}
}
}


  • Perform a Resolve using the editor option Assets/External Dependency Manager/Android Resolver/Resolve menu. This will add the right dependencies to the mainTemplate.gradle.




  • In observer mode, adding the Amazon in-app-purchasing library is not necessary since it will be added by Unity IAP when targeting the Amazon Store




  • Select Use Amazon in the Editor



Screen Shot 2021-11-24 at 3 57 01 PM

If calling setup on runtime, you can select “Use Runtime Setup” and call setup this way.


       var builder = PurchasesConfiguration.Builder.Init("amazon_specific_api_key")
.SetUseAmazon(true);
purchases.Setup(builder.Build());

Due to some limitations, RevenueCat will only validate purchases made in production or in Live App Testing and won't validate purchases made with the Amazon App Tester. You can read more about the different testing environments in our Amazon (Beta) docs.


To view new release, visit https://github.com/RevenueCat/purchases-unity/releases/tag/3.2.0-amazon.alpha