INNER CODE UNIT · Dart

PurchasesErrorHelper

RevenueCat/purchases-flutter · lib/errors.dart:8

class PurchasesErrorHelper {
  /// Use this to convert a PlatformException to a PurchasesErrorCode.
  /// It will return [PurchasesErrorCode.unknownError] if the error code is not
  /// in the range of [PurchasesErrorCode].
  ///
  /// ```
  /// try {
  ///    PurchaserInfo purchaserInfo = await Purchases.purchasePackage(package);
  /// } on PlatformException catch (e) {
  ///     var errorCode = PurchasesErrorHelper.getErrorCode(e);
  ///     switch(errorCode) {
  ///     case PurchasesErrorCode.purchaseCancelledError:
  ///       print("User cancelled");
  ///       break;
  ///     case PurchasesErrorCode.purchaseNotAllowedError:
  ///       print("User not allowed to purchase");
  ///       break;
  ///     default:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…