最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

revenuecat - How to handle payments using revenue cat - Stack Overflow

programmeradmin2浏览0评论

I am using the code below to purchase inapp in my app but when I purchase on my device, I don't get an apple server notification. Is this the right code to make purchases using revenue cat?

Purchases.shared.getOfferings { (offerings, error) in
    if let offerings = offerings {
        for offering in offerings.all {
           let packages = offering.value.availablePackages
               if let indexOfItem = packages.firstIndex(where: { $0.storeProduct.productIdentifier == productId }) {
                   let package = packages[indexOfItem]
                        
                   Purchases.shared.purchase(package: package) { (transaction, customerInfo, error, userCancelled) in
                            if customerInfo?.entitlements["sumizeit_premium"]?.isActive == true {
                  // turn feature on
                            } else if userCancelled {
                                
                            } else if error != nil {
                                
                            } else {
                            }
                        }
                    }
                }
            } else {
                
            }
        }

Why am I not getting an apple server notification for successful purchases?

发布评论

评论列表(0)

  1. 暂无评论