Search code examples
iosxamarin.iosstorekitmkstorekit

Can I persist SKProduct to disk to speed up in app purchases (remove network calls)?


I want to remove any round trip needed in order to create a list of SKProduct options which is then used to create a SKMutablePayment / SKPayment action.

  • Is there any guidance on how to serialize SKProduct?

  • How long can the data can be cached for (alternate currencies may vary in price even if my price is constant)


Solution

  • It is not recommended to store SKProduct. Apple considers SKPayment a readonly object that should be fetched prior to you displaying user interface.

    There are numerous reasons to do that.

    If you decide to cache an SKProduct and the user changes app store accounts you are likely to display incorrect price and currency.

    Trying to cache SKProduct to disk and attempting to deserialize it back at a later time would require access to the private setters of SKProduct. Exposing those in your app is likely to raise flags during your product review and resulting in rejection.