HomeiOS Developmentstorekit2 - IOS Swift Storekit 2 How one can get renewalInfo?

storekit2 – IOS Swift Storekit 2 How one can get renewalInfo?


I need to achieve items of details about Product.SubscriptionInfo.RenewalInfo.

How one can get to the renewalInfo knowledge in Swift?

I attempted this code:

                let standing: [Product.SubscriptionInfo.Status]? = strive await merchandise[sku]?.subscription?.standing

                if let statusArr = merchandise[sku]?.subscription?.standing {
                    for merchandise in statusArr {
                        if let verificationResult = merchandise.renewalInfo as? VerificationResult<Product.SubscriptionInfo.RenewalInfo> {
                            let renewalInfo = verificationResult.payloadValue
                            let state = renewalInfo.state
                            print("state: (state)")
                            let expirationReason = renewalInfo.expirationReason
                            print("expirationReason: (expirationReason)")
                            let jsonRepresentation = renewalInfo.jsonRepresentation
                            print("jsonRepresentation: (jsonRepresentation)")
                        }else{
                            print("no data")
                        }
                    }
                }

However I get this error:

Worth of kind 'Product.SubscriptionInfo.RenewalInfo' has no member 'state'

I am new to Swift and iOS documentation, possibly I am doing one thing fallacious or misunderstanding the idea🥴. The place might I discover any instance code?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments