Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

"product_id" missing from App Store Receipts fields #274

Open
fbartolom opened this issue Oct 29, 2019 · 0 comments
Open

"product_id" missing from App Store Receipts fields #274

fbartolom opened this issue Oct 29, 2019 · 0 comments

Comments

@fbartolom
Copy link

I am trying to translate the class into Swift to get rid of the regularly occurring issues and to eventually share it here for the hopeful benefit of everyone. Though, I am now stuck at:

let productIdentifier = receipt["product_id"], let expiresDateMs = receiptDictionary["expires_date_ms"] { // renewable subscription
                        let previouslyStoredExpiresDateMs = self.purchaseRecord?[productIdentifier];
                        if previouslyStoredExpiresDateMs==nil{
                            self.purchaseRecord?[productIdentifier] = expiresDateMs;
                            purchaseRecordDirty = true;
                        } else if Double(truncating: expiresDateMs) > Double(truncating: previouslyStoredExpiresDateMs!) {
                            self.purchaseRecord?[productIdentifier] = expiresDateMs;
                            purchaseRecordDirty = true;
                        }
                    }
                }

in function startValidatingReceiptsAndUpdateLocalStore, given the fields in https://developer.apple.com/documentation/appstorereceipts do not even include field product_id that is needed to access the purchase record in the line soon below.
First I do not know how the original Objective_C library works, given that field never arrives, second I would like to know with what I may substitute that value to index self.purchaseRecord.

Thanks, Fabrizio

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant