RevenueCat / RevenueCat/purchases-flutter

Purchases.purchasePackage(package) takes too long

Open
#693 37 comments 18 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Dart
Stars
720
Forks
209
Avg merge
11h 29m
Merged PRs (30d)
30

Description

Environment

  • Output of flutter doctor
    `[✓] Flutter (Channel stable, 3.7.12, on macOS 13.0.1 22A400 darwin-x64, locale en-GB)
    • Flutter version 3.7.12 on channel stable at /Users/mac/Code/Flutter/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4d9e56e694 (4 weeks ago), 2023-04-17 21:47:46 -0400
    • Engine revision 1a65d409c7
    • Dart version 2.19.6
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at /Users/mac/Library/Android/sdk
• Platform android-33, build-tools 33.0.0
• Java binary at: /Library/Internet
Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java
• Java version Java(TM) SE Runtime Environment (build 1.8.0_361-b09)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14E222b
• CocoaPods version 1.12.1

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (not installed)
• Android Studio not found; download from
https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for
detailed instructions).

[✓] VS Code (version 1.78.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.64.0

[✓] Connected device (3 available)
• iPhone 14 Pro Max (mobile) • 0BC2EBC6-CF53-4D82-96C2-16475ED01166 • ios •
com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
• macOS (desktop) • macos • darwin-x64 •
macOS 13.0.1 22A400 darwin-x64
• Chrome (web) • chrome • web-javascript •
Google Chrome 113.0.5672.126

[✓] HTTP Host Availability
• All required HTTP hosts are available`

  • Version of purchases-flutter

4.12.0

  • Testing device version e.g.: iOS 15.5, Android API 30, etc.

iOS 16.4

  • How often the issue occurs- every one of your customers is impacted? Only in dev?
    DEV AND PROD

  • Debug logs that reproduce the issue

  • Steps to reproduce, with a description of expected vs. actual behavior
    Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)

Describe the bug

Our flutter/ios app is taking ~8 seconds to load the iOS payment page, on android it is instantaneous. The purchase goes through after the delay but the response also taker longer. This has barred us from deploying the app to apple store.

Additional context

Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Purchases.purchasePackage(package) entry point in the purchases-flutter plugin and compare the iOS purchase flow with Android. Reproduce the reported delay using purchases-flutter 4.12.0 on iOS 16.4, then gather debug logs and establish that purchase initiation and the response no longer take about eight seconds.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter, ios
Domain
mobile, payments
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.