RCPurchasesDelegate

@protocol RCPurchasesDelegate <NSObject>

Delegate for RCPurchases responsible for handling updating your app’s state in response to updated purchaser info or promotional product purchases.

Note

Delegate methods can be called at any time after the delegate is set, not just in response to purchaserInfo: calls. Ensure your app is capable of handling these calls at anytime if delegate is set.
  • Called whenever RCPurchases receives updated purchaser info. This may happen periodically throughout the life of the app if new information becomes available (e.g. UIApplicationDidBecomeActive).

    Declaration

    Objective-C

    - (void)purchases:(nonnull RCPurchases *)purchases
        didReceiveUpdatedPurchaserInfo:(nonnull RCPurchaserInfo *)purchaserInfo;

    Parameters

    purchases

    Related RCPurchases object

    purchaserInfo

    Updated RCPurchaserInfo

  • Called when a user initiates a promotional in-app purchase from the App Store. Use this method to tell RCPurchases if your app is able to handle a purchase at the current time. If yes, return true and RCPurchases will initiate a purchase and will finish with one of the appropriate RCPurchasesDelegate methods. If the app is not in a state to make a purchase: cache the defermentBlock, return no, then call the defermentBlock when the app is ready to make the promotional purchase. If the purchase should never be made, do not cache the defermentBlock and return NO. The default return value is NO, if you don’t override this delegate method, RCPurchases will not proceed with promotional purchases.

    Declaration

    Objective-C

    - (BOOL)purchases:(nonnull RCPurchases *)purchases
        shouldPurchasePromoProduct:(nonnull SKProduct *)product
                    defermentBlock:(nonnull RCDeferredPromotionalPurchaseBlock)
                                       makeDeferredPurchase;

    Parameters

    product

    SKProduct the product that was selected from the app store