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

"product_id" missing from App Store Receipts fields #274

@fbartolom

Description

@fbartolom

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions