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

Enabled InAppReceiptRefreshRequest for macOS as it is supported #127

Merged
merged 1 commit into from
Jan 15, 2017

Conversation

einsteinx2
Copy link
Contributor

  • Also productIdentifier is not optional on macOS with Swift 3 so I removed that workaround code

- Also productIdentifier is not optional on macOS with Swift 3 so I removed that workaround code
@bizz84
Copy link
Owner

bizz84 commented Jan 15, 2017

Thanks for the PR!

I've been testing this and I observed the following when refreshing the receipt on macOS:

<NSXPCConnection: 0x600000102640> connection to service named com.apple.storeagent.storekit: Warning: Exception caught during decoding of received reply to message 'requestVPPReceiptRenewalWithSandboxOptions:replyBlock:', dropping incoming message and calling failure block.

As a result, I get the following callback in InAppReceiptRefreshRequest:

func request(_ request: SKRequest, didFailWithError error: Error)

Strangely though, it appears that the .success case is executed in the completion block in SwiftyStoreKit.refreshReceipt():

            switch result {
            case .success:
                if let appStoreReceiptData = InAppReceipt.appStoreReceiptData {
                    completion(.success(receiptData: appStoreReceiptData))
                }
                else {
                    completion(.error(error: ReceiptError.noReceiptData))
                }
            case .error(let e):
                completion(.error(error: e))
            }

This is not the case on iOS where I get the .error(let e) case instead.

I was wondering if you have observed a similar behaviour?

@einsteinx2
Copy link
Contributor Author

Weird, no I'm not seeing that. I just double checked again to be sure.

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.

2 participants