Singleton CommonFunctionality.PurchasesSwiftType is neither public nor identical to Purchases.shared #1233
Open
10 of 11 tasks
Labels
bug
Something isn't working
This prohibits seamless SDK usage from both Flutter and Swift in
purchases_flutter: ^8.4.0
.configure
, Swift'sPurchases.shared
must be configured separately or crash.configure
beforepurchases-flutter
is configured in Dart, the Dart-side SDK calls will crash as below.configure
, a warning about multiple instances is emittedINFO: ℹ️ Purchases instance already set. Did you mean to configure two Purchases objects?
and redundant requests will fire (likely in an app's crowded early lifecycle).Possible resolutions
(a) Publicly expose PurchasesHybridCommon's .shared instance for usage from Swift
or (b) Have PurchasesHybridCommon adopt Purchases.shared as its standard instance
While the code paths are obvious, here's an example stack trace from a Swift-configured-
.shared
-before-Dart accesses its "shared" instance. Before the trace, the Swift-side Purchases SDK successfully finished network requests. After the crash,(lldb) po Purchases.isConfigured
returnstrue
as expected.Do not remove any of the steps from the template below. If a step is not applicable to your issue, please leave that step empty.
There are a lot of things that can contribute to things not working. Having a very basic understanding of your environment will help us understand your issue faster!
Environment
flutter doctor
purchases-flutter
Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)
Describe the bug
A clear and concise description of what the bug is. The more detail you can provide the faster our team will be able to triage and resolve the issue.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: