RevenueCat / purchases-flutter

Flutter plugin for in-app purchases and subscriptions. Supports iOS, macOS and Android.
https://www.revenuecat.com/
MIT License
607 stars 168 forks source link

Web support ? #1124

Closed dleurs closed 2 months ago

dleurs commented 2 months ago

How to handle web ?

It is an issue for my app Trompe / trompe.fr

I don't necessary need to process web payment, but users which have purchased a premium subscription should also access Premium features on web

RCGitBot commented 2 months ago

👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

dleurs commented 2 months ago

I found a work-around with linking firebase firestore and revenuecat :

class RevenueCatEntitlement {
  String? expires_date;
  String? grace_period_expires_date;
  String? product_identifier;
  String? purchase_date;

  bool get isSubActive {
    try {
      if (expires_date.isNullOrEmpty) {
        return false;
      }
      DateTime expiresDate = DateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").parseUtc(expires_date!); // Dateformat from ChatGPT based on "2024-07-30T11:28:16Z"
      DateTime now = DateTime.now().toUtc();
      bool isSubActive = expiresDate.isAfter(now);
      return isSubActive;
    } catch (e) {
      developer.log("Issue RevenueCatEntitlement isSubActive : $e");
      return false;
    }
  }
nyeu commented 2 months ago

Hi @dleurs, We have discussed adding support for Flutter Web internally previously, but I'll go ahead and share your feature request with the rest of the team to raise the feature again. While we don't have a concrete roadmap or ETA yet, the team will work to get this prioritized. Since you found a workaround I'll go ahead and close the ticket but feel free to reopen it if you have any question.

Tananga commented 1 week ago

Stripe have Web support

Pebsie commented 3 days ago

Now that RevenueCat has a built-in web payment provider, is this something that might be considered returning to?