Login to account A (`Purchases.sharedInstance.awaitLogIn(firebaseUser.uid)`)
Logout from account A
Login to account B
Logout from account B
Login to account A, await `customerInfo`, call getProducts Result: ``` PurchasesError(code=UnknownError, underlyingErrorMessage=BillingWrapper is not attached to a listener, message='Unknown error.') ```
Page 1 / 1
Hi @ipavlovskii,
I’m glad to hear you’ve fixed it! And yes, thanks for that feedback, I agree it can be clarified. I’ll pass it on to the SDK team.
@ipavlovskii can you share the debug logs? Code looks good but the full debug logs from beginning all the way until the error is reproduced is helpful for our engineering team to look into this
Hi @ipavlovskii,
Thanks for confirming and sorry for the delay. Just wanted to close the loop on this, it looks like you’re configuring correctly so no action needed on that. I’ve passed the feedback on to the mobile engineering team. If anything else comes up in the future please feel free to reach back out!
Hi @sharif , sorry for long reply. Probably, I found the answer:
By the documentation the single point of interaction with Revenucat purchases is `Purchases.sharedInstance`. By the doc - it’s a singleton, but… by the implementation - it’s not
That’s mean, if I initialize a Purchases and store in a private variable/DI/IoC/dependency provider - that might be Ndifferent instances:
```
val purchaseSingletonInstanceForMyApplication = Purchases.sharedInstance
//…. something doing and `Purchases.sharedInstance` reinitialized → set method calls → prev link to instance `purchaseSingletonInstanceForMyApplication`
purchaseSingletonInstanceForMyApplication - instance closed and any purchase call from this instance will failed
```
So, to fix that case you might: 1. update documentation
2. make it real as a real singleton, because `get()` method might return different instances
I forgot to ask one question - are you calling Purchases.configure more than once? Just making sure you’re not running into issues caused by that. Purchases.configure should be called exactly once in an app’s lifecycle
No, I’m call configure only once on the app initialization
If I’m not wrong, handle that case after login
val purchase = Purchases.sharedInstance val loginResult = purchases.awaitLogIn(firebaseUser.uid) purchase.getProducts(someProductsIdsArray) // Crashed with BillingWrapper is not attached
Hey @ipavlovskii,
Can you share the entire debug logs while doing those steps? I’ll pass them to our mobile engineering team to take a look.