We are bringing an app to the Amazon appstore from Google Play. I know that we need to switch from Google's IAB to Amazon's In-App Purchasing API. But, for simplicity's sake, we'd like to leave the Google Play code in the binary so that we don't have to branch our source. To be clear, the Amazon version of the app would never take the Google Play IAB branch of code. Would we encounter any problems in submission if we go this route instead of actually commenting out or removing all Google Play IAB references?
1) Check to see if the Amazon Appstore is present by calling the IAP method 'initiateGetUserIdRequest'. If the response returns successfully, you can use Amazon IAP.
2) Amazon provides a DRM method that works for all binaries purchased through Amazon. Since the DRM is applied during publishing, you don't have to be concerned with it if it is published through another store.
3) You should be able to use a single Manifest for both stores.
I'm not sure what a custom build script would be needed for ... you should be able to build a single binary that addresses both paths.
Using initiateGetUserIdRequest as you suggested wouldn't necessarily mean our app was installed via Google Play, as the user could have both stores installed and may have purchased the app via Google Play, right?
Is there another method of which you're aware? I did see some mention of checking Signatures of the app, but not sure this would work if we utilized the option to sign our app with our own signature.
If the app is downloaded from Amazon AppStore then you can assume that the AppStore is loaded on to the device & you should be using the Amazon IAP. In-case you downloaded the app from Amazon AppStore and try to purchase IAP using GooglePlay IAB, then we would reject it.
Anshul, My message above should say: <begin> Using initiateGetUserIdRequest as you suggested wouldn't necessarily mean our app was installed via __Amazon Appstore__, as the user could have both stores installed and may have purchased the app via Google Play, right?
Is there another method of which you're aware? I did see some mention of checking Signatures of the app, but not sure this would work if we utilized the option to sign our app with our own signature. <end>
Does using initiateGetUserIdRequest as suggested guarantee the app was installed via the Appstore? I want to make sure that if our app was downloaded from Google Play, Amazon is not used for IAP.
onSdkAvailable(boolean isSandboxMode) - This callback is invoked once you register your PurchasingObserver with the PurchasingManager - This method tells you if the Purchasing Framework is running in sandbox mode with test data, or in production mode with real data - If your app is downloaded via the Amazon Client, isSandboxMode will return false - The initiating method should be called within the onStart() lifecycle method
On registering your PurchaseObserver, you get a async call back, onSdkAvailable(Boolean isSanboxMode). If the app is downloaded via the Amazon Client then isSandboxMode will always return false. This code will work successfully in production mode, however in development/test environment, the isSandboxMode will always return true as the app is not downlaoded via the Amazon Client in test environment.
Anshul, Reading the documentation, it would seem this method merely returns whether or not the Appstore IAP SDK is available in sandbox or production, but not whether or not the app was actually purchased via Amazon's Appstore, or Google Play (the device could have access to both the Appstore and Google Play). Could you clarify? Thanks
The onSdkAvailable() documentation states that "If your app is downloaded via the Amazon Client, isSandboxMode will return false", so if you want to check if your app is downloaded from Amazon appstore, then please use the boolean value isSandboxMode. If the isSandboxMode returns false, then the app is downloaded from Appstore.