SwiftyStoreKit icon indicating copy to clipboard operation
SwiftyStoreKit copied to clipboard

Upcoming changes to the App Store receipt signing certificate

Open nikunjgabani opened this issue 3 years ago • 5 comments

I have recently got this news to the apple developer news channel, https://developer.apple.com/news/?id=ytb7qj0x

So I want to know that will this affect my implementation to check the status of user purchase status. I am currently using this function to verify receipt, so that I can check the user's purchase status, SwiftyStoreKit.verifyReceipt(using: AppleReceiptValidator)

Response on this will be very helpful to me.

nikunjgabani avatar Dec 22 '22 10:12 nikunjgabani

Yes, Require any changes in existing apps?

GreydeskChirag avatar Jan 04 '23 09:01 GreydeskChirag

I found this but still not 💯 sure if this will effect SwiftyStoreKit...can anyone chime in? https://www.revenuecat.com/blog/engineering/app-store-receipt-signing-certificate-changes-in-2023/

gesabo avatar Jan 06 '23 20:01 gesabo

Surely it would be best to hear from the author, but here is some analysis from my side:

The linked Apple document states:

If you verify App Store transactions using the AppTransaction and Transaction APIs, or the verifyReceipt web service endpoint, no action is required.

SwiftyStoreKit uses verifyReceipt service for validation. So, no action is needed from our side 🤓

public class AppleReceiptValidator: ReceiptValidator {

	public enum VerifyReceiptURLType: String {
		case production = "https://buy.itunes.apple.com/verifyReceipt"
		case sandbox = "https://sandbox.itunes.apple.com/verifyReceipt"
	}

        ...
}

SergejLogis avatar Jan 19 '23 13:01 SergejLogis

I'm not sure if its related but seems coincidental that this went into place January 18, 2023 and today January 26, 2023 when calling SwiftyStoreKit.verifyReceipt I am now getting Finished refreshing receipt with error: Error Domain=ASDServerErrorDomain Code=500328 "Unhandled exception" UserInfo={NSLocalizedFailureReason=An unknown error occurred, NSLocalizedDescription=Unhandled exception, AMSServerErrorCode=0} as well as Receipt verification failed: networkError(error: Error Domain=SKErrorDomain Code=0 "An unknown error occurred" UserInfo={NSLocalizedDescription=An unknown error occurred, NSUnderlyingError=0x283a2b960 {Error Domain=ASDServerErrorDomain Code=500328 "Unhandled exception" UserInfo={NSLocalizedDescription=Unhandled exception, NSLocalizedFailureReason=An unknown error occurred}}}) which I never recall happening before, so maybe this is an issue?

update: a few minutes later I am not getting this error in the sandbox anymore, but if I download my app from the store its fully unlocked - which could only happen if SwiftyStoreKit.verifyReceipt returns an error. So it seems to either be related to case production = "https://buy.itunes.apple.com/verifyReceipt" or there is an outage with the App Store but system status says its green. 🤔 Obviously this is nearly impossible to test since it's production.

gesabo avatar Jan 26 '23 15:01 gesabo