GithubHelp home page GithubHelp logo

checkhuaweiservices's Introduction

Cordova Check Huawei 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/hernangiraldo/CheckHuaweiServices.git

or

cordova plugin add cordova-plugin-check-huawei-services

Usage in Javascript

// available => iOS + Android

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

Usage in Ionic

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

 declare const CheckHuaweiServices;

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

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

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

Contributing

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

checkhuaweiservices's People

Contributors

hernangiraldo avatar

Stargazers

Delcio Polanco avatar

Watchers

 avatar

Forkers

thanhly q8javax

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.