joellobo / flutter-google-api-availability

Check the availability of Google Play services on the current device

Home Page:https://baseflow.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flutter Google Api Availability Plugin

pub package Build status codecov

A Flutter plugin to check the availability of Google Play services on the current device.

Features

  • Check the availability of Google Play services (on Android only).

Usage

To use this plugin, add google_api_availability as a dependency in your pubspec.yaml file. For example:

dependencies:
  google_api_availability: ^3.0.1

NOTE: There's a known issue with integrating plugins that use Swift into a Flutter project created with the Objective-C template. See issue Flutter#16049 for help on integration.

API

GoogleApiAvailability

To check the availability of Google Play services on the current device, you can use the checkGooglePlayServicesAvailability method. This could be helpful to provide a more friendly experience to users in case an user-action is required to enable support for Google Play services (More information can be found here).

import `package:google_api_availability/google_api_availability.dart`;

GooglePlayServicesAvailability availability = await GoogleApiAvailability.instance.checkGooglePlayServicesAvailability();

If you want to show a dialog by the Android system with more information and show a possible fix to the user you can do:

import `package:google_api_availability/google_api_availability.dart`;

GooglePlayServicesAvailability availability = await GoogleApiAvailability.instance.checkGooglePlayServicesAvailability(true);

Note that on iOS this will always return notAvailableOnPlatform!

See also the example project for a complete implementation.

Issues

Please file any issues, bugs or feature request as an issue on our GitHub page.

Want to contribute

If you would like to contribute to the plugin (e.g. by improving the documentation, solving a bug or adding a cool new feature), please carefully review our contribution guide and send us your pull request.

Author

This Google Api Availability plugin for Flutter is developed by Baseflow. You can contact us at hello@baseflow.com

About

Check the availability of Google Play services on the current device

https://baseflow.com

License:MIT License


Languages

Language:Dart 83.3%Language:Ruby 9.6%Language:Shell 7.1%