Skip to main content

Kotlin/Java

Section contents

Authorization requests

In the table below it is described how often the user gets authorization request.

ConditionsAuthorization requestAspects
RuStore is not installed on the user's device

Authorization request is triggered:

  • during each session when calling SDK methods:
    • getPurchases;
    • getProducts;
    • purchaseProduct;
  • 900 passed from the latest SDK method call:
    • getPurchases;
    • getProducts;
    • purchaseProduct.

Subsequent authorization calls require only one click.

To check whether RuStore is installed on the uses device, use the isRuStoreInstalled methods from the RuStoreUtils set. The method will return true or false depending on whether RuStore is installed.

RuStore is installed, but the user is not authorized

Authorization request is done when an SDK method is called:

  • getPurchases;
  • getProducts;
  • purchaseProduct.

By default, the message that the user is not authorized is displayed. For RuStore authorization screen to open in this case, use the SDK RuStoreUtils.openRuStoreAuthorization(context: Context) method. On successful authorization, the user will automatically return to the app.

Subsequent authorization i snot required until the user logs out from their RuStore profile.

To check purchases availability, use the checkPurchasesAvailability method. If all the above conditions are met, the method returns FeatureAvailabilityResult.Available. Otherwise, the mthod returns FeatureAvailabilityResult.Unavailable(val cause: RuStoreException).

RuStore is installed, the user is authorizedAuthorization goes seamlessly for the userN/A