ios – The way to optimize income cat code to buy subscriptions

[ad_1]

I’ve the next swift code that permits me to buy a subscription inside my IOS app. I am utilizing the income cat SDK.

 Purchases.shared.logIn(uid) { (purchaserInfo, created, error) in
            Purchases.shared.choices { (choices, error) in
                if let package deal = choices?.present?.lifetime {
                    Purchases.shared.purchasePackage(package deal) { (transaction, purchaserInfo, error, userCancelled) in
     

The problem is that this code takes some time to run. The person waits for the acquisition to undergo. I feel it is getting the record of merchandise earlier than making a name to Apple. Is there a strategy to optimize this code by loading the packages on app load within the AppDelegate file for instance?

[ad_2]

Leave a Reply