Skip to main content
Question

RevenueCat supports the SKPaymentTransactionObserver method ?


Forum|alt.badge.img+5
  • Active Member
  • 10 replies

Hi, I want to promote my IAP, does RevenueCat provide a guideline for implementing this app store promotions?  Thanks!!

---------------------------

App Store Promotions

You can promote up to 20 in-app purchases, and they’ll appear on your app’s product page and can be shown in search results or be featured by our editorial team. Users can tap an in-app purchase to open your app, where they can buy it. Make sure your app supports the SKPaymentTransactionObserver method to process this transaction. 

12 replies

joshdholtz
RevenueCat Staff
Forum|alt.badge.img+5
  • RevenueCat Staff
  • 92 replies
  • April 4, 2022

Hey @RRN!

Yes yes, RevenueCat does support SKPaymentTransactionObserver so this flow to promote IAPs will work for you 😊 

Thanks!


Forum|alt.badge.img+5
  • Author
  • Active Member
  • 10 replies
  • April 4, 2022
joshdholtz wrote:

Hey @RRN!

Yes yes, RevenueCat does support SKPaymentTransactionObserver so this flow to promote IAPs will work for you 😊 

Thanks!

Hi, thanks for your answer. Do you have a guide to set it up?


joshdholtz
RevenueCat Staff
Forum|alt.badge.img+5
  • RevenueCat Staff
  • 92 replies
  • April 4, 2022

@RRN Nope because there is nothing you should have to do! The SDK is already observing it and will handle purchases that come in through that method/flow automatically 😊 


Forum|alt.badge.img+5
  • Author
  • Active Member
  • 10 replies
  • April 4, 2022
joshdholtz wrote:

@RRN Nope because there is nothing you should have to do! The SDK is already observing it and will handle purchases that come in through that method/flow automatically 😊 

I am rather new here, so I just set it up on the “App Store Connect”, then everything will work fine?


joshdholtz
RevenueCat Staff
Forum|alt.badge.img+5
  • RevenueCat Staff
  • 92 replies
  • April 4, 2022

@RRN Ideally! The RevenueCat SDK listens for something to come through in that observer and then it should automatically open up the IAP purchase modal for that 😊 

If you get issues and it doesn’t work just come back to us and we’ll help you out!


Forum|alt.badge.img+5
  • Author
  • Active Member
  • 10 replies
  • April 5, 2022
joshdholtz wrote:

@RRN Ideally! The RevenueCat SDK listens for something to come through in that observer and then it should automatically open up the IAP purchase modal for that 😊 

If you get issues and it doesn’t work just come back to us and we’ll help you out!

Hi, I just tested, it can open the app, but the IAP purchase modal doesn’t open automatically. 


joshdholtz
RevenueCat Staff
Forum|alt.badge.img+5
  • RevenueCat Staff
  • 92 replies
  • April 5, 2022

@RRN Ah! Hmmm… thanks for letting me know! I’ll give a try myself and see what I can come up with. What version of the SDK are you using?


Forum|alt.badge.img+5
  • Author
  • Active Member
  • 10 replies
  • April 5, 2022
joshdholtz wrote:

@RRN Ah! Hmmm… thanks for letting me know! I’ll give a try myself and see what I can come up with. What version of the SDK are you using?

I am not sure, how can I check?  It should be pretty old, at least 1 year ago. 


joshdholtz
RevenueCat Staff
Forum|alt.badge.img+5
  • RevenueCat Staff
  • 92 replies
  • April 5, 2022

@RRN 

  • If you are using CocoaPods, you can check in your Podfile.lock or Podfile
  • If you are using SPM, you can check the “Package Dependencies” (see image below) in the Project navigator
  • If you are using Carthage, you should be able to check in your Cartfile.lcok

 


Forum|alt.badge.img+5
  • Author
  • Active Member
  • 10 replies
  • April 5, 2022
joshdholtz wrote:

@RRN

  • If you are using CocoaPods, you can check in your Podfile.lock or Podfile
  • If you are using SPM, you can check the “Package Dependencies” (see image below) in the Project navigator
  • If you are using Carthage, you should be able to check in your Cartfile.lcok

 

Thanks, it is 3.2.2  :)


joshdholtz
RevenueCat Staff
Forum|alt.badge.img+5
  • RevenueCat Staff
  • 92 replies
  • April 5, 2022

@RRN 

Okay, I was mistaken! You do need to do _a little_ bit of work 😇

You need to implement on of the `PurchasesDelegate` functions - https://docs.revenuecat.com/docs/configuring-sdk#ios

extension AppDelegate: PurchasesDelegate {
    func purchases(_ purchases: Purchases, shouldPurchasePromoProduct product: StoreProduct, defermentBlock makeDeferredPurchase: @escaping DeferredPromotionalPurchaseBlock) {

        makeDeferredPurchase { (transaction, customerInfo, error, success) in
            print("Yay")
        }
    }
}

It would look something like this ☝️ You need to call `makeDeferredPurchase` when your app is in a state where I can make the purchase 😊 

Note: These docs and example code are using our new v4 SDK. Which would be good to upgrade to at some point but it could require a little bit of migration.

The v3.2.2 docs can be found here - https://docs.revenuecat.com/v3.1/docs/configuring-sdk#ios

Hopefully this helps but let me know if this still doesn’t work!


Forum|alt.badge.img+5
  • Author
  • Active Member
  • 10 replies
  • April 6, 2022
joshdholtz wrote:

@RRN

Okay, I was mistaken! You do need to do _a little_ bit of work 😇

You need to implement on of the `PurchasesDelegate` functions - https://docs.revenuecat.com/docs/configuring-sdk#ios

extension AppDelegate: PurchasesDelegate {
    func purchases(_ purchases: Purchases, shouldPurchasePromoProduct product: StoreProduct, defermentBlock makeDeferredPurchase: @escaping DeferredPromotionalPurchaseBlock) {

        makeDeferredPurchase { (transaction, customerInfo, error, success) in
            print("Yay")
        }
    }
}

It would look something like this ☝️ You need to call `makeDeferredPurchase` when your app is in a state where I can make the purchase 😊 

Note: These docs and example code are using our new v4 SDK. Which would be good to upgrade to at some point but it could require a little bit of migration.

The v3.2.2 docs can be found here - https://docs.revenuecat.com/v3.1/docs/configuring-sdk#ios

Hopefully this helps but let me know if this still doesn’t work!

Thanks, I will test it!!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings