superwall / Superwall-Android

Remotely configure every aspect of your paywall and double your revenue.
https://superwall.com
MIT License
11 stars 3 forks source link

Preload SuperWall take significant time and cause ANR #180

Closed DawnNguyenAhiho closed 1 month ago

DawnNguyenAhiho commented 1 month ago

Hi, I'm currently working with SuperWall SDK with option preload default on. And when release to user, we notice that the ANR rate raise significantly on Play Console. When I disable option preload by using

options {
                paywalls {
                    shouldPreload = false
                }
}

the cold start time has improved, and the performance in app it better. I'm wondering that does the preload option is running on UI thread. If so, please fix that, or at least give me some solution (and also update the docs) to get rid of it. Thank you very much.

ianrumac commented 1 month ago

Hi @DawnNguyenAhiho !

What version of the SDK are you using? We've reduced the impact of the preloads a lot in the last versions, altho with a high number (>50) of preloaded active paywalls it is possible ANR's could occur (as the paywall views themselves are prepared and Android requires us to create them on the main thread).

While we are working on reducing the impact of that and have some large preloading improvements prepared that we're still testing, I'd love to take a closer look at what is exactly causing you these problems. Could you contact us via Intercom so you can share more information about your app?

Thanks!

DawnNguyenAhiho commented 1 month ago

Hi @ianrumac. Thank you for answering me. I'm using SupperWall v1.2.0. For now, I'm working around by disable preload and we notice that, on some device which has medium and low hardware the paywall load no slower than normal device, but actually noticeably faster than when enable preload. I'm happy to provide more information, but I'm not allowed to share much about our product, so I'll provide as much as I can. Please tell me more about how can I contact you via Intercom. Many thanks!

ianrumac commented 1 month ago

@DawnNguyenAhiho I'd definitely suggest updating to the latest version (1.2.9), since there were a bunch of under-the-hood improvements since then! But I'll introduce some preloading testing for low-end devices to catch possible ANR's there.

You can contact us on Intercom by opening your Superwall dashboard and clicking the floating chat button in the lower right corner