How to use the cozy-device-helper.hasNetworkInformationPlugin function in cozy-device-helper

To help you get started, we’ve selected a few cozy-device-helper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cozy / cozy.github.io / en / cozy-realtime / src / CozyRealtime.js View on Github external
constructor(options) {
    this.client = getCozyClientFromOptions(options)
    this.subscriptions = new SubscriptionList()
    this.retryManager = new RetryManager({
      raiseErrorAfterAttempts,
      timeBeforeSuccessful,
      baseWaitAfterFirstFailure,
      maxWaitBetweenRetries
    })
    this.retryManager.on('error', err => this.emit('error', err))
    this.bindEventHandlers()
    if (isCordova() && !hasNetworkInformationPlugin()) {
      logger.warn(
        `This seems a Cordova app and cordova-plugin-network-information doesn't seem to be installed. Please install it from https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-network-information/ to support online and offline events.`
      )
    }
  }