-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Argument 'product' was not passed to a native module. #81
Comments
Merhaba, Can! We haven't reviewed our error decoding strategy yet, so it can result in unknown errors occasionally. Is May I ask you to launch your app with What I'm most curious about is debug log with label I bet that product, that is being passed in this Is this a totally new product? Was there recently some mutations regarding this product? |
@canpoyrazoglu mentioning in case you don't get notified otherwise |
Hi @divanc :) Here is another screenshot from my debugging environment when the breakpoint at I've started However, if it helps, I've set up a native breakpoint at I'll also send the product data if still needed if I'm cleared by my team members, or through a private channel shortly. Hope the current data helps in meantime. |
Oh no, to output verbose logs, you need to add a property to activate call like this: adapty.activate('PUBLIC_SDK_KEY', { logLevel: 'verbose' }); You can refer to second example here: It would provide huge amount of data to your RN development server. There you will be able to find what we are looking for |
It is also productStr on line 315 in your Xcode screenshot if you prefer to breakpoint |
Okay, I've initialized with verbose logging. Here is the error message at JS side when I try to make the purchase, along with additional logs/errors just after it, to the relevant extent (app name redacted in public):
|
I doubt that args should be empty, let me jump back to your version and check today |
Yeah, that seems to be the problem at native side. But I don't get why it's empty in the first place, as I'm passing a valid object to the function at JS side, where it works perfectly with another product nevertheless. |
Okay after a long dive here was the result: I was caching Adapty paywall objects in my persisted Redux store as fetching them was sometimes slow and I needed some of them them on app start early on. When I was reopening my app, I had them ready, but in case something changed (e.g. price adjusted on Adapty) I was force-reloading some of the most-early-on used paywalls from Adapty anyway: It seemed to be best of both worlds, I always had data, and I also refreshed the most common used ones in the background when my app opened. However that turned out to be problematic: Adapty also has a caching mechanism within itself that is not persisted, but cached throughout the session, and it always sends the object (product+variation) after reading it with that key from the cache. When I was trying to use one of the force-refreshed paywalls (which were reloaded on app start) it was hitting the cache and presenting the paywall with the latest Adapty-loaded paywall. When I was trying to feed a cached (from a previous app session) paywall which wasn't force-reloaded on app start, it looked like a perfect normal object from outside, yet as Adapty was caching it session-wise and that product wasn't loaded in the current session, Adapty's internal cache was missing the entry, returning I've changed my code to load all the other paywalls that might be needed and the problem went away, as Adapty now caches them on app start after the first load, which correctly gets cached and is hit by Adapty's internal JS-side cache correctly. TL;DR: Don't persist Adapty products on Redux on app close. I was using a redux-persisted object from a previous app session which didn't play well with Adapty's session-level cache. Fixed by discarding that object and loading that fresh from Adapty on app start. |
I had a talk with native developers, it is possible to freeze products, although they would look a little different, I'll try to implement this possibility in v2.5.0 |
Description
I'm trying to make a purchase by calling
await adapty.makePurchase(product);
whereproduct
is:(details redacted for privacy)
I'm getting the "Failed to deserialize a native error message" message again. I've also raised another issue in the past (#76) which was being raised the same way but the underlying error is different here (it was me passing an object instead of a string, which is not the case here).
I'm getting "Argument 'product' was not passed to a native module." but I'm calling
adapty.makePurchase
with aproduct
object as seen above, which is a clear and validproduct
object.More weirdly, I have another paywall which uses the exact same code path just with a different
product
(but has the same shape/fields), it works perfectly.What might be going on?
Version
v2.4.2
What platforms are you seeing the problem on?
iOS
System info
The text was updated successfully, but these errors were encountered: