npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@capawesome/capacitor-google-play-services

v0.1.0

Published

Capacitor plugin to check the availability of Google Play Services on Android and prompt the user to install or update it.

Readme

Capacitor Google Play Services Plugin

Unofficial Capacitor plugin to check the availability of Google Play Services on Android and prompt the user to install or update it.[^1]

Features

  • ✅ Availability Check: Check whether Google Play Services is installed, enabled and up to date.
  • 🔍 Status: Find out why Google Play Services is not available, for example on Huawei or AOSP devices.
  • 📲 Resolution Dialog: Prompt the user to install, enable or update Google Play Services with the system dialog.
  • 🔢 Version: Read the version code of the installed Google Play Services APK.
  • 🪶 Lightweight: Only depends on the play-services-base library, no other Google SDKs.
  • 🔒 Play Store safe: Uses only official Google APIs.
  • 🔁 Up-to-date: Always supports the latest Capacitor version.

Missing a feature? Just open an issue and we'll take a look!

Use Cases

The Google Play Services plugin is typically used whenever an app depends on Google Play Services and wants to degrade gracefully on devices without it, for example:

  • Graceful degradation: Hide or disable features that depend on Google Play Services, such as maps or push notifications, on devices without it.
  • Alternative services: Fall back to alternative providers, such as Huawei Mobile Services, when Google Play Services is missing.
  • Update prompts: Ask the user to update Google Play Services before using a feature that requires a recent version.
  • Diagnostics: Include the Google Play Services status and version in bug reports and analytics.

Compatibility

| Plugin Version | Capacitor Version | Status | | -------------- | ----------------- | -------------- | | 0.x.x | >=8.x.x | Active support |

Installation

You can use our AI-Assisted Setup to install the plugin. Add the Capawesome Skills to your AI tool using the following command:

npx skills add capawesome-team/skills --skill capacitor-plugins

Then use the following prompt:

 Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capawesome/capacitor-google-play-services` plugin in my project.

If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:

npm install @capawesome/capacitor-google-play-services
npx cap sync

Android

Variables

If needed, you can define the following project variable in your app’s variables.gradle file to change the default version of the dependency:

  • $androidPlayServicesBaseVersion version of com.google.android.gms:play-services-base (default: 18.10.1)

This can be useful if you encounter dependency conflicts with other plugins in your project.

iOS

This plugin is not available on iOS.

Web

This plugin is not available on the web.

Configuration

No configuration required for this plugin.

Usage

The following examples show how to check the availability of Google Play Services, detect devices without it, prompt the user to make it available and read the installed version.

Check the availability

Check whether Google Play Services is installed, enabled and up to date before using a feature that depends on it:

import { GooglePlayServices } from '@capawesome/capacitor-google-play-services';

const isAvailable = async () => {
  const { available } = await GooglePlayServices.isAvailable();
  return available;
};

Detect devices without Google Play Services

Some devices, such as Huawei devices with Huawei Mobile Services or devices with a custom Android build, ship without Google Play Services. Use the getStatus() method to find out why Google Play Services is not available and hide the features that depend on it:

import { GooglePlayServices, Status } from '@capawesome/capacitor-google-play-services';

const getStatus = async () => {
  const { status } = await GooglePlayServices.getStatus();
  if (status === Status.ServiceMissing) {
    console.log('This device has no Google Play Services.');
  } else if (status !== Status.Success) {
    console.log('Google Play Services is installed but not usable: ', status);
  }
};

Make Google Play Services available

If Google Play Services is disabled, outdated or currently updating, prompt the user to fix it with the system dialog. The promise resolves once Google Play Services is available and is rejected with the CANCELED error code if the user dismisses the dialog:

import { ErrorCode, GooglePlayServices } from '@capawesome/capacitor-google-play-services';

const makeAvailable = async () => {
  try {
    await GooglePlayServices.makeAvailable();
    console.log('Google Play Services is now available.');
  } catch (error) {
    if (error.code === ErrorCode.Canceled) {
      console.log('The user dismissed the dialog.');
    }
  }
};

Get the version

Read the version code of the installed Google Play Services APK, for example to include it in bug reports:

import { GooglePlayServices } from '@capawesome/capacitor-google-play-services';

const getVersion = async () => {
  const { version } = await GooglePlayServices.getVersion();
  console.log('Google Play Services version: ', version);
};

API

getStatus()

getStatus() => Promise<GetStatusResult>

Get the status of Google Play Services on this device.

Use this method to find out why Google Play Services is not available, for example to distinguish devices without Google Play Services from devices with an outdated version.

Only available on Android.

Returns: Promise<GetStatusResult>

Since: 0.1.0


getVersion()

getVersion() => Promise<GetVersionResult>

Get the version code of the Google Play Services APK installed on this device.

Only available on Android.

Returns: Promise<GetVersionResult>

Since: 0.1.0


isAvailable()

isAvailable() => Promise<IsAvailableResult>

Check whether Google Play Services is available on this device.

This resolves to true if Google Play Services is installed, enabled and up to date.

Only available on Android.

Returns: Promise<IsAvailableResult>

Since: 0.1.0


makeAvailable()

makeAvailable() => Promise<void>

Make Google Play Services available on this device.

If Google Play Services is missing, disabled, outdated or currently updating, this shows the system dialog that prompts the user to install, enable or update it. The promise resolves once Google Play Services is available. If the user dismisses the dialog, the promise is rejected with the CANCELED error code. If Google Play Services can not be made available, for example on devices without the Google Play Store, the promise is rejected with the error message from Google Play Services.

Only available on Android.

Since: 0.1.0


Interfaces

GetStatusResult

| Prop | Type | Description | Since | | ------------ | ----------------------------------------- | -------------------------------------------------- | ----- | | status | Status | The status of Google Play Services on this device. | 0.1.0 |

GetVersionResult

| Prop | Type | Description | Since | | ------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ----- | | version | number | The version code of the Google Play Services APK installed on this device. This is 0 if Google Play Services is not installed. | 0.1.0 |

IsAvailableResult

| Prop | Type | Description | Since | | --------------- | -------------------- | ---------------------------------------------------------------- | ----- | | available | boolean | Whether or not Google Play Services is available on this device. | 0.1.0 |

Enums

Status

| Members | Value | Description | Since | | ---------------------------------- | ---------------------------------------------- | --------------------------------------------------------------- | ----- | | ServiceDisabled | 'SERVICE_DISABLED' | Google Play Services is disabled on this device. | 0.1.0 | | ServiceInvalid | 'SERVICE_INVALID' | The installed version of Google Play Services is not authentic. | 0.1.0 | | ServiceMissing | 'SERVICE_MISSING' | Google Play Services is not installed on this device. | 0.1.0 | | ServiceUpdating | 'SERVICE_UPDATING' | Google Play Services is currently being updated on this device. | 0.1.0 | | ServiceVersionUpdateRequired | 'SERVICE_VERSION_UPDATE_REQUIRED' | The installed version of Google Play Services is out of date. | 0.1.0 | | Success | 'SUCCESS' | Google Play Services is available. | 0.1.0 |

FAQ

How is this plugin different from other similar plugins?

It focuses on one thing: telling your app whether Google Play Services can be used on the current device and, if not, why. It wraps the official GoogleApiAvailability API in a small, fully typed plugin that only depends on the play-services-base library, so you can degrade gracefully on devices without Google Play Services without pulling in Firebase, Maps or any other Google SDK. Actively maintained against the latest Capacitor version, it pairs naturally with the App Integrity, App Update and Google Sign-In plugins.

Does this plugin work on iOS or Web?

No, this plugin only provides an Android implementation. Google Play Services does not exist on other platforms, so all methods are rejected with the UNIMPLEMENTED error code on iOS and Web. Check the platform with Capacitor.getPlatform() before calling the plugin in a cross-platform app.

Does this plugin crash on devices without Google Play Services?

No. The availability check is part of the play-services-base library that is bundled with your app. It only asks the package manager whether Google Play Services is installed and signed by Google, so it works on any Android device, including devices without Google Play Services.

How do I detect devices without Google Play Services, such as Huawei devices?

Call the getStatus() method. It resolves to SERVICE_MISSING on devices where Google Play Services is not installed at all, which is the case for Huawei devices with Huawei Mobile Services, Amazon Fire devices and custom Android builds. See Detect devices without Google Play Services.

Why does makeAvailable() not work on my device?

The system dialog can only enable or update Google Play Services if it is already installed, or install it via the Google Play Store. On devices without the Google Play Store, such as Huawei devices with Huawei Mobile Services, there is no way to install Google Play Services and the promise is rejected. Check the status with the getStatus() method first and only call makeAvailable() if the status is SERVICE_DISABLED, SERVICE_VERSION_UPDATE_REQUIRED or SERVICE_UPDATING.

Can I check the availability of a specific Google API, such as Maps or Location?

No, the plugin only checks the availability of Google Play Services as a whole. Individual Google APIs are covered by dedicated plugins.

Can I use this plugin with Ionic, React, Vue or Angular?

Yes, the plugin is framework-agnostic. It works in any Capacitor app regardless of the web framework, including Ionic with Angular, React, or Vue, as well as plain JavaScript projects.

Related Plugins

  • App Integrity: Verify app and device integrity using the Play Integrity API and App Attest.
  • App Update: Check for app updates and start in-app updates.
  • Google Sign-In: Sign in with Google on Android, iOS and Web.

Newsletter

Stay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our Capawesome Newsletter.

Changelog

See CHANGELOG.md.

License

See LICENSE.

[^1]: This project is not affiliated with, endorsed by, sponsored by, or approved by Google LLC or any of its affiliates or subsidiaries. "Google Play" is a trademark of Google LLC.