Fabrizio Bartolomucci
Fabrizio Bartolomucci

Reputation: 4958

"product_id" missing from App Store Receipts fields

I am finally in the process of translating the MKStoreKit class from Muguntu Kumar into Swift to get rid of the regularly occurring issues with objective-c and to eventually share it for the hopeful benefit of everyone. Still, I am now stuck at:

if 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 could work, given that field never arrives, second I would like to know with what I may substitute that value to index self.purchaseRecord.

Thanks, Fabrizio

Upvotes: 0

Views: 103

Answers (0)

Related Questions