Closed gtoto007 closed 2 years ago
👀 SDKONCALL-92 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!
Hey @gtoto007, thanks for the super detailed issue.
I think there's a bit of a mixup with Amazon environments here:
Amazon has two testing environments with unfortunately similar names: Live App Testing and AppTester.
AppTester is the one that requires you to install an app to your phone, and what it does is essentially pipe all requests to Amazon store to that app. In order for this to work, you need to set up sandbox mode (like you mentioned), but you also need to set up your products in the AppTester app, through a JSON file. There are detailed instructions on how to do this here https://developer.amazon.com/docs/in-app-purchasing/iap-install-and-configure-app-tester.html. The good news is that when using this environment, you don't need to upload new versions of your app to Live App Testing. The bad news, however, is that this won't entirely work with RevenueCat, since the receipts from purchases made in this environment won't validate with Amazon's backend (the purchases actually only exist in the AppTester app).
Live App Testing is the one where you upload builds to the Amazon Developer Portal. In order to use this one, you need to not be using sandbox mode on your device. This will send all requests to the actual Amazon store (but you won't get charged if you're a registered tester running a test build). You need to upload new test builds and then download them to your device from the Amazon Store in order to use this environment.
I realize that this isn't a very convenient way to test, but sadly there doesn't seem to be much other way around it for Amazon.
Hi @aboedo
Sorry I have forgotten to specify but I have already added the file amazon.sdktester.json
in my device and it is read from Amazon App Tester. I have enabled the sandbox environment with command
adb shell setprop debug.amazon.sandboxmode debug
but the error is always showing.
You can see my configuration Amazon App Tester from my screenshots This is the content of amazon.sdktester.json
{
"com.smarttales.1yeartest":{
"smallIconUrl":"http://",
"title":"Subscriptions",
"itemType":"SUBSCRIPTION",
"price":100.0,
"description":"subscriptions",
"languageTitleMap":{
"US":"Subscriptions"
},
"languageDescriptionMap":{
"US":"subscriptions"
},
"currencyPriceMap":{
"US":0.0
},
"subscriptionParent":"com.smarttales.subscriptionstest",
"term":"Annually"
}
}
I also tried to load the apk on Live App Testing and disable sandbox mode but the result does not change
Thanks for the update! I think there's one step that we might be missing here.
For Live App Testing, embedding your app's pem file (instructions here): https://developer.amazon.com/es/docs/in-app-purchasing/appstore-sdk-troubleshooting.html
For AppTester, ensuring that the manifest file contains the receiver tags for Amazon: https://stackoverflow.com/a/71588959/5074358
If those work, I'll add them to the installation instructions.
Thanks for your patience on this!
Hi @aboedo, thank you for you support.
For Live App Testing, If I embedding the pem file in StreamingAssets It works.
For AppTester, I added the receiver tags for Amazon in androidManifest.xml but It isn't working. I shared my android manifest generated by Unity with receiver tags for Amazon:
<?xml version="1.0" encoding="utf-8"?>
<!-- GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity3d.player" xmlns:tools="http://schemas.android.com/tools">
<application>
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:theme="@style/UnityThemeSelector" android:screenOrientation="fullSensor" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density" android:hardwareAccelerated="false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="android.notch_support" android:value="true" />
</activity>
<receiver android:name="com.amazon.device.iap.ResponseReceiver" android:permission="com.amazon.inapp.purchasing.Permission.NOTIFY">
<intent-filter>
<action android:name="com.amazon.inapp.purchasing.NOTIFY" />
</intent-filter>
</receiver>
<meta-data android:name="unity.splash-mode" android:value="0" />
<meta-data android:name="unity.splash-enable" android:value="True" />
<meta-data android:name="notch.config" android:value="portrait|landscape" />
<meta-data android:name="unity.build-id" android:value="7ee2ce06-3995-4bfd-8af0-e4cf0d5cc13b" />
</application>
<uses-feature android:glEsVersion="0x00030000" />
<uses-feature android:name="android.hardware.vulkan.version" android:required="false" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
</manifest>
@gtoto007 🤔 not sure what's going on there, I'll take a look.
Note, however, that AppTester isn't really supported for RevenueCat - as I mentioned before, RevenueCat can't validate purchases made on AppTester, since they only exist on the AppTester app and can't be validated by the backend against Amazon's servers.
So if your app is working in Live App Testing, that's the most important part!
@aboedo This is current debug log with App Tester. Maybe It can help you to understand the error
08-11 21:37:33.857 15419 27139 I AmazonAppstore.AndroidKeystoreKeyProvider: Key already initialized in Keystore
08-11 21:37:33.857 15419 27139 I AmazonAppstore.DeviceInformation: Requesting device type from MAP
08-11 21:37:33.857 15419 27139 I AmazonAppstore.DeviceInformation: Requesting device type from MAP
08-11 21:37:33.857 15419 27139 I AmazonAppstore.MigrationHelper: Migration status - true
08-11 21:37:33.880 1746 2009 I chatty : uid=10064(com.amazon.firelauncher) umerClie.Worker expire 4 lines
08-11 21:37:33.880 1746 1746 I chatty : uid=10064(com.amazon.firelauncher) expire 64 lines
08-11 21:37:33.883 1746 2009 I chatty : uid=10064(com.amazon.firelauncher) umerClie.Worker expire 14 lines
08-11 21:37:33.920 1746 1746 I chatty : uid=10064(com.amazon.firelauncher) expire 21 lines
08-11 21:37:34.022 15419 27139 E AmazonAppstore.CheckSecurityAction: APK with package name [sha256: 4861f5ba6a96049ac7067c278361b7b6b46e7e232875e251ae14475b8ac872ee] has not been installed by Amazon
08-11 21:37:34.024 3446 3529 D Kiwi : CommandServiceClient: Blocking for result from service
08-11 21:37:34.025 3446 3529 D Kiwi : CommandServiceClient: Received result from service
08-11 21:37:34.025 3446 3529 D Kiwi : AbstractCommandTask: Received result from CommandService: CommandResult: [CallingUid: 10070, SuccessResult: null, FailureResult: com.amazon.d.a.h$a$a@50d4a61, DecisionResult: null, ExceptionResult: null]
08-11 21:37:34.025 3446 3529 D Kiwi : CommandResultVerifier: Verifying auth token: ozOjjONwbHmKWeAt1CKALWNf+Bqiq7OQdWJhbLhuJ/s4xpYSZvh1wX9+SqZw0fy7nP91dCrQ5rYuFlhm2B99iDtuLg7LhlW6kYcJSpQVmRTs1oygh0HLwsZ6GpQGwtZwHWnoXYvufhx/Ib3X4sRPPgib6H/Cmn+aU8lZ9NVHt+io+oFgwctU0L2E2DLu7i423GNtvLoSAXPwRbGICSfhLoxW5Afx5twzhVrfYvZt6Mxi97nTxAcYd//qa7DXURx+G3kkkCOUc0W4eZAnm4lH8bA2shSMIBjKB7RHi+bwt0zXlrd8H9uvUsV8RRSsLFhSkLwVU3Qp0zY6uS2aHeJd6g==
08-11 21:37:34.028 3446 3529 D Kiwi : DataAuthenticationKeyLoaderV3: Loading data authentication key...
08-11 21:37:34.028 3446 3529 D Kiwi : DataAuthenticationKeyLoaderV3: Checking KiwiDataStore for key...
08-11 21:37:34.028 3446 3529 D Kiwi : ExpirableValueDataStore: Fetching value: DATA_AUTHENTICATION_KEY
08-11 21:37:34.028 3446 3529 D Kiwi : DataAuthenticationKeyLoaderV3: Key was cached: true
08-11 21:37:34.028 3446 3529 D Kiwi : SignatureVerifier: Verifying signature of data: 'UMnMxqPqVAul56Dpcj4ektTiUO3TKzO1azQAubOpZIwqgw35kEAibdIj1k9oCIGSGI95DgpE2zIfSHd08RnOn3JSjlezhFaxfe86WTUyEfo+NRBQA1nnh+B1AH9S7fOaRc03anuJiJEOvvubCcKmrOVFJqVAq1C6xFflpF4/F6zCfC/3vu1pfEA/3KZDlgV+TDeA4h/0fNuhy3V573KsbAkX2NrRMIPWZIukKhr43FF2JY6iZfeqJVc4pCnqakNjypMYX7iuF3RoTDYzpnYrIvBYL4RPz0y2/iZuuYairAKOX3/Iz5nZGsNqVWpL6eolD6RAqVjixPmgU4ezM7lHrnpA4Qeo2d0osyfFZF9eX73RFPA3cJcPbCiLt8TOaQIJscROaDnEM8LDzOubKjLJijMUTtPTI6dJ3sHQ7Nc+DxvcN//8uJ7iwZtBP4RCrq8qqqInL1TOiGU73NXIEHPzLQeQd1DudbCSRMO7sWUwIVdCiRB/s5q+IiJ7iCXLT75Gm3rKAHtJ4/V3FsyW8PiXcCVCM8tO+Gs8nXanngQBgW7ZaVxbRyi+LfOEVQUAkaMYKWi/AqfNen0WmVokYxFsK3bqciy1UIZBRsUr6+qjnZrTKi2hVW3FTnnXxqPRZ1a/JsfrSZ5uNpFwtzLGfS7iN3044Vf0QOfGNkLVgepl3R4=', signature: 'ozOjjONwbHmKWeAt1CKALWNf+Bqiq7OQdWJhbLhuJ/s4xpYSZvh1wX9+SqZw0fy7nP91dCrQ5rYuFlhm2B99iDtuLg7LhlW6kYcJSpQVmRTs1oygh0HLwsZ6GpQGwtZwHWnoXYvufhx/Ib3X4sRPPgib6H/Cmn+aU8lZ9NVHt+io+oFgwctU0L2E2DLu7i423GNtvLoSAXPwRbGICSfhLoxW5Afx5twzhVrfYvZt6Mxi97nTxAcYd//qa7DXURx+G3kkkCOUc0W4eZAnm4lH8bA2shSMIBjKB7RHi+bwt0zXlrd8H9uvUsV8RRSsLFhSkLwVU3Qp0zY6uS2aHeJd6g==', with key: 'OpenSSLRSAPublicKey{modulus=e2861e68c541b8977605122eceba2ba09d949be5ae4930086497d98eff1ec50cfc9ced54c66628d8142438a1d8fd049605be738e119367a8ae6a27993df32bd04832acba04651842037f08cac97bf37f390e64be9d224152dfd9fc0f60e4cc13d0e387f17254f1f94b2a0804917b1be0f1faf08d17643bedaebb0ef2c3c36eaccaae93202df8e7ec80a2f79ae2816f506221debcf50f7a840ae09493c60f483c0caa65db5d30e7f14f6dfbf8521af8423e0daea7690cc5ad5ea2296a00429973907ea1936eb549361d21e3ae295e5b0b2464cb9c2fd86b8aaf02e43e5fe47b7048559fa48ea42bd9abbe3436ff5d0300f2d8cfac55910d60c0cad9b30216407b,publicExponent=10001}
08-11 21:37:34.030 3446 3529 D Kiwi : AbstractCommandTask: Command failed execution: Unauthorized Request
08-11 21:37:34.030 3446 3529 D Kiwi : KiwiCommand: onFailure: result = com.amazon.d.a.h$a$a@50d4a61
08-11 21:37:34.038 3446 3529 D Kiwi : Prompt: Creating Prompt: 1599448561
08-11 21:37:34.038 3446 3529 D Kiwi : SimplePrompt: created SimplePrompt with mode LEGACY
08-11 21:37:34.038 3446 3529 D Kiwi : PromptManagerImpl: Scheduling presentation: a
08-11 21:37:34.038 3446 3529 D Kiwi : ResourceManagerImpl: Populating: a
08-11 21:37:34.038 3446 3529 D Kiwi : RelativeExpirable: RelativeExpiration duration: 31536000, expirable: a
08-11 21:37:34.038 3446 3529 D Kiwi : RelativeExpirable: Expiration should occur at time: Fri Aug 11 21:37:34 GMT+02:00 2023
08-11 21:37:34.038 3446 3529 D Kiwi : TaskManagerImpl: Populating Task: Expire: a
08-11 21:37:34.039 3446 3529 D Kiwi : ResourceManagerImpl: Populating: Expire: a
08-11 21:37:34.039 3446 3529 D Kiwi : SimpleTaskPipeline: KIWI_BACKGROUND: Scheduling task: Expire: a, at time: Fri Aug 11 21:37:34 GMT+02:00 2023, System uptimeMillis: 1660246654039, uptimeMillis: 31576479108
08-11 21:37:34.039 3446 3529 D Kiwi : TaskManagerImpl: Enqueue task on pipeline id: FOREGROUND
08-11 21:37:34.039 3446 3529 D Kiwi : RelativeExpirable: RelativeExpiration duration: 31536000, expirable: a
08-11 21:37:34.039 3446 3529 D Kiwi : RelativeExpirable: Expiration should occur at time: Fri Aug 11 21:37:34 GMT+02:00 2023
08-11 21:37:34.039 3446 3529 D Kiwi : TaskManagerImpl: Populating Task: Prompt Presentation on Main Thread: a, Fri Aug 11 21:37:34 GMT+02:00 2023
08-11 21:37:34.039 3446 3529 D Kiwi : RelativeExpirable: RelativeExpiration duration: 31536000, expirable: a
08-11 21:37:34.039 3446 3529 D Kiwi : RelativeExpirable: Expiration should occur at time: Fri Aug 11 21:37:34 GMT+02:00 2023
08-11 21:37:34.039 3446 3529 D Kiwi : ResourceManagerImpl: Populating: Prompt Presentation on Main Thread: a, Fri Aug 11 21:37:34 GMT+02:00 2023
08-11 21:37:34.039 3446 3529 D Kiwi : RelativeExpirable: RelativeExpiration duration: 31536000, expirable: a
08-11 21:37:34.040 3446 3529 D Kiwi : RelativeExpirable: Expiration should occur at time: Fri Aug 11 21:37:34 GMT+02:00 2023
08-11 21:37:34.040 3446 3529 D Kiwi : ForegroundTaskPipeline: No UI visible to execute task: Prompt Presentation on Main Thread: a, Fri Aug 11 21:37:34 GMT+02:00 2023, placing into pending queue until task is visible
08-11 21:37:34.040 3446 3529 D Kiwi : AbstractCommandTask: Task finished
08-11 21:37:34.040 3446 3529 D Kiwi : CommandServiceClient: Finishing CommandServiceClient, unbinding service: true
08-11 21:37:34.040 3446 3446 D [Purchases] - DEBUG: ℹ️ User data request finished with result FAILED
08-11 21:37:34.041 3446 3446 E [Purchases] - ERROR: 🤖‼️ Error fetching offerings - PurchasesError(code=StoreProblemError, underlyingErrorMessage=Failed to get user data. Make sure sandbox mode is enabled if using App Tester. https://rev.cat/enter-amazon-sandbox, message='There was a problem with the store.')
08-11 21:37:34.041 3446 3446 E Purchases: {"error":{"code":2,"message":"There was a problem with the store.","readableErrorCode":"StoreProblemError","readable_error_code":"StoreProblemError","underlyingErrorMessage":"Failed to get user data. Make sure sandbox mode is enabled if using App Tester. https:\/\/rev.cat\/enter-amazon-sandbox"}}
08-11 21:37:34.053 3446 3529 D Kiwi : SimpleTaskPipeline: KIWI_COMMAND: Task finished executing: com.amazon.device.iap.internal.a.c.d@dac1a6b
08-11 21:37:34.055 3446 3461 I Unity : _getOfferings {"error":{"code":2,"message":"There was a problem with the store.","readableErrorCode":"StoreProblemError","readable_error_code":"StoreProblemError","underlyingErrorMessage":"Failed to get user data. Make sure sandbox mode is enabled if using App Tester. https:\/\/rev.cat\/enter-amazon-sandbox"}}
@gtoto007 🤔 not sure what's going on there, I'll take a look.
Note, however, that AppTester isn't really supported for RevenueCat - as I mentioned before, RevenueCat can't validate purchases made on AppTester, since they only exist on the AppTester app and can't be validated by the backend against Amazon's servers.
So if your app is working in Live App Testing, that's the most important part!
@aboedo Maybe it doesn't really matter if the purchase validation works correctly. So even fake answers might be fine. However, I expect that the SDK can work on my local device otherwise it would mean that every time I need to do a test I am forced to bring it live by significantly lengthening the feedback loop and making development frustrating.
@gtoto007 that's valid feedback, I've passed it along to the rest of our team for discussion.
I'm not sure whether it would be technically possible to implement a solution for AppTester, sadly, since with AppTester, the store is running exclusively on device, which introduces complications and security concerns. But we're looking into it.
Thank you again for you support and I hope that you will find a possible solution.
@gtoto007 we're still discussing ways to introduce compatibility with AppTester. I don't have an ETA for it, though, and it's not at the top of our backlog given the complexity in trying to solve for this. I'm closing out this issue in the meantime.
Thanks so much for your feedback! Let us know if you run into anything else!
Describe the bug
I followed all steps from your documentation to integrate revenuecat with amazon but when I launched my build on amazon fire device and the callback of Purchase.GetOfferings method is called, an error is showed:
"There as a problem with store. Code 2, UnderlyiningErrorMessage: Failed to get user data. Make sure sandbox mode is enabled if using App Tester. https://www.rev.cat/enter-amazon-sandbox, ReadableErrorCode: StoreProblemError"
I've same error when I called the method Purchases.GetProductsI've already tried to enable sandbox on device amazon and have install amazon test app but the error is always showing.
Anyway the sdk works correctly on ios and google play.
You can download this repository to reproduce my issue. I have created a scene test and I included my api amazon key revenuecat for testing purposes only: https://github.com/gtoto007/amazon-revenuecat-issue Below are the various steps I have performed
Environment
My steps
I created an iap on amazon store
I linked the amazon shared key on revenuecat dashboard
3.I linked iap in sections Entitlements,Offerings,Products of Revenuecat Dashboard
I've created a project empty with Unity 2020.3.8f1
I've integrated the release RevenueCat 4 in unity project.
Create an empty scene with PurchasesListener and Purchases script. I've added the amazon key, enable useAmazon and add my product identifiers example created on store amazon
I've built apk and launched it on device but when the callback of Purchase.GetOfferings method is called, on error is showed:
"There as a problem with store. Code 2, UnderlyiningErrorMessage: Failed to get user data. Make sure sandbox mode is enabled if using App Tester. https://www.rev.cat/enter-amazon-sandbox, ReadableErrorCode: StoreProblemError"
Debug Log