Solved

How do I know if I'm using the Purchases framework or the RevenueCat framework

  • 29 January 2022
  • 1 reply
  • 84 views

Badge +3

Last month I installed RevenueCat via Swift Packages in one of my SwiftUI apps and everything was working great until today when I tried to install a new package (Firebase) and I ran into issues installing it. I’m not 100% but I think my issue with RevenueCat started when I accidentally clicked on the `Update to Latest Package Versions` in Xcode. After that I started seeing a message that said something like…


Dependencies could not be resolved because no versions of 'purchases-ios' match the requirement 4.0.0..<5.0.0 and root depends on 'purchases-ios' 4.0.0..<5.0.0.

 

Then I removed the RevenueCat package and reinstalled the version suggested in the documentation (3.12.6 < 5.0.0, I actually used 3.12.6 < 4.0.0 since I could’t change it to < 5.0.0), after this new version I started getting errors within my code, for instance I’m getting the following error message…

 

    import RevenueCat

    Purchases.shared.restoreTransactions { (purchaserInfo, error) in
        // code here 
    }

'restoreTransactions(completion:)' has been renamed to 'restorePurchases(completion:)'
Replace 'restoreTransactions' with 'restorePurchases'

 

FYI - My Code hasn’t change since first day:

 

At this point I’m very confused, based on the migration guide the newest API should be `restorePurchases`,  but… I’m using version 3.12.6 which I believe is the old Purchases framework.

 

My question at this point is, based on the above code and if someone had to guess, what version was I using before the issues? Please note that I have been using `import RevenueCat` and `restoreTransactions` method since the first day.

Or in other words, what version should I install that would work with my existing code?

 

Any help will be appreciated.

Thanks!

 

icon

Best answer by Filemon Salas 30 January 2022, 04:17

View original

1 reply

Badge +3

Installed version 4.0.0-beta.7 and it started working again without making any changes to my code.

I’m still confused, my repository GIT shows that I was using version ‘4.0.0’ but I tried installing that version and didn’t work. I’m also confused because the 4.0.0-beta.7 should be using the new API (V4) and I’m still using the old one (V3) and it’s working. 

 

 

GIT - Version Control

  "object": {

    "pins": [

      {

        "package": "RevenueCat",

        "repositoryURL": "https://github.com/RevenueCat/purchases-ios.git",

        "state": {

          "branch": null,

          "revision": "05b148ee38be1f719b49de25336b7b36a90c2ef1",

          "version": "4.0.0"

          "revision": "1058fdbf011bf4d040f2a961149bc564b97e63e9",

          "version": "4.0.0-beta.7"

        }

      }

    ]

  }

 

FYI - This thread can be deleted if needed, as you can see I was lost in my first post and may confused other users.

Reply