Craig-Ronald / capacitor-subscriptions

11 stars 3 forks source link

Improvement - Transaction ID as property #11

Open selcukbeyhan opened 5 months ago

selcukbeyhan commented 5 months ago

hi, instead of returning a dictionary where the transaction ID is a key in this code:

    @available(iOS 15.0.0, *)
    @objc public func getCurrentEntitlements() async -> PluginCallResultData {
....
                    transactionDictionary[String(transaction!.id)] = [
                        "productIdentifier": transaction!.productID,
                        "originalStartDate": transaction!.originalPurchaseDate,
                        "originalId": transaction!.originalID,
                        "transactionId": transaction!.id,
                        "expiryDate": transaction!.expirationDate
                    ]

The transaction ID is already a key within this dictionary above

It could be more easy to return an array of dictionaries. thanks.