qonversion_flutter 0.2.5

  • Readme
  • Changelog
  • Example
  • Installing
  • 70

Get access to the powerful yet simple subscription analytics:

  • Conversion from install to paying user, MRR, LTV, churn and other metrics.
  • Feed the advertising and analytics tools you are already using with the data on high-value users to improve your ads targeting and marketing ROAS.

Pub

Installation #

To use Qonversion in your Flutter app, add qonversion as a dependency in your pubspec.yaml file:

dependencies:
  qonversion_flutter: ^0.2

Run flutter pub get to install dependency.

Usage #

You need to configure Qonversion once at a starting point of your app.

For example, launch Qonversion in initState of your top level widget:

...
import 'package:qonversion_flutter/qonversion.dart';

...

@override
void initState() {
  super.initState();
  Qonversion.launchWith(
    iosApiKey: 'YOUR_IOS_API_KEY',
    androidApiKey: 'YOUR_ANDROID_API_KEY',
    onComplete: (uid) => print(uid),
  );
}

...

Usually Qonversion will track purchases automatically.

Still, there are few ways to launch Qonversion:

  1. Launches Qonversion SDK with the given API keys for each platform: [androidApiKey] and [iosApiKey] respectively. [onComplete] will return uid for Ads integrations.
static Future<void> launchWith({
  String androidApiKey,
  String iosApiKey,
  void Function(String) onComplete,
})
  1. Same as previous but allows you to specify client side userid (instead of Qonversion user-id) that will be used for matching data in the third party data:
static Future<void> launchWithClientSideUserId(
    String userID, {
    String androidApiKey,
    String iosApiKey,
})
  1. Under development. Same as previous but allows you to turn off auto tracking purchases and track it manually.
static Future<void> launchWithAutoTrackPurchases(
    bool autoTrackPurchases, {
    String androidApiKey,
    String iosApiKey,
    void Function(String) onComplete,
})

License #

Qonversion SDK is available under the MIT license.

0.2.5 #

  • Fix Android error handling

0.2.4 #

  • Bump Android SDK Version

0.2.3 #

  • Bump required Flutter version up

0.2.2 #

  • Add link to GitHub repository to pubspec.yaml

0.2.1 #

  • Minor documentation updates

0.2.0 #

  • Release 0.2.0

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:qonversion_flutter/qonversion.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _uid = 'Not Initialized Qonversion Yet';

  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  Future<void> initPlatformState() async {
    String uid;
    try {
      await Qonversion.launchWith(
        iosApiKey: '',
        androidApiKey: '',
        onComplete: (receivedUid) {
          uid = receivedUid;
          print(uid);
        },
      );
    } catch (e) {
      print('Failed to obtain uid from Qonversion.');
      print(e);
    }
    if (!mounted) return;

    setState(() => _uid = uid);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Qonversion example app'),
        ),
        body: Center(
          child: Text(
            'Qonversion uid: \n$_uid\n',
            textAlign: TextAlign.center,
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  qonversion_flutter: ^0.2.5

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:qonversion_flutter/qonversion.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
47
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
82
Overall:
Weighted score of the above. [more]
70
Learn more about scoring.

We analyzed this package on May 26, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.1
  • pana: 0.13.8-dev
  • Flutter: 1.17.0

Maintenance suggestions

The package description is too short. (-18 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.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test