Git Product home page Git Product logo

Comments (7)

jln19 avatar jln19 commented on September 18, 2024

I also tried creating a brand new project in Xcode and only adding the following code in didFinishLaunching (after installing the Pod). I still get the same error on a breakpoint on if let packages = ...

        Purchases.debugLogsEnabled = true
        Purchases.configure(withAPIKey: "my-api-key")
        
        Purchases.shared.offerings { (offerings, error) in
            if let packages = offerings?.current?.availablePackages {

            }
        }

from purchases-ios.

jeiting avatar jeiting commented on September 18, 2024

What version of Purchases is actually installed? Your cocoapods might be out of data and these examples reference a more recent version of Purchases.

from purchases-ios.

jln19 avatar jln19 commented on September 18, 2024

@jeiting pod 'Purchases', '3.0.0'

from purchases-ios.

jeiting avatar jeiting commented on September 18, 2024

Is it possible your Xcode intermediates are in a bad state?

Have you tried deleting DerivedData?

from purchases-ios.

jln19 avatar jln19 commented on September 18, 2024

So after deleting DerivedData, this no longer shows an error:

Purchases.shared.purchaserInfo { (purchaserInfo, error) in
            // I get Optional<RCPurchaserInfo> here
        }

However, when I try this:

Purchases.shared.offerings { (offerings, error) in
if let packages = offerings?.current?.availablePackages {
                self.packages = packages
            }
        }

If I do po offerings I get

▿ Optional<RCOfferings>
  - some : <Offerings {
	currentOffering=(null)>

If I hover over offerings in Xcode I get the error:

Printing description of offerings:
expression produced error: error: /var/folders/9m/qr_cnwq903n_f_xf0nbgcf140000gn/T/expr45-d72fda..swift:1:90: error: 'Purchases' is not a member type of 'Purchases'
Swift._DebuggerSupport.stringForPrintObject(Swift.UnsafePointer<Swift.Optional<Purchases.Purchases.Offerings>>(bitPattern: 0x10a329ea0)!.pointee)

from purchases-ios.

jln19 avatar jln19 commented on September 18, 2024

I think the "expression produced error" thing may be a Swift/Xcode issue. I think the real problem is that I'm not getting any offerings. I have them set up in the admin as well as marking one of them as "current". DEBUG shows that I have invalid product identifiers. I've triple-checked those though and I can successfully pull products down from native IAP code and SwiftyStoreKit using those identifiers. I submitted a tech support ticket about this over the weekend if you have a minute to check that out. 🙏

from purchases-ios.

vegaro avatar vegaro commented on September 18, 2024

Closing this since it looks like it's been solved and another issue has been opened.

from purchases-ios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.