New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storekittest headers #407
Storekittest headers #407
Conversation
Purchases/Networking/RCHTTPClient.m
Outdated
@"X-Client-Build-Version": RCSystemInfo.buildVersion, | ||
@"X-Observer-Mode-Enabled": observerMode, | ||
#if UI_DEVICE_AVAILABLE | ||
@"X-Apple-Device-Identifier": UIDevice.currentDevice.identifierForVendor.UUIDString, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't work for Mac, on Mac we need to send the guid (see PR description)
#if UI_DEVICE_AVAILABLE | ||
return UIDevice.currentDevice.identifierForVendor.UUIDString; | ||
#elif WKINTERFACE_DEVICE_AVAILABLE | ||
return WKInterfaceDevice.currentDevice.identifierForVendor.UUIDString; | ||
#endif | ||
return nil; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be compatible with watchOS, tvOS, and Catalyst (so everything but native mac)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% sure about Catalyst, though, since I'm not sure whether it uses the idfv or guid for signing. I'll add support for all Mac on a separate PR, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this code somewhat duplicates what we have on RCAttributionFetcher, but the cleanup will also come on a different PR for the sake of shipping
17341ee
to
087a040
Compare
… auto-determined by the backend
7f8b87e
to
4e8dbd4
Compare
Adds the headers needed for receipts made using StoreKitTest to validate correctly.
Remaining work:
Note: the current version is only compatible with iOS.
For MacOS compatibility (v2):
on Mac, instead of the idfv, we need to send the guid https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateLocally.html#//apple_ref/doc/uid/TP40010573-CH1-SW14