How to decrypt a receipt and validate for a Xamarin forms iOS auto-renewing subscription?

116 Views Asked by At

I'd like to know for a Xamarin Forms iOS auto-renew subscription:

  • Is it mandatory to validate a purchase?
  • How can I decrypt an App Store Receipt?
  • How can I validate a purchase without using a server?

VALIDATION

I've had the app store reject my app saying I need to "validate on my server", but I've also read a lot of material online where people say a server is not necessary for an auto-subscription that simply unlocks a feature in the app and delivers no external content.

The Microsoft Xamarin documentation however doesn't describe this scenario and only considers server side validation.

https://learn.microsoft.com/en-us/xamarin/ios/platform/in-app-purchasing/transactions-and-verification#Securing_Purchases

DECRYPTION

I understand the receipt is a PKCS #7 container and have read Apple's documentation on this but I'm not very knowledgeable on crytography and can't figure out how I can apply this to a Xamarin Forms iOS project.

https://developer.apple.com/documentation/appstorereceipts/validating_receipts_on_the_device#//apple_ref/doc/uid/TP40010573-CH1-SW2

Could someone help with a Xamarin Forms, C#, app-side decrypt and validate example?

0

There are 0 best solutions below