Question

First time user trying to make test purchase.


Badge +2

Hello community,

I am new to RevenueCat and to swift programming. I am trying to get my first app up and running on the store but am having trouble with making a test purchase.  Wondering if someone can help by looking at the debug log.

CN_235_Monthly299

2022-05-29 18:24:59.214531+0300 CASAFlightData[56957:3007853] [Purchases] - DEBUG: ℹ️ No existing requests and products not cached, starting SKProducts request for: ["CN_235_Monthly299"]

2022-05-29 18:24:59.253793+0300 CASAFlightData[56957:3007853] [Purchases] - DEBUG: 😻 SKProductsRequest did finish

2022-05-29 18:24:59.253996+0300 CASAFlightData[56957:3008278] [Purchases] - DEBUG: 😻 SKProductsRequest request received response

The code I’m running is here:

class PurchaseService {

    

    static func purchase(productId: String?, successfulPurchase: @escaping () -> Void) {

        

        guard productId != nil else {

            return

        }

        print(productId!)

        //Perform purchase

        //Get the SKProduct

        Purchases.shared.getProducts([productId!]) { (products) in

            

            if !products.isEmpty {

                let skProduct = products[0]

                print(products[0])

                

                //Purchase it

                Purchases.shared.purchase(product: skProduct) { (transaction, purchaserInfo, error, userCancelled) in

                    

                    //Purchase it

                    if error == nil && !userCancelled {

                        //Successfull purchase

                        successfulPurchase()

                    }

                }

            }

        }

    }

}

When the above code runs nothing happens on my phone offering the subscription.  Thanks in advance for any help.


0 replies

Be the first to reply!

Reply