{"_id":"@capawesome/capacitor-google-play-services","_rev":"2-1c71729ad9250d6e6a578316683241cb","name":"@capawesome/capacitor-google-play-services","dist-tags":{"latest":"0.1.0"},"versions":{"0.0.1":{"name":"@capawesome/capacitor-google-play-services","version":"0.0.1","keywords":["capacitor","plugin","native","android","capacitor-plugin","google play services","play services","gms","google api availability","play services availability","huawei","hms"],"author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"MIT","_id":"@capawesome/capacitor-google-play-services@0.0.1","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"homepage":"https://capawesome.io/docs/sdks/capacitor/google-play-services/","bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"dist":{"shasum":"a6ae444cef666c05e00719e269fc20286ac7524e","tarball":"https://registry.npmjs.org/@capawesome/capacitor-google-play-services/-/capacitor-google-play-services-0.0.1.tgz","fileCount":28,"integrity":"sha512-ar91h09Sk4xxqMTvo4dY41vaNfpqTQyn1c9mrz6L+i7Dmnk2wtXfG4PAJp4HGFW8PimTqF/mE+WtHgLRG72ZzQ==","signatures":[{"sig":"MEUCIGd++6zVBvK5/2aLNJNyDXd5YUYc/B1J0J9vc0b9A0RXAiEA45msuEYDNjp9KbQflmx3G25zAG59J+8rw0gw5GZ4xJI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":57002},"main":"dist/plugin.cjs.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","funding":[{"url":"https://github.com/sponsors/capawesome-team/","type":"github"},{"url":"https://opencollective.com/capawesome","type":"opencollective"}],"gitHead":"0af28c38a89b8c7d99f350f09b34840f4391803d","scripts":{"fmt":"npm run eslint -- --fix && npm run prettier -- --write","lint":"npm run eslint && npm run prettier -- --check","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api GooglePlayServicesPlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint . --ext ts","verify":"npm run verify:android && npm run verify:web","prettier":"prettier \"**/*.{css,html,ts,js,java}\"","verify:web":"npm run build","prepublishOnly":"npm run build","verify:android":"cd android && ./gradlew clean build test && cd .."},"_npmUser":{"name":"robingenz","email":"mail@robingenz.dev"},"capacitor":{"android":{"src":"android"}},"repository":{"url":"git+https://github.com/capawesome-team/capacitor-plugins.git","type":"git"},"_npmVersion":"11.13.0","description":"Capacitor plugin to check the availability of Google Play Services on Android and prompt the user to install or update it.","directories":{},"_nodeVersion":"24.16.0","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"8.57.0","rimraf":"6.1.2","rollup":"4.62.3","typescript":"5.9.3","@capacitor/cli":"8.4.2","@capacitor/core":"8.0.0","@capacitor/docgen":"0.3.1","@capacitor/android":"8.0.0","@ionic/eslint-config":"0.4.0","prettier-plugin-java":"2.9.7"},"peerDependencies":{"@capacitor/core":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/capacitor-google-play-services_0.0.1_1788525081885_0.1900739633173114","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@capawesome/capacitor-google-play-services","version":"0.1.0","description":"Capacitor plugin to check the availability of Google Play Services on Android and prompt the user to install or update it.","main":"dist/plugin.cjs.js","module":"dist/esm/index.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/capawesome-team/capacitor-plugins.git"},"bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"funding":[{"type":"github","url":"https://github.com/sponsors/capawesome-team/"},{"type":"opencollective","url":"https://opencollective.com/capawesome"}],"homepage":"https://capawesome.io/docs/sdks/capacitor/google-play-services/","keywords":["capacitor","plugin","native","android","capacitor-plugin","google play services","play services","gms","google api availability","play services availability","huawei","hms"],"scripts":{"verify":"npm run verify:android && npm run verify:web","verify:android":"cd android && ./gradlew clean build test && cd ..","verify:web":"npm run build","lint":"npm run eslint && npm run prettier -- --check","fmt":"npm run eslint -- --fix && npm run prettier -- --write","eslint":"eslint . --ext ts","prettier":"prettier \"**/*.{css,html,ts,js,java}\"","docgen":"docgen --api GooglePlayServicesPlugin --output-readme README.md --output-json dist/docs.json","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","prepublishOnly":"npm run build"},"devDependencies":{"@capacitor/android":"8.0.0","@capacitor/cli":"8.4.2","@capacitor/core":"8.0.0","@capacitor/docgen":"0.3.1","@ionic/eslint-config":"0.4.0","eslint":"8.57.0","prettier-plugin-java":"2.9.7","rimraf":"6.1.2","rollup":"4.62.3","typescript":"5.9.3"},"peerDependencies":{"@capacitor/core":">=8.0.0"},"eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"capacitor":{"android":{"src":"android"}},"publishConfig":{"access":"public"},"gitHead":"67a29d24e4ee9cf112a2bcb234a59b2e28e8d3f1","_id":"@capawesome/capacitor-google-play-services@0.1.0","_nodeVersion":"24.20.0","_npmVersion":"11.19.0","dist":{"integrity":"sha512-u0sPJrWGWTsuwzmTBZoTFIP+Gt2XxxeKl8RH/lJRZWkdgN8Vj8l0jDDOH3wcUnlNPquUzBGpbu8O0UwB/g7+MQ==","shasum":"eceb9e4fe328b4944dfed4f44ecf7e76ad480500","tarball":"https://registry.npmjs.org/@capawesome/capacitor-google-play-services/-/capacitor-google-play-services-0.1.0.tgz","fileCount":28,"unpackedSize":57002,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capawesome%2fcapacitor-google-play-services@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDHjzS8aBRD1ka1DXVSWuiiXahvI7bIweN6qiieepxWtwIhALSJoSKLXrHlnjH6OXnJF99LL9LaFBChzJdx8njcj1Vq"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:79dc0800-774e-42fc-bb30-3d3272ec47ea"}},"directories":{},"maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/capacitor-google-play-services_0.1.0_1788539277095_0.6054816159067717"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-04T12:31:21.659Z","modified":"2026-09-04T16:27:57.558Z","0.0.1":"2026-09-04T12:31:22.033Z","0.1.0":"2026-09-04T16:27:57.212Z"},"bugs":{"url":"https://github.com/capawesome-team/capacitor-plugins/issues"},"author":{"name":"Robin Genz","email":"mail@robingenz.dev"},"license":"MIT","homepage":"https://capawesome.io/docs/sdks/capacitor/google-play-services/","keywords":["capacitor","plugin","native","android","capacitor-plugin","google play services","play services","gms","google api availability","play services availability","huawei","hms"],"repository":{"type":"git","url":"git+https://github.com/capawesome-team/capacitor-plugins.git"},"description":"Capacitor plugin to check the availability of Google Play Services on Android and prompt the user to install or update it.","maintainers":[{"name":"robingenz","email":"mail@robingenz.dev"}],"readme":"# Capacitor Google Play Services Plugin\n\nUnofficial Capacitor plugin to check the availability of Google Play Services on Android and prompt the user to install or update it.[^1]\n\n<div class=\"capawesome-z29o10a\">\n  <a href=\"https://cloud.capawesome.io/\" target=\"_blank\">\n    <img alt=\"Deliver Live Updates to your Capacitor app with Capawesome Cloud\" src=\"https://cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.png?t=1\" />\n  </a>\n</div>\n\n## Features\n\n- ✅ **Availability Check**: Check whether Google Play Services is installed, enabled and up to date.\n- 🔍 **Status**: Find out why Google Play Services is not available, for example on Huawei or AOSP devices.\n- 📲 **Resolution Dialog**: Prompt the user to install, enable or update Google Play Services with the system dialog.\n- 🔢 **Version**: Read the version code of the installed Google Play Services APK.\n- 🪶 **Lightweight**: Only depends on the `play-services-base` library, no other Google SDKs.\n- 🔒 **Play Store safe**: Uses only official Google APIs.\n- 🔁 **Up-to-date**: Always supports the latest Capacitor version.\n\nMissing a feature? Just [open an issue](https://github.com/capawesome-team/capacitor-plugins/issues) and we'll take a look!\n\n## Use Cases\n\nThe 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:\n\n- **Graceful degradation**: Hide or disable features that depend on Google Play Services, such as maps or push notifications, on devices without it.\n- **Alternative services**: Fall back to alternative providers, such as Huawei Mobile Services, when Google Play Services is missing.\n- **Update prompts**: Ask the user to update Google Play Services before using a feature that requires a recent version.\n- **Diagnostics**: Include the Google Play Services status and version in bug reports and analytics.\n\n## Compatibility\n\n| Plugin Version | Capacitor Version | Status         |\n| -------------- | ----------------- | -------------- |\n| 0.x.x          | >=8.x.x           | Active support |\n\n## Installation\n\nYou can use our **AI-Assisted Setup** to install the plugin.\nAdd the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:\n\n```bash\nnpx skills add capawesome-team/skills --skill capacitor-plugins\n```\n\nThen use the following prompt:\n\n```\n Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capawesome/capacitor-google-play-services` plugin in my project.\n```\n\nIf you prefer **Manual Setup**, install the plugin by running the following commands and follow the platform-specific instructions below:\n\n```bash\nnpm install @capawesome/capacitor-google-play-services\nnpx cap sync\n```\n\n### Android\n\n#### Variables\n\nIf needed, you can define the following project variable in your app’s `variables.gradle` file to change the default version of the dependency:\n\n- `$androidPlayServicesBaseVersion` version of `com.google.android.gms:play-services-base` (default: `18.10.1`)\n\nThis can be useful if you encounter dependency conflicts with other plugins in your project.\n\n### iOS\n\nThis plugin is not available on iOS.\n\n### Web\n\nThis plugin is not available on the web.\n\n## Configuration\n\nNo configuration required for this plugin.\n\n## Usage\n\nThe 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.\n\n### Check the availability\n\nCheck whether Google Play Services is installed, enabled and up to date before using a feature that depends on it:\n\n```typescript\nimport { GooglePlayServices } from '@capawesome/capacitor-google-play-services';\n\nconst isAvailable = async () => {\n  const { available } = await GooglePlayServices.isAvailable();\n  return available;\n};\n```\n\n### Detect devices without Google Play Services\n\nSome 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:\n\n```typescript\nimport { GooglePlayServices, Status } from '@capawesome/capacitor-google-play-services';\n\nconst getStatus = async () => {\n  const { status } = await GooglePlayServices.getStatus();\n  if (status === Status.ServiceMissing) {\n    console.log('This device has no Google Play Services.');\n  } else if (status !== Status.Success) {\n    console.log('Google Play Services is installed but not usable: ', status);\n  }\n};\n```\n\n### Make Google Play Services available\n\nIf 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:\n\n```typescript\nimport { ErrorCode, GooglePlayServices } from '@capawesome/capacitor-google-play-services';\n\nconst makeAvailable = async () => {\n  try {\n    await GooglePlayServices.makeAvailable();\n    console.log('Google Play Services is now available.');\n  } catch (error) {\n    if (error.code === ErrorCode.Canceled) {\n      console.log('The user dismissed the dialog.');\n    }\n  }\n};\n```\n\n### Get the version\n\nRead the version code of the installed Google Play Services APK, for example to include it in bug reports:\n\n```typescript\nimport { GooglePlayServices } from '@capawesome/capacitor-google-play-services';\n\nconst getVersion = async () => {\n  const { version } = await GooglePlayServices.getVersion();\n  console.log('Google Play Services version: ', version);\n};\n```\n\n## API\n\n<docgen-index>\n\n* [`getStatus()`](#getstatus)\n* [`getVersion()`](#getversion)\n* [`isAvailable()`](#isavailable)\n* [`makeAvailable()`](#makeavailable)\n* [Interfaces](#interfaces)\n* [Enums](#enums)\n\n</docgen-index>\n\n<docgen-api>\n<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->\n\n### getStatus()\n\n```typescript\ngetStatus() => Promise<GetStatusResult>\n```\n\nGet the status of Google Play Services on this device.\n\nUse this method to find out why Google Play Services is not available,\nfor example to distinguish devices without Google Play Services\nfrom devices with an outdated version.\n\nOnly available on Android.\n\n**Returns:** <code>Promise&lt;<a href=\"#getstatusresult\">GetStatusResult</a>&gt;</code>\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### getVersion()\n\n```typescript\ngetVersion() => Promise<GetVersionResult>\n```\n\nGet the version code of the Google Play Services APK installed on this device.\n\nOnly available on Android.\n\n**Returns:** <code>Promise&lt;<a href=\"#getversionresult\">GetVersionResult</a>&gt;</code>\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### isAvailable()\n\n```typescript\nisAvailable() => Promise<IsAvailableResult>\n```\n\nCheck whether Google Play Services is available on this device.\n\nThis resolves to `true` if Google Play Services is installed, enabled and up to date.\n\nOnly available on Android.\n\n**Returns:** <code>Promise&lt;<a href=\"#isavailableresult\">IsAvailableResult</a>&gt;</code>\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### makeAvailable()\n\n```typescript\nmakeAvailable() => Promise<void>\n```\n\nMake Google Play Services available on this device.\n\nIf Google Play Services is missing, disabled, outdated or currently updating,\nthis shows the system dialog that prompts the user to install, enable or update it.\nThe promise resolves once Google Play Services is available.\nIf the user dismisses the dialog, the promise is rejected with the `CANCELED` error code.\nIf Google Play Services can not be made available, for example on devices\nwithout the Google Play Store, the promise is rejected with the error message\nfrom Google Play Services.\n\nOnly available on Android.\n\n**Since:** 0.1.0\n\n--------------------\n\n\n### Interfaces\n\n\n#### GetStatusResult\n\n| Prop         | Type                                      | Description                                        | Since |\n| ------------ | ----------------------------------------- | -------------------------------------------------- | ----- |\n| **`status`** | <code><a href=\"#status\">Status</a></code> | The status of Google Play Services on this device. | 0.1.0 |\n\n\n#### GetVersionResult\n\n| Prop          | Type                | Description                                                                                                                      | Since |\n| ------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ----- |\n| **`version`** | <code>number</code> | 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 |\n\n\n#### IsAvailableResult\n\n| Prop            | Type                 | Description                                                      | Since |\n| --------------- | -------------------- | ---------------------------------------------------------------- | ----- |\n| **`available`** | <code>boolean</code> | Whether or not Google Play Services is available on this device. | 0.1.0 |\n\n\n### Enums\n\n\n#### Status\n\n| Members                            | Value                                          | Description                                                     | Since |\n| ---------------------------------- | ---------------------------------------------- | --------------------------------------------------------------- | ----- |\n| **`ServiceDisabled`**              | <code>'SERVICE_DISABLED'</code>                | Google Play Services is disabled on this device.                | 0.1.0 |\n| **`ServiceInvalid`**               | <code>'SERVICE_INVALID'</code>                 | The installed version of Google Play Services is not authentic. | 0.1.0 |\n| **`ServiceMissing`**               | <code>'SERVICE_MISSING'</code>                 | Google Play Services is not installed on this device.           | 0.1.0 |\n| **`ServiceUpdating`**              | <code>'SERVICE_UPDATING'</code>                | Google Play Services is currently being updated on this device. | 0.1.0 |\n| **`ServiceVersionUpdateRequired`** | <code>'SERVICE_VERSION_UPDATE_REQUIRED'</code> | The installed version of Google Play Services is out of date.   | 0.1.0 |\n| **`Success`**                      | <code>'SUCCESS'</code>                         | Google Play Services is available.                              | 0.1.0 |\n\n</docgen-api>\n\n## FAQ\n\n### How is this plugin different from other similar plugins?\n\nIt 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.\n\n### Does this plugin work on iOS or Web?\n\nNo, 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.\n\n### Does this plugin crash on devices without Google Play Services?\n\nNo. 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.\n\n### How do I detect devices without Google Play Services, such as Huawei devices?\n\nCall 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](#detect-devices-without-google-play-services).\n\n### Why does `makeAvailable()` not work on my device?\n\nThe 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`.\n\n### Can I check the availability of a specific Google API, such as Maps or Location?\n\nNo, the plugin only checks the availability of Google Play Services as a whole. Individual Google APIs are covered by dedicated plugins.\n\n### Can I use this plugin with Ionic, React, Vue or Angular?\n\nYes, 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.\n\n## Related Plugins\n\n- [App Integrity](https://capawesome.io/docs/sdks/capacitor/app-integrity/): Verify app and device integrity using the Play Integrity API and App Attest.\n- [App Update](https://capawesome.io/docs/sdks/capacitor/app-update/): Check for app updates and start in-app updates.\n- [Google Sign-In](https://capawesome.io/docs/sdks/capacitor/google-sign-in/): Sign in with Google on Android, iOS and Web.\n\n## Newsletter\n\nStay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our [Capawesome Newsletter](https://cloud.capawesome.io/newsletter/).\n\n## Changelog\n\nSee [CHANGELOG.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/google-play-services/CHANGELOG.md).\n\n## License\n\nSee [LICENSE](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/google-play-services/LICENSE).\n\n[^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.\n","readmeFilename":"README.md"}