New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

cordova-hmsgmschecker-plugin

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-hmsgmschecker-plugin

Use this plugin to check if an android device has the `Huawei Services` available or `Google Services`

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

Cordova Check Huawei/Google Services Availability

Use this plugin to check if an android device has the Huawei Services available. It would be helpful if you want to check if the device is a Huawei without Google Services.

Install

cordova plugin add https://github.com/angelcamacho34/cordova-HMSGMS-Checker-plugin

or

cordova plugin add cordova-hmsgmschecker-plugin

Usage in Javascript

// available => Android

HMSGMSChecker.isHMSAvailable(successCallback, failureCallback)
  • successCallback({ status: boolean}) status will be true if the device is a Huawei device
  • failureCallback(error:string) is called if there was an error checking if the device has not Huawei Services.
HMSGMSChecker.isGMSAvailable(successCallback, failureCallback)
  • successCallback({ status: boolean}) status will be true if the device is a Google device
  • failureCallback(error:string) is called if there was an error checking if the device has not Google Services.

Usage in Ionic

On service or component when you are going to use the plugin:

 declare const HMSGMSChecker;

 @Component({...}) //It could be a @Injectable()
 export class Component {

    validateHuaweiServices() {
      return new Promise((res, rej) => {
        HMSGMSChecker.isHMSAvailable(
          ({ status }) => res(status),
          (err) => rej(err)
        )
      })
    }

    yourFunc() {
      this.validateHuaweiServices()
        .then(...)
        .catch(...)
    }
 }

Contributing

  • Fork it
  • Create your feature branch (git checkout -b feature/my-feature)
  • Commit your changes (git commit -am 'Changes description')
  • Push to the branch (git push origin feature/my-feature)
  • Create new Pull Request

Keywords

ecosystem:cordova

FAQs

Package last updated on 19 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts