fix(adapty-ui): render product text on first composition before produ…#45
fix(adapty-ui): render product text on first composition before produ…#45Taha-Firoz wants to merge 2 commits into
Conversation
…cts load TextResolver.resolve returned StringWrapper.EMPTY whenever products[desiredProductId] was null, which blanked the Purchase Button label (and Products text) on the first opening of an Android paywall, even for literal labels with no product-dependent tags. The label only appeared after dismissing and reopening, once the SDK had cached the products. Match the iOS path (AdaptyUITextView's placeholder branch): drop the early return and let the resolver continue with a nullable product. The default-payment-mode lookup returns the configured text immediately, and recomposition fills in tag-resolved values once products arrive.
|
Hi @Taha-Firoz, thank you for your contribution! We’ll review it and I’ll get back to you soon. |
|
I'll be adding another commit, the purchase button doesn't involve the payment tray reliably either. |
ViewModelProvider was keyed only by class name, so every AdaptyPaywallView in the same Activity received the same PaywallViewModel. Android fires attach listeners after AbstractComposeView creates and runs its initial composition, so the first frame of a freshly attached AdaptyPaywallView read the shared VM's stale dataState.value (the previous paywall's UserArgs) before setNewData() ran, rendering the prior paywall's tree and corrupting state[group_*] with its productId. The next Buy Now tap then silently no-oped because the lookup hit a product not present in the new paywall's products map. Pass a per-instance UUID as the ViewModelProvider key so each view gets its own VM.
|
When the host opens different paywalls in the same Activity, the second paywall rendered the previous |
|
@Taha-Firoz thank you, we're taking a look. |
|
@vladd-g we really need this escalated, we can't ship on this fork. |
|
Hi @Taha-Firoz, thanks for flagging! Could you please reach out to our support? The team will help you from there. |
Hi @vladd-g I am on the same team with @Taha-Firoz We were already in contact with your support through our colleague Dennis. They told us that it would be in the next major SDK release and it was being reviewed.
|

TextResolver.resolvereturnedStringWrapper.EMPTYwheneverproducts[desiredProductId]wasnull, which blanked the Purchase Button label (and Products text) on the first launch of an Android paywall, even for literal labels with no product-dependent tags. The label only appeared after dismissing and reopening, once the SDK had cached the products.Match the iOS path (AdaptyUITextView's placeholder branch): drop the early return and let the resolver continue with a nullable product. The default-payment-mode lookup returns the configured text immediately, and recomposition fills in tag-resolved values once products arrive.