mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-02-04 00:06:19 +08:00
Compare commits
51 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7df7a557da | ||
|
|
c720bfead1 | ||
|
|
b4102310e7 | ||
|
|
1b84db035f | ||
|
|
37e8eddd86 | ||
|
|
4fb9b949d7 | ||
|
|
66bc034c80 | ||
|
|
593c1ee6ca | ||
|
|
91439be0bd | ||
|
|
4ae50561b4 | ||
|
|
1f0986fa6f | ||
|
|
1be4c1c669 | ||
|
|
c7a6e6625a | ||
|
|
0a7f56d960 | ||
|
|
f7044a08de | ||
|
|
6168eaee47 | ||
|
|
9c925806ed | ||
|
|
3e8211461a | ||
|
|
b2120c68e2 | ||
|
|
1da12b9330 | ||
|
|
4bd6aaba2b | ||
|
|
f396940044 | ||
|
|
6bba72d32a | ||
|
|
d30b534150 | ||
|
|
8edc27079c | ||
|
|
55f9943f86 | ||
|
|
352ad7ab2f | ||
|
|
15bf509ae0 | ||
|
|
6b9f650a19 | ||
|
|
b30883a876 | ||
|
|
caec80b661 | ||
|
|
620289f54b | ||
|
|
5a6246425f | ||
|
|
43b75af58b | ||
|
|
44957e2197 | ||
|
|
c15c11cf95 | ||
|
|
1b429638fe | ||
|
|
99576d823d | ||
|
|
0147704a4f | ||
|
|
f6a7e5fe9b | ||
|
|
ebb47ce591 | ||
|
|
57eabc002a | ||
|
|
24c8d5d627 | ||
|
|
4ceb340630 | ||
|
|
ec8d318280 | ||
|
|
8add83612d | ||
|
|
0beefb3079 | ||
|
|
4d2f720b01 | ||
|
|
d29ca88b18 | ||
|
|
c94dd41f92 | ||
|
|
145577f9bc |
4
.github/CONTRIBUTING.md
vendored
4
.github/CONTRIBUTING.md
vendored
@@ -5,7 +5,7 @@
|
||||
###### Before you submit an issue:
|
||||
* Do a quick search to see if there are similar issues
|
||||
* Make sure that you are waiting for `deviceready` to fire before interacting with any plugin. If you are using Ionic 2, this can be done using [the `Platform.ready()` function](http://ionicframework.com/docs/api/platform/Platform/#ready).
|
||||
* **Check that you are using the latest version of** `ionic-native`, you can install the latest version by running `npm i --save ionic-native@latest`
|
||||
* **Check that you are using the latest version of** `ionic-native`, you can install the latest version by running `npm i --save @ionic-native/core@latest`
|
||||
|
||||
###### Still having problems? submit an issue with the following details:
|
||||
* Short description of the issue
|
||||
@@ -16,4 +16,4 @@
|
||||
## Feature request?
|
||||
Have a plugin you'd like to see supported? Since Ionic Native is a thin wrapper around existing Cordova plugins, adding support for new plugins is as easy as creating a new wrapper for whatever plugin you'd like to add.
|
||||
|
||||
Take a look at our [Developer Guide](https://github.com/driftyco/ionic-native/blob/master/DEVELOPER.md) for more info on adding new plugins.
|
||||
Take a look at our [Developer Guide](https://github.com/driftyco/ionic-native/blob/master/DEVELOPER.md) for more info on adding new plugins.
|
||||
|
||||
28
CHANGELOG.md
28
CHANGELOG.md
@@ -1,3 +1,31 @@
|
||||
<a name="3.5.0"></a>
|
||||
# [3.5.0](https://github.com/driftyco/ionic-native/compare/v3.4.4...v3.5.0) (2017-04-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **core:** fix bug when checking if plugin exists (#1348) ([4bd6aab](https://github.com/driftyco/ionic-native/commit/4bd6aab)), closes [#1348](https://github.com/driftyco/ionic-native/issues/1348)
|
||||
* **media:** fix issue with create method ([6bba72d](https://github.com/driftyco/ionic-native/commit/6bba72d)), closes [#1333](https://github.com/driftyco/ionic-native/issues/1333)
|
||||
* **rollbar:** fix pluginRef ([f396940](https://github.com/driftyco/ionic-native/commit/f396940))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **action-sheet:** update to newest version ([9c92580](https://github.com/driftyco/ionic-native/commit/9c92580))
|
||||
* **background-fetch:** add status method ([6168eae](https://github.com/driftyco/ionic-native/commit/6168eae))
|
||||
|
||||
|
||||
|
||||
<a name="3.4.4"></a>
|
||||
## [3.4.4](https://github.com/driftyco/ionic-native/compare/v3.4.3...v3.4.4) (2017-03-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **push:** hasPermission is part of Push object ([145577f](https://github.com/driftyco/ionic-native/commit/145577f))
|
||||
|
||||
|
||||
|
||||
<a name="3.4.3"></a>
|
||||
## [3.4.3](https://github.com/driftyco/ionic-native/compare/v3.4.2...v3.4.3) (2017-03-29)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ionic-native",
|
||||
"version": "3.4.3",
|
||||
"version": "3.5.0",
|
||||
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
|
||||
@@ -32,7 +32,7 @@ export function checkAvailability(plugin: any, methodName?: string, pluginName?:
|
||||
|
||||
pluginInstance = getPlugin(pluginRef);
|
||||
|
||||
if (!pluginInstance || (!!methodName && pluginInstance[methodName] === 'undefined')) {
|
||||
if (!pluginInstance || (!!methodName && typeof pluginInstance[methodName] === 'undefined')) {
|
||||
if (!window.cordova) {
|
||||
cordovaWarn(pluginName, methodName);
|
||||
return {
|
||||
@@ -54,7 +54,7 @@ export function checkAvailability(plugin: any, methodName?: string, pluginName?:
|
||||
* @private
|
||||
*/
|
||||
export function instanceAvailability(pluginObj: any, methodName?: string): boolean {
|
||||
return pluginObj._objectInstance && (!methodName || pluginObj._objectInstance[methodName] !== 'undefined');
|
||||
return pluginObj._objectInstance && (!methodName || typeof pluginObj._objectInstance[methodName] !== 'undefined');
|
||||
}
|
||||
|
||||
function setIndex(args: any[], opts: any = {}, resolve?: Function, reject?: Function): any {
|
||||
|
||||
@@ -13,6 +13,11 @@ export interface ActionSheetOptions {
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* The subtitle for the actionsheet (IOS only)
|
||||
*/
|
||||
subtitle?: string;
|
||||
|
||||
/**
|
||||
* Theme to be used on Android
|
||||
*/
|
||||
@@ -43,6 +48,10 @@ export interface ActionSheetOptions {
|
||||
*/
|
||||
position?: number[];
|
||||
|
||||
/**
|
||||
* Choose if destructive button will be the last
|
||||
*/
|
||||
destructiveButtonLast: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -65,10 +74,12 @@ export interface ActionSheetOptions {
|
||||
*
|
||||
* const options: ActionSheetOptions = {
|
||||
* title: 'What do you want with this image?',
|
||||
* subtitle: 'Choose an action'
|
||||
* buttonLabels: buttonLabels,
|
||||
* addCancelButtonWithLabel: 'Cancel',
|
||||
* addDestructiveButtonWithLabel: 'Delete',
|
||||
* androidTheme: this.actionSheet.ANDROID_THEMES.THEME_HOLO_DARK
|
||||
* androidTheme: this.actionSheet.ANDROID_THEMES.THEME_HOLO_DARK,
|
||||
* destructiveButtonLast: true
|
||||
* };
|
||||
*
|
||||
* this.actionSheet.show(options).then((buttonIndex: number) => {
|
||||
@@ -83,7 +94,7 @@ export interface ActionSheetOptions {
|
||||
plugin: 'cordova-plugin-actionsheet',
|
||||
pluginRef: 'plugins.actionsheet',
|
||||
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-actionsheet',
|
||||
platforms: ['Android', 'iOS', 'Windows Phone 8']
|
||||
platforms: ['Android', 'iOS', 'Windows Phone 8', 'Browser']
|
||||
})
|
||||
@Injectable()
|
||||
export class ActionSheet {
|
||||
|
||||
@@ -65,7 +65,7 @@ export interface AdMobFreeRewardVideoConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* @name AdbMobFree
|
||||
* @name AdMob Free
|
||||
* @description
|
||||
*
|
||||
* @usage
|
||||
|
||||
@@ -100,4 +100,11 @@ export class BackgroundFetch {
|
||||
})
|
||||
finish(): void { }
|
||||
|
||||
/**
|
||||
* Return the status of the background-fetch
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
status(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ export interface BatteryStatusResponse {
|
||||
*
|
||||
* // watch change in battery status
|
||||
* let subscription = this.batteryStatus.onChange().subscribe(
|
||||
* (status: StatusObject) => {
|
||||
* (status: BatteryStatusResponse) => {
|
||||
* console.log(status.level, status.isPlugged);
|
||||
* }
|
||||
* );
|
||||
|
||||
@@ -134,6 +134,38 @@ export interface CameraPreviewPictureOptions {
|
||||
@Injectable()
|
||||
export class CameraPreview {
|
||||
|
||||
EXPOSURE_MODES = {
|
||||
LOCK: 'lock', // IOS Only
|
||||
AUTO: 'auto', // IOS Only
|
||||
CONTINUOUS: 'continuous',
|
||||
CUSTOM: 'custom'
|
||||
};
|
||||
|
||||
FLASH_MODE = {
|
||||
OFF: 'off',
|
||||
ON: 'on',
|
||||
AUTO: 'auto',
|
||||
RED_EYE: 'red-eye',
|
||||
TORCH: 'torch' // Android Only
|
||||
};
|
||||
|
||||
COLOR_EFFECT = {
|
||||
AQUA: 'aqua', // Android Only
|
||||
BLACKBOARD: 'blackboard', // Android Only
|
||||
MONO: 'mono',
|
||||
NEGATIVE: 'negative',
|
||||
NONE: 'none',
|
||||
POSTERIZE: 'posterize',
|
||||
SEPIA: 'sepia',
|
||||
SOLARIZE: 'solarize', // Android Only
|
||||
WHITEBOARD: 'whiteboard' // Android Only
|
||||
};
|
||||
|
||||
CAMERA_DIRECTION = {
|
||||
BACK: 'back',
|
||||
FRONT: 'front'
|
||||
};
|
||||
|
||||
/**
|
||||
* Starts the camera preview instance.
|
||||
* @param {CameraPreviewOptions} options
|
||||
@@ -149,40 +181,28 @@ export class CameraPreview {
|
||||
* Stops the camera preview instance. (iOS & Android)
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 0,
|
||||
errorIndex: 1
|
||||
})
|
||||
@Cordova()
|
||||
stopCamera(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Switch from the rear camera and front camera, if available.
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 0,
|
||||
errorIndex: 1
|
||||
})
|
||||
@Cordova()
|
||||
switchCamera(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Hide the camera preview box.
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 0,
|
||||
errorIndex: 1
|
||||
})
|
||||
@Cordova()
|
||||
hide(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Show the camera preview box.
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 0,
|
||||
errorIndex: 1
|
||||
})
|
||||
@Cordova()
|
||||
show(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
@@ -220,6 +240,19 @@ export class CameraPreview {
|
||||
})
|
||||
setZoom(zoom?: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get the maximum zoom (Android)
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getMaxZoom(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get current zoom (Android)
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getZoom(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Set the preview Size
|
||||
@@ -228,8 +261,7 @@ export class CameraPreview {
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2,
|
||||
platforms: ['Android']
|
||||
errorIndex: 2
|
||||
})
|
||||
setPreviewSize(dimensions?: CameraPreviewDimensions): Promise<any> { return; }
|
||||
|
||||
@@ -244,4 +276,68 @@ export class CameraPreview {
|
||||
})
|
||||
setFlashMode(flashMode?: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get supported picture sizes
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getSupportedPictureSizes(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get supported flash modes
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getSupportedFlashModes(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get exposure mode
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getExposureMode(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get exposure modes
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getExposureModes(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Set exposure mode
|
||||
* @param [lock] {string}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
setExposureMode(lock?: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get exposure compensation (Android)
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getExposureCompensation(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Set exposure compensation (Android)
|
||||
* @param [exposureCompensation] {number}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
setExposureCompensation(exposureCompensation?: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Get exposure compensation range (Android)
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getExposureCompensationRange(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@ declare var window: any;
|
||||
* ...
|
||||
*
|
||||
* this.filePath.resolveNativePath(path)
|
||||
* .then(filePath => console.log(filePath);
|
||||
* .catch(err => console.log(err);
|
||||
* .then(filePath => console.log(filePath))
|
||||
* .catch(err => console.log(err));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
|
||||
@@ -30,7 +30,7 @@ export interface FingerprintOptions {
|
||||
* ```typescript
|
||||
* import { FingerprintAIO } from '@ionic-native/fingerprint-aio';
|
||||
*
|
||||
* constructor(private faio: FingerpirntAIO) { }
|
||||
* constructor(private faio: FingerprintAIO) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
|
||||
@@ -11,7 +11,7 @@ import { Cordova, Plugin } from '@ionic-native/core';
|
||||
* ```typescript
|
||||
* import { Flashlight } from '@ionic-native/flashlight';
|
||||
*
|
||||
* constructor(private flashlight: FlashLight) { }
|
||||
* constructor(private flashlight: Flashlight) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
|
||||
221
src/@ionic-native/plugins/flurry-analytics/index.ts
Normal file
221
src/@ionic-native/plugins/flurry-analytics/index.ts
Normal file
@@ -0,0 +1,221 @@
|
||||
import { Plugin, Cordova } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
export interface FlurryAnalyticsOptions {
|
||||
/** Flurry API key is required */
|
||||
appKey: string;
|
||||
/**
|
||||
* Overrides the version of the app
|
||||
*/
|
||||
version?: string;
|
||||
/**
|
||||
* How long can the app be paused before a new session is created,
|
||||
* must be less than or equal to five for Android devices
|
||||
*/
|
||||
continueSessionSeconds?: number;
|
||||
/**
|
||||
* Set id of the user
|
||||
*/
|
||||
userId?: string;
|
||||
/**
|
||||
* Set gender of the user
|
||||
* Valid values are "m", "M", "f" and "F"
|
||||
*/
|
||||
gender?: string;
|
||||
/**
|
||||
* Set age of the user
|
||||
*/
|
||||
age?: number;
|
||||
/**
|
||||
* Set error for log
|
||||
* Values: VERBOSE, DEBUG, INFO, WARN, ERROR
|
||||
*/
|
||||
logLevel?: string;
|
||||
/**
|
||||
* Defaults to false
|
||||
*/
|
||||
enableLogging?: boolean;
|
||||
/**
|
||||
* Should every event show up the app's log, defaults to true
|
||||
*/
|
||||
enableEventLogging?: boolean;
|
||||
/**
|
||||
* Should app crashes be recorded in flurry, defaults to false, iOS only
|
||||
*/
|
||||
enableCrashReporting?: boolean;
|
||||
/**
|
||||
* Should the session continue when the app is the background, defaults to false, iOS only
|
||||
*/
|
||||
enableBackgroundSessions?: boolean;
|
||||
/**
|
||||
* Should data be pushed to flurry when the app closes, defaults to true, iOS only
|
||||
*/
|
||||
reportSessionsOnClose?: boolean;
|
||||
/**
|
||||
* Should data be pushed to flurry when the app is paused, defaults to true, iOS only
|
||||
*/
|
||||
reportSessionsOnPause?: boolean;
|
||||
}
|
||||
|
||||
export interface FlurryAnalyticsLocation {
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
/**
|
||||
* Set altitude
|
||||
* It is optional and use only for iOS
|
||||
*/
|
||||
verticalAccuracy?: number;
|
||||
/**
|
||||
* Set radius about 2d point
|
||||
* It is optional and use only for iOS
|
||||
*/
|
||||
horizontalAccuracy?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Flurry Analytics
|
||||
* @description
|
||||
* This plugin connects to Flurry Analytics SDK
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { FlurryAnalytics } from 'ionic-native/flurry-analytics';
|
||||
*
|
||||
* constructor(private flurryAnalytics: FlurryAnalytics) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* constant options: FlurryAnalyticsOptions = {
|
||||
* reportSessionsOnClose: true,
|
||||
* enableLogging: true
|
||||
* }
|
||||
*
|
||||
* FlurryAnalytics.init('12345678965412303214', options)
|
||||
* .then((something: any) => doSomething(something))
|
||||
* .catch((error: any) => console.log(error));
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* FlurryAnalyticsOptions
|
||||
* FlurryAnalyticsLocation
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'FlurryAnalyticsPlugin',
|
||||
plugin: 'cordova-plugin-flurryanalytics',
|
||||
pluginRef: 'fa',
|
||||
repo: 'https://github.com/blakgeek/cordova-plugin-flurryanalytics.git',
|
||||
platforms: ['Android', 'iOS', 'Browser']
|
||||
})
|
||||
@Injectable()
|
||||
export class FlurryAnalytics {
|
||||
|
||||
/**
|
||||
* Set the setting for Flurry Analytics
|
||||
* @param appKey {string} API key is required
|
||||
* @param options {FlurryAnalyticsOptions} is optional
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
init(appKey: string, options?: FlurryAnalyticsOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function set the Event
|
||||
* @param eventName {string} The param to configure name of Event
|
||||
* @param params {Object} optional
|
||||
* @return {Promise<any>} Returns a promise that resolves when event is set
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 0
|
||||
})
|
||||
logEvent(eventName: string, params?: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function start a timed event
|
||||
* @param eventName
|
||||
* @param params {Object} optional
|
||||
* @return {Promise<any>} Returns a promise that resolves when timed event is started tracking
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 0
|
||||
})
|
||||
startTimedEvent(eventName: string, params?: Object): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function complete a timed event
|
||||
* @param eventName
|
||||
* @param params {Object} optional
|
||||
* @return {Promise<any>} Returns a promise that resolves when timed event is ended tracking
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 0
|
||||
})
|
||||
endTimedEvent(eventName: string, params?: Object): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function log an error
|
||||
* @param code
|
||||
* @param message
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 0
|
||||
})
|
||||
logError(code, message): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function log a page view
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
logPageView(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function set the location for the event
|
||||
* (this is will only be used for very course grained statistics like city)
|
||||
* @param location
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 0
|
||||
})
|
||||
setLocation(location: FlurryAnalyticsLocation): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function start the session
|
||||
* Only needed for older versions of Android
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
startSession(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function end the session
|
||||
* Only needed for older versions of Android
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
endSession(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@ declare var window;
|
||||
* this.ga.startTrackerWithId('YOUR_TRACKER_ID')
|
||||
* .then(() => {
|
||||
* console.log('Google analytics is ready now');
|
||||
this.ga.trackView('test');
|
||||
* // Tracker is ready
|
||||
* // You can now track pages or set additional information such as AppVersion or UserId
|
||||
* })
|
||||
|
||||
@@ -384,7 +384,7 @@ export class GoogleMap {
|
||||
* export class MapPage {
|
||||
* constructor(private googleMaps: GoogleMaps) {}
|
||||
*
|
||||
* // Load map only after view is initialize
|
||||
* // Load map only after view is initialized
|
||||
* ngAfterViewInit() {
|
||||
* this.loadMap();
|
||||
* }
|
||||
@@ -1749,7 +1749,7 @@ export interface GeocoderResult {
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Geocoder',
|
||||
pluginRef: 'plugins.google.maps.Geocoder',
|
||||
pluginRef: 'plugin.google.maps.Geocoder',
|
||||
plugin: 'cordova-plugin-googlemaps',
|
||||
repo: ''
|
||||
})
|
||||
|
||||
@@ -12,7 +12,7 @@ import { Cordova, Plugin } from '@ionic-native/core';
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.googlePlus.login()
|
||||
* this.googlePlus.login({})
|
||||
* .then(res => console.log(res))
|
||||
* .catch(err => console.error(err));
|
||||
*
|
||||
|
||||
@@ -1,6 +1,21 @@
|
||||
import { Plugin, Cordova } from '@ionic-native/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
export interface HealthDataType {
|
||||
/**
|
||||
* Read only date types (see https://github.com/dariosalvi78/cordova-plugin-health#supported-data-types)
|
||||
*/
|
||||
read?: string[];
|
||||
|
||||
/**
|
||||
* Write only date types (see https://github.com/dariosalvi78/cordova-plugin-health#supported-data-types)
|
||||
*/
|
||||
write?: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
@@ -154,9 +169,19 @@ export interface HealthData {
|
||||
* ...
|
||||
*
|
||||
* this.health.isAvailable()
|
||||
* .then((available:boolean) => {
|
||||
* console.log(available);
|
||||
* this.health.requestAuthorization([
|
||||
* 'distance', 'nutrition', //read and write permissions
|
||||
* {
|
||||
* read: ['steps'], //read only permission
|
||||
* write: ['height', 'weight'] //write only permission
|
||||
* }
|
||||
* ])
|
||||
* .then(res => console.log(res))
|
||||
* .catch(e => console.log(e));
|
||||
*
|
||||
* })
|
||||
* .catch(e => console.log(e));
|
||||
*
|
||||
* ```
|
||||
* See description at https://github.com/dariosalvi78/cordova-plugin-health for a full list of Datatypes and see examples.
|
||||
@@ -204,7 +229,7 @@ export class Health {
|
||||
promptInstallFit(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Requests read and write access to a set of data types. It is recommendable to always explain why the app
|
||||
* Requests read and/or write access to a set of data types. It is recommendable to always explain why the app
|
||||
* needs access to the data before asking the user to authorize it.
|
||||
* This function must be called before using the query and store functions, even if the authorization has already
|
||||
* been given at some point in the past.
|
||||
@@ -219,22 +244,25 @@ export class Health {
|
||||
* In Android 6 and over, this function will also ask for some dynamic permissions if needed
|
||||
* (e.g. in the case of "distance", it will need access to ACCESS_FINE_LOCATION).
|
||||
*
|
||||
* @param {Array<String>} datatypes a list of data types you want to be granted access to
|
||||
*
|
||||
* @param {Array<string | HealthDataType>} datatypes a list of data types you want to be granted access to.
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
requestAuthorization(datatypes: Array<string>): Promise<any> { return; }
|
||||
requestAuthorization(datatypes: Array<string | HealthDataType>): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Check if the app has authorization to read/write a set of datatypes.
|
||||
* This function is similar to requestAuthorization() and has similar quirks.
|
||||
*
|
||||
* @param {Array<String>} datatypes a list of data types you want to be granted access to
|
||||
* Quirks of isAuthorized()
|
||||
*
|
||||
* In iOS, this function will only check authorization status for writeable data.
|
||||
* Read-only data will always be considered as not authorized. This is an intended behaviour of HealthKit.
|
||||
*
|
||||
* @param {Array<string | HealthDataType>} datatypes a list of data types you want to check access of, same as in requestAuthorization
|
||||
* @return {Promise<boolean>} Returns a promise that resolves with a boolean that indicates the authorization status
|
||||
*/
|
||||
@Cordova()
|
||||
isAuthorized(datatypes: Array<string>): Promise<boolean> { return; }
|
||||
isAuthorized(datatypes: Array<string | HealthDataType>): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Gets all the data points of a certain data type within a certain time window.
|
||||
|
||||
@@ -160,9 +160,8 @@ export class MediaObject {
|
||||
* });
|
||||
*
|
||||
* // get file duration
|
||||
* file.getDuration().then((duration) => {
|
||||
* console.log(position);
|
||||
* });
|
||||
* let duration = file.getDuration();
|
||||
* console.log(duration);
|
||||
*
|
||||
* // skip to 10 seconds (expects int value in ms)
|
||||
* file.seekTo(10000);
|
||||
@@ -182,7 +181,7 @@ export class MediaObject {
|
||||
*
|
||||
* // Recording to a file
|
||||
* this.media.create('path/to/file.mp3')
|
||||
* .then((file: MedieObject) => {
|
||||
* .then((file: MediaObject) => {
|
||||
*
|
||||
* file.startRecord();
|
||||
*
|
||||
@@ -256,8 +255,7 @@ export class MediaPlugin {
|
||||
// Creates a new media object
|
||||
// Resolves with the media object
|
||||
// or rejects with the error
|
||||
const instance = new Media(src, resolve, reject, onStatusUpdate);
|
||||
return resolve(new MediaObject(instance));
|
||||
const instance = new Media(src, () => resolve(new MediaObject(instance)), reject, onStatusUpdate);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ export interface MusicControlsOptions {
|
||||
* ticker : 'Now playing "Time is Running Out"'
|
||||
* });
|
||||
*
|
||||
* this.musicControls.subscribe(action => {
|
||||
* this.musicControls.subscribe().subscribe(action => {
|
||||
*
|
||||
* switch(action) {
|
||||
* case 'music-controls-next':
|
||||
|
||||
@@ -80,6 +80,10 @@ export interface NativeGeocoderReverseResult {
|
||||
* The city.
|
||||
*/
|
||||
city: string;
|
||||
/**
|
||||
* The district.
|
||||
*/
|
||||
district: string;
|
||||
/**
|
||||
* The country name.
|
||||
*/
|
||||
|
||||
@@ -34,6 +34,9 @@ declare let window: any;
|
||||
pluginRef: 'nfc',
|
||||
repo: 'https://github.com/chariotsolutions/phonegap-nfc'
|
||||
})
|
||||
/**
|
||||
*@{ NFC } class methods
|
||||
*/
|
||||
@Injectable()
|
||||
export class NFC {
|
||||
/**
|
||||
@@ -96,7 +99,7 @@ export class NFC {
|
||||
addNdefFormatableListener(onSuccess?: Function, onFailure?: Function): Observable<any> {return; }
|
||||
|
||||
/**
|
||||
* Qrites an NdefMessage to a NFC tag.
|
||||
* Writes an NdefMessage(array of ndef records) to a NFC tag.
|
||||
* @param message {any[]}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@@ -110,7 +113,7 @@ export class NFC {
|
||||
makeReadyOnly(): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Shares an NDEF Message via peer-to-peer.
|
||||
* Shares an NDEF Message(array of ndef records) via peer-to-peer.
|
||||
* @param message An array of NDEF Records.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@@ -146,7 +149,7 @@ export class NFC {
|
||||
stopHandover(): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Show the NFC settings on the device.
|
||||
* Opens the device's NFC settings.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
@@ -159,21 +162,26 @@ export class NFC {
|
||||
@Cordova()
|
||||
enabled(): Promise<any> {return; }
|
||||
/**
|
||||
* Convert bytes to string
|
||||
* @{ NFC } class utility methods
|
||||
* for use with
|
||||
*/
|
||||
/**
|
||||
* Convert byte array to string
|
||||
* @param bytes {number[]}
|
||||
* @returns {string}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
bytesToString(bytes: number[]): string {return; }
|
||||
/**
|
||||
* Convert string to bytes
|
||||
* Convert string to byte array.
|
||||
* @param str {string}
|
||||
* @returns {number[]}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
stringToBytes(str: string): number[] {return; };
|
||||
/**
|
||||
* Convert bytes to hex string
|
||||
* Convert byte array to hex string
|
||||
*
|
||||
* @param bytes {number[]}
|
||||
* @returns {string}
|
||||
*/
|
||||
@@ -189,6 +197,14 @@ export class NFC {
|
||||
plugin: 'phonegap-nfc',
|
||||
pluginRef: 'ndef'
|
||||
})
|
||||
/**
|
||||
*@{ Ndef } class methods
|
||||
*@description
|
||||
* Utility methods for creating ndef records for the ndef tag format.
|
||||
* Move records into array before usage. Then pass an array to methods as parameters.
|
||||
* Do not pass bytes as parameters for these methods, conversion is built in.
|
||||
* For usage with nfc.write() and nfc.share()
|
||||
*/
|
||||
@Injectable()
|
||||
export class Ndef {
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Plugin, Cordova } from '@ionic-native/core';
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { PayPal, PayPalPayment, PayPalConfiguration } from '@ionic-native/pay-pal';
|
||||
* import { PayPal, PayPalPayment, PayPalConfiguration } from '@ionic-native/paypal';
|
||||
*
|
||||
* constructor(private payPal: PayPal) { }
|
||||
*
|
||||
|
||||
@@ -213,6 +213,21 @@ export type PushEvent = 'registration' | 'error' | 'notification';
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* // to check if we have permission
|
||||
* this.push.hasPermission()
|
||||
* .then((res: any) => {
|
||||
*
|
||||
* if (res.isEnabled) {
|
||||
* console.log('We have permission to send push notifications');
|
||||
* } else {
|
||||
* console.log('We do not have permission to send push notifications');
|
||||
* }
|
||||
*
|
||||
* });
|
||||
*
|
||||
* // to initialize push notifications
|
||||
*
|
||||
* const options: PushOptions = {
|
||||
* android: {
|
||||
* senderID: '12345679'
|
||||
@@ -227,9 +242,9 @@ export type PushEvent = 'registration' | 'error' | 'notification';
|
||||
*
|
||||
* const pushObject: PushObject = this.push.init(options);
|
||||
*
|
||||
* pushObject.on('notification').subscribe(notification => console.log('Received a notification', notification));
|
||||
* pushObject.on('notification').subscribe((notification: any) => console.log('Received a notification', notification));
|
||||
*
|
||||
* pushObject.on('registration').subscribe(registration => console.log('Device registered', registration));
|
||||
* pushObject.on('registration').subscribe((registration: any) => console.log('Device registered', registration));
|
||||
*
|
||||
* pushObject.on('error').subscribe(error => console.error('Error with Push plugin', error));
|
||||
*
|
||||
@@ -264,6 +279,13 @@ export class Push {
|
||||
return new PushObject(options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether the push notification permission has been granted.
|
||||
* @return {Promise<{isEnabled: boolean}>} Returns a Promise that resolves with an object with one property: isEnabled, a boolean that indicates if permission has been granted.
|
||||
*/
|
||||
@Cordova()
|
||||
hasPermission(): Promise<{ isEnabled: boolean }> { return; }
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -284,13 +306,6 @@ export class PushObject {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether the push notification permission has been granted.
|
||||
* @return {Promise<{isEnabled: boolean}>} Returns a Promise that resolves with an object with one property: isEnabled, a boolean that indicates if permission has been granted.
|
||||
*/
|
||||
@Cordova()
|
||||
hasPermission(): Promise<{ isEnabled: boolean }> { return; }
|
||||
|
||||
/**
|
||||
* Adds an event listener
|
||||
* @param event {string}
|
||||
|
||||
@@ -22,7 +22,7 @@ import { Plugin, Cordova } from '@ionic-native/core';
|
||||
@Plugin({
|
||||
pluginName: 'Rollbar',
|
||||
plugin: 'resgrid-cordova-plugins-rollbar',
|
||||
pluginRef: 'Rollbar',
|
||||
pluginRef: 'cordova.plugins.Rollbar',
|
||||
repo: 'https://github.com/Resgrid/cordova-plugins-rollbar',
|
||||
platforms: ['Android', 'iOS'],
|
||||
install: 'ionic plugin add resgrid-cordova-plugins-rollbar --variable ROLLBAR_ACCESS_TOKEN="YOUR_ROLLBAR_ACCEESS_TOKEN" --variable ROLLBAR_ENVIRONMENT="ROLLBAR_ENVIRONMENT"',
|
||||
|
||||
@@ -22,7 +22,7 @@ import { Cordova, Plugin } from '@ionic-native/core';
|
||||
* });
|
||||
*
|
||||
* // Share via email
|
||||
* this.socialSharing.shareViaEmail('Body', 'Subject', 'recipient@example.org').then(() => {
|
||||
* this.socialSharing.shareViaEmail('Body', 'Subject', ['recipient@example.org']).then(() => {
|
||||
* // Success!
|
||||
* }).catch(() => {
|
||||
* // Error!
|
||||
|
||||
@@ -8,7 +8,7 @@ import { Injectable } from '@angular/core';
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { SQLitePorter } from 'ionic-native';
|
||||
* import { SQLitePorter } from '@ionic-native/sqlite-porter';
|
||||
*
|
||||
*
|
||||
* constructor(private sqlitePorter: SQLitePorter) { }
|
||||
|
||||
@@ -67,7 +67,7 @@ export class SQLiteObject {
|
||||
start(): void { }
|
||||
|
||||
/**
|
||||
* Execute SQL on the opened database. Note, you must call `openDatabase` first, and
|
||||
* Execute SQL on the opened database. Note, you must call `create` first, and
|
||||
* ensure it resolved and successfully opened the database.
|
||||
*/
|
||||
@CordovaInstance()
|
||||
|
||||
@@ -26,7 +26,7 @@ export interface VideoOptions {
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { VideoPlayer } from '@ionic-native/video-player;
|
||||
* import { VideoPlayer } from '@ionic-native/video-player';
|
||||
*
|
||||
* constructor(private videoPlayer: VideoPlayer) { }
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user