glassfy / glassfy-flutter

Open source SDK to quickly integrate subscriptions, stop worring about code maintenance, and getting advanced real-time data. Javascript / iOS glue framework
MIT License
21 stars 4 forks source link

[required attention] Huge delay in showing purchase panel #24

Open iosephmagno opened 2 weeks ago

iosephmagno commented 2 weeks ago

Hello, we are under review form Apple and they noticed that purchase panel takes too much to show up.

 await purchaseSku(selectedPlan).then((transaction) { }

 // purchaseSku function
 static Future<GlassfyTransaction?> purchaseSku(GlassfySku sku) async {
    try {
      return await Glassfy.purchaseSku(sku);
    } catch (e) {
      return null;
    }
  }

https://github.com/glassfy/glassfy-flutter/assets/83366073/eceb559e-4a11-498f-8ec8-606378c17afe

When user taps the button we directly call Glassfy.purchaseSk() passing the sku, this methods that takes 3secs against a common delay of 300-900ms.

Probably there is a network delay caused by Glassfy servers or maybe delay with method.channel (since we noticed you communicate with native), can you please have a look? It has a bad impact on user experience and Apple doesn't like it.

iosephmagno commented 2 weeks ago

Added loading animation to button to let you see delay

https://github.com/glassfy/glassfy-flutter/assets/83366073/65ec6d53-280b-4e64-80fd-867ac96220a1

iosephmagno commented 2 weeks ago

We also noticed that an earlier version of the plugin didn't suffer about this issue. In this video can be seen that purchase panel shows up almost instantly at 10:59 https://youtu.be/baIL-QCnkI0?si=Ld8msI8q2qCjjcwO&t=659 So, if it is not due to Sandbox test or Glassfy server delay, taking a look at latest changes to code should be helpful.