We noticed some unusual behavior. This seems to happen when there is no clear error and we are unsure if this was intended or not. Consider the following code:
[[RCPurchases sharedPurchases] offeringsWithCompletionBlock:^(RCOfferings* offerings, NSError* error)
else if (error)
// this branch actually gets executed!
Both offerings.current and error are nil in some cases. Usually it has something to do with running on iOS simulator or when the IAPs aren’t setup properly (which can be seen in the logs), but the implication in the call is that error will never be nil. Luckily we were able to identify this issue quickly and patch our code with a workaround, but maybe the SDK team might want to revise that behavior.
We haven’t tested if other calls have the same issue or if other platform SDKs have it.
Best answer by taquitos
Yeah, that’s weird. Thank you for reporting!
We recently migrated all our objc to swift, and we definitely found areas where we didn’t handle every possible case- so that’s to say, I think this is fixed, at least in the beta.
If you’re feeling adventurous, you could give our new release a try: https://github.com/RevenueCat/purchases-ios/blob/main/docs/V4_API_Updates.md
We recently updated it to `4.0.0-beta.3`