How to use the @ionic-native/core.Cordova function in @ionic-native/core

To help you get started, we’ve selected a few @ionic-native/core 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 ionic-team / ionic-native / src / @ionic-native / plugins / device-feedback / index.ts View on Github external
*/
@Plugin({
  pluginName: 'DeviceFeedback',
  plugin: 'cordova-plugin-velda-devicefeedback',
  pluginRef: 'plugins.deviceFeedback',
  repo: 'https://github.com/VVelda/device-feedback',
  platforms: ['Android']
})
@Injectable({
  providedIn: 'root'
})
export class DeviceFeedback extends IonicNativePlugin {
  /**
   * Provide sound feedback to user, nevertheless respect user's settings and current active device profile as native feedback do.
   */
  @Cordova({ sync: true })
  acoustic(): void {}

  /**
   * Provide vibrate feedback to user, nevertheless respect user's tactile feedback setting as native feedback do.
   * @param {number} type Specify type of vibration feedback. 0 for long press, 1 for virtual key, or 3 for keyboard tap.
   */
  @Cordova({ sync: true })
  haptic(type: number): void {}

  /**
   * Check if haptic and acoustic feedback is enabled by user settings.
   * @returns {Promise}
   */
  @Cordova()
  isFeedbackEnabled(): Promise {
    return;
github ionic-team / ionic-native / src / @ionic-native / plugins / serial / index.ts View on Github external
pluginName: 'Serial',
  plugin: 'cordovarduino',
  pluginRef: 'serial',
  repo: 'https://github.com/xseignard/cordovarduino',
  platforms: ['Android', 'Ubuntu']
})
@Injectable()
export class Serial extends IonicNativePlugin {

  /**
   * Request permission to connect to a serial device
   *
   * @param options {SerialPermissionOptions} Options used to request serial permissions for an unknown device
   * @return {Promise} Returns a promise that resolves when permissions are granted
   */
  @Cordova({
    successIndex: 1,
    errorIndex: 2
  })
  requestPermission(options?: SerialPermissionOptions): Promise { return; }

  /**
   * Open connection to a serial device
   *
   * @param options {SerialOpenOptions} Options used to open serial connection
   * @return {Promise} Returns a promise that resolves when the serial connection is opened
   */
  @Cordova()
  open(options: SerialOpenOptions): Promise { return; }

  /**
   * Write to a serial connection
github ionic-team / ionic-native / src / @ionic-native / plugins / local-notifications / index.ts View on Github external
}

  /**
   * Get the type (triggered, scheduled) for the notification.
   * @param {number} id The ID of the notification.
   */
  @Cordova()
  getType(id: number): Promise {
    return;
  }

  /**
   * Get all the notification ids
   * @returns {Promise>}
   */
  @Cordova()
  getIds(): Promise {
    return;
  }

  /**
   * Get the ids of scheduled notifications
   * @returns {Promise} Returns a promise
   */
  @Cordova()
  getScheduledIds(): Promise {
    return;
  }

  /**
   * Get the ids of triggered notifications
   * @returns {Promise>}
github ionic-team / ionic-native / src / @ionic-native / plugins / diagnostic / index.ts View on Github external
/**
   * Checks if NFC is available to the app. Returns true if the device has NFC capabilities AND if NFC setting is switched on.
   * Note: this operation does not require NFC permission in the manifest.
   * @returns {Promise}
   */
  @Cordova({ platforms: ['Android'] })
  isNFCAvailable(): Promise {
    return;
  }

  /**
   * Registers a function to be called when a change in NFC state occurs. Pass in a falsy value to de-register the currently registered function.
   * @param {Function} hander callback function to be called when NFC state changes
   * @returns {Promise}
   */
  @Cordova({
    platforms: ['Android'],
    sync: true
  })
  registerNFCStateChangeHandler(handler: Function): void {}

  /**
   * Checks if the device data roaming setting is enabled.
   * @returns {Promise}
   */
  @Cordova({ platforms: ['Android'] })
  isDataRoamingEnabled(): Promise {
    return;
  }

  /**
   * Checks if the device setting for ADB(debug) is switched on.
github ionic-team / ionic-native / src / @ionic-native / plugins / music-controls / index.ts View on Github external
updateIsPlaying(isPlaying: boolean): void {}

  /**
   * Update elapsed time, optionally toggle play/pause:
   * @param args {Object}
   */
  @Cordova({
    platforms: ['iOS']
  })
  updateElapsed(args: { elapsed: number; isPlaying: boolean }): void {}

  /**
   * Toggle dismissable:
   * @param dismissable {boolean}
   */
  @Cordova()
  updateDismissable(dismissable: boolean): void {}
}
github ionic-team / ionic-native / src / @ionic-native / plugins / call-number / index.ts View on Github external
* @param {string} numberToCall The phone number to call as a string
   * @param {boolean} bypassAppChooser Set to true to bypass the app chooser and go directly to dialer
   * @return {Promise}
   */
  @Cordova({
    callbackOrder: 'reverse'
  })
  callNumber(numberToCall: string, bypassAppChooser: boolean): Promise {
    return;
  }

  /**
   * Check if call feature is available
   * @return {Promise}
   */
  @Cordova()
  isCallSupported(): Promise {
    return;
  }
}
github ionic-team / ionic-native / src / @ionic-native / plugins / ibeacon / index.ts View on Github external
*/
  @Cordova({ otherPromise: true })
  getAuthorizationStatus(): Promise {
    return;
  }

  /**
   * For iOS 8 and above only. The permission model has changed by Apple in iOS 8, making it necessary for apps to
   * explicitly request permissions via methods like these:
   * <a href="https://developer.apple.com/library/prerelease/iOS/documentation/CoreLocation/Reference/CLLocationManager_Class/index.html#//apple_ref/occ/instm/CLLocationManager/requestWhenInUseAuthorization">requestWhenInUseAuthorization</a>
   * <a href="https://developer.apple.com/library/prerelease/iOS/documentation/CoreLocation/Reference/CLLocationManager_Class/index.html#//apple_ref/occ/instm/CLLocationManager/requestAlwaysAuthorization">requestAlwaysAuthorization</a>
   *
   * If you are using this plugin on Android devices only, you will never have to use this, nor {@code requestAlwaysAuthorization}
   * @returns {Promise} Returns a promise that is resolved when the request dialog is shown.
   */
  @Cordova({ otherPromise: true })
  requestWhenInUseAuthorization(): Promise {
    return;
  }

  /**
   * See the documentation of {@code requestWhenInUseAuthorization} for further details.
   *
   * @returns {Promise} Returns a promise which is resolved when the native layer
   * shows the request dialog.
   */
  @Cordova({ otherPromise: true })
  requestAlwaysAuthorization(): Promise {
    return;
  }

  /**
github ionic-team / ionic-native / src / @ionic-native / plugins / app-minimize / index.ts View on Github external
*/
@Plugin({
  pluginName: 'AppMinimize',
  plugin: 'cordova-plugin-appminimize',
  pluginRef: 'plugins.appMinimize',
  repo: 'https://github.com/tomloprod/cordova-plugin-appminimize',
  platforms: ['Android']
})
@Injectable()
export class AppMinimize extends IonicNativePlugin {

  /**
   * Minimizes the application
   * @return {Promise}
   */
  @Cordova()
  minimize(): Promise {
    return;
  }

}
github ionic-team / ionic-native / src / @ionic-native / plugins / android-exoplayer / index.ts View on Github external
}

  /**
   * Show the controller.
   * @return {Promise}
   */
  @Cordova()
  showController(): Promise {
    return;
  }

  /**
   * Hide the controller.
   * @return {Promise}
   */
  @Cordova()
  hideController(): Promise {
    return;
  }

  /**
   * Update the controller configuration.
   * @param {AndroidExoPlayerControllerConfig} controller Configuration of the controller.
   * @return {Promise}
   */
  @Cordova()
  setController(controller: AndroidExoPlayerControllerConfig): Promise {
    return;
  }

  /**
   * Close and dispose of player, call before destroy.
github ionic-team / ionic-native / src / @ionic-native / plugins / native-keyboard / index.ts View on Github external
@Injectable()
export class NativeKeyboard extends IonicNativePlugin {

  /**
   * Show messenger
   * @param options {NativeKeyboardOptions}
   */
  @Cordova({ sync: true })
  showMessenger(options: NativeKeyboardOptions): void {
  }

  /**
   * Hide messenger
   * @param options {NativeKeyboardOptions}
   */
  @Cordova({ sync: true })
  hideMessenger(options: NativeKeyboardOptions): void {
  }

  /**
   * Programmatically pop up the keyboard again if the user dismissed it.
   * @return {Promise}
   */
  @Cordova()
  showMessengerKeyboard(): Promise {
    return;
  }

  /**
   * Programmatically hide the keyboard (but not the messenger bar)
   */
  @Cordova()