chargebee / chargebee-ios

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Race between Chargebee.configure() and other SDK calls

sjmadsen opened this issue · comments

Chargebee.configure() makes a call to the Chargebee API, but because it doesn't take a completion handler, the calling code can't know when it's done. If the calling code continues and makes another call into the Chargebee SDK, it's possible for it to make decisions before the SDK is fully configured.

Specifically, Chargebee.configure followed by CBPurchase.retrieveProductIdentifiers will often fail because CBEnvironment.version hasn't been set yet.

Thank you for bringing this condition to our notice. In the version 1.0.1 of the SDK we have modified the retrieveProducts function to handle this condition. Please test it out.