Craig-Ronald / capacitor-subscriptions

MIT License
14 stars 5 forks source link

Improvement - Transaction ID as property #11

Open selcukbeyhan opened 9 months ago

selcukbeyhan commented 9 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.