revenuecat 0.0.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 72

RevenueCat Flutter plugin #

This is not an official RevenueCat repo. We use this plugin at PostMuse and decided to open source it. We welcome contributions of any kind.

How to use #

  1. Go over to RevenueCat and create an account. Understand what Entitlements are and create the ones you need.

  2. Initialize the plugin

await Purchases.setup("YOUR_API_KEY_HERE", null);

If you have user accounts, the second parameter should be the user id. Leaving that null makes RevenueCat generate ids for you. Read more in the docs

  1. Know if the user is paying This bit is async. You need to listen for changes to the Purchaser Info and find a way to update the app UI to reflect locked/unlocked features.
Purchases.addPurchaseListener(purchaseListener);
Purchases.addPurchaserInfoUpdateListener(purchaserListener);
Purchases.addRestoreTransactionListener(purchaserListener);

We recommend you do this at the highest level in your app and find a way to propagate this info. We use an InheritedWidget to keep this state and listen for changes in another "blocker" widget that updates when the InheritedWidget changes state. The "blocker" widget blocks access to whatever is below it and shows a "PRO" badge on top. This is approach is simplistic but effective, and works for us.

Bottom line is you need to listen for state changes from RevenueCat. Listener structure is found here.

  1. Get the Entitlements
var entitlements = await Purchases.getEntitlements();

Response is a Map with Entitlements, which then contain Offerings, which contain Products. Products contain price, period, introductory price, etc. It's best to look at the models directly to understand more.

  1. Display Products, start payment flow
await Purchases.makePurchase(product.identifier);
  1. RevenueCat will take care of the rest and update your listeners from number 3

License #

Published under MIT License. Read it here

0.0.1 #

  • Initial version, works with iOS and Android subscriptions

example/README.md

revenuecat_example #

Demonstrates how to use the revenuecat plugin.

Getting Started #

For help getting started with Flutter, view our online documentation.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  revenuecat: ^0.0.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:revenuecat/revenuecat.dart';
  
Version Uploaded Documentation Archive
1.0.3 Feb 18, 2019 Go to the documentation of revenuecat 1.0.3 Download revenuecat 1.0.3 archive
1.0.2 Feb 18, 2019 Go to the documentation of revenuecat 1.0.2 Download revenuecat 1.0.2 archive
1.0.1 Feb 18, 2019 Go to the documentation of revenuecat 1.0.1 Download revenuecat 1.0.1 archive
0.0.3 Nov 9, 2018 Go to the documentation of revenuecat 0.0.3 Download revenuecat 0.0.3 archive
0.0.2 Nov 9, 2018 Go to the documentation of revenuecat 0.0.2 Download revenuecat 0.0.2 archive
0.0.1 Nov 9, 2018 Go to the documentation of revenuecat 0.0.1 Download revenuecat 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
57
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
72
Learn more about scoring.

We analyzed this package on Feb 14, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.13
  • Flutter: 1.2.0

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-1 points)

54 out of 54 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/revenuecat.dart. (-0.50 points)

Analysis of lib/revenuecat.dart reported 1 hint:

line 2 col 8: Unused import: 'dart:ui'.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8