MKStoreKit icon indicating copy to clipboard operation
MKStoreKit copied to clipboard

"product_id" missing from App Store Receipts fields

Open fbartolom opened this issue 6 years ago • 0 comments

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

fbartolom avatar Oct 29 '19 15:10 fbartolom