StoreKitPlus icon indicating copy to clipboard operation
StoreKitPlus copied to clipboard

hello,Can the user id be added to the transaction information when purchasing goods

Open tzgd opened this issue 1 year ago • 3 comments

tzgd avatar Aug 22 '24 06:08 tzgd

I can take a look, or will happily merge any PR that adds this feature 👍

danielsaidi avatar Aug 22 '24 13:08 danielsaidi

`open func purchase( _ product: Product, uid: String ) async throws -> Product.PurchaseResult { #if os(visionOS) throw StoreServiceError.unsupportedPlatform("This purchase operation is not supported in visionOS: Use @Environment(\.purchase) instead.") #else

        let uuid = Product.PurchaseOption.appAccountToken(UUID.init(uuidString: uid)!)
        let result = try await product.purchase(options: [uuid])
        switch result {
        case .success(let result): try await handleTransaction(result)
        case .pending: break
        case .userCancelled: break
        @unknown default: break
        }
        return result
        #endif
    }`

You can add a method to add uid, the code is only for reference, and you can improve it when you are free

tzgd avatar Aug 23 '24 01:08 tzgd

That's perfect, I'll make it happen.

danielsaidi avatar Sep 02 '24 11:09 danielsaidi

Hi @tzgd

I'm adding this to the upcoming 0.7.

danielsaidi avatar Apr 02 '25 13:04 danielsaidi