I’ve prepared my Amazon app to use RevenueCat for my app subscription and run into the following issue. (Details on the steps I’ve done are show below the description of the issue I am having)
When trying to retrieve the offering in my app on an Kindle Fire Tablet, using
Purchases.getSharedInstance().purchasePackage(SettingsSubscription.this,packageOffer1, new MakePurchaseListener() { @Override public void onCompleted(@NonNull Purchase purchase, @NonNull PurchaserInfo purchaserInfo) {
}
@Override public void onError(@NonNull PurchasesError error, boolean userCancelled) { // No purchase }});
I receive the following error in the onError method.
ERROR: Error fetching offerings - PurchasesError(code=PurchaseNotAllowedError, underlyingErrorMessage=Billing is not available in this device. DebugMessage: Billing service unavailable on device.. ErrorCode: BILLING_UNAVAILABLE., message='The device or user is not allowed to make the purchase.')
However, when testing using my old Amazon IAP SDK, the testing of IAP subscription items works fine.
I’ve done the following items to prepare my Amazon app to use RevenueCat
- Added the following the the Gradle file
implementation 'com.revenuecat.purchases:purchases:4.3.1'implementation 'com.revenuecat.purchases:purchases:5.0.0-amazon.alpha.3'implementation 'com.revenuecat.purchases:purchases-store-amazon:5.0.0-amazon.alpha.3'
- I’ve also added an Amazon section to my App Project and added the Amazon Secret and package name. Also added the subscription item and added it to the current offering.
- I have installed the Amazon Tester App (latest version) and copied the Subscription JSON file from the Amazon Store to the Kindle Tablet and the subscription info does show on the Amazon Tester App.
- Does the following code need to be in the app Manifest file. It was needed when using the Amazon IAP directly, so I’ve left it.
<receiver android:name = "com.amazon.device.iap.ResponseReceiver" android:permission = "com.amazon.inapp.purchasing.Permission.NOTIFY" android:exported = "true"> <intent-filter> <action android:name = "com.amazon.inapp.purchasing.NOTIFY" /> </intent-filter></receiver>
Some possible issues.
- My app compileSDK and targetSDK is 31 (What SDK has RevenueCat tested with)
- I am using the in-app-purchasing-2.0.76.jar. However there is a new Amazon SDK jar file that Amazon is transitioning to. I think there are some changes to the SANDBOX mode.
https://developer.amazon.com/docs/in-app-purchasing/transitioning-to-appstore-sdk.html
- I haven’t specifically run ADB to put the tablet in Sandbox mode, but since it is running a debug version of my app, it should already be in sandbox mode. This in confirmed when I check the ‘PurchasingService.IS_SANDBOX_MODE’ variable.