Skip to content
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

Merged
merged 8 commits into from Dec 1, 2020
Merged

Storekittest headers #407

merged 8 commits into from Dec 1, 2020

Conversation

aboedo
Copy link
Member

@aboedo aboedo commented Nov 30, 2020

Adds the headers needed for receipts made using StoreKitTest to validate correctly.

Remaining work:

  • Unit tests

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

@"X-Client-Build-Version": RCSystemInfo.buildVersion,
@"X-Observer-Mode-Enabled": observerMode,
#if UI_DEVICE_AVAILABLE
@"X-Apple-Device-Identifier": UIDevice.currentDevice.identifierForVendor.UUIDString,
Copy link
Member Author

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)

Comment on lines +74 to +80
#if UI_DEVICE_AVAILABLE
return UIDevice.currentDevice.identifierForVendor.UUIDString;
#elif WKINTERFACE_DEVICE_AVAILABLE
return WKInterfaceDevice.currentDevice.identifierForVendor.UUIDString;
#endif
return nil;
Copy link
Member Author

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)

Copy link
Member Author

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.

Copy link
Member Author

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

@aboedo aboedo self-assigned this Dec 1, 2020
@aboedo aboedo marked this pull request as ready for review December 1, 2020 19:23
@aboedo aboedo added this to the 3.9.0 milestone Dec 1, 2020
@aboedo aboedo mentioned this pull request Dec 1, 2020
1 task
@aboedo aboedo merged commit 71e9113 into develop Dec 1, 2020
@aboedo aboedo deleted the storekittest_headers branch December 1, 2020 20:40
@aboedo aboedo mentioned this pull request Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants