Compare commits

...

51 Commits

Author SHA1 Message Date
Ibby Hadeed
7df7a557da chore(): update changelog 2017-04-18 17:48:08 -04:00
Ibby Hadeed
c720bfead1 3.5.0 2017-04-18 17:48:00 -04:00
Ibby Hadeed
b4102310e7 tslint 2017-04-18 17:47:24 -04:00
Ibby Hadeed
1b84db035f feat(camera-preview): add new plugin methods
New methods and constants available for CameraPreview
2017-04-18 17:44:01 -04:00
Ibby Hadeed
37e8eddd86 feat(background-fetch): add new status method
feat(background-fetch): add status method
2017-04-18 17:42:00 -04:00
Ibby Hadeed
4fb9b949d7 feat(action-sheet): update to match latest version
feat(action-sheet): update to newest version
2017-04-18 17:41:11 -04:00
Ibby Hadeed
66bc034c80 fix(google-maps): fix Geocoder pluginRef
Fix Geocoder's pluginRef
2017-04-18 17:40:33 -04:00
Ibby Hadeed
593c1ee6ca feat(health): update datatypes
Update datatypes to match recent release of plugin
2017-04-18 17:39:47 -04:00
Ibby Hadeed
91439be0bd feat(native-geocoder): add district property
native-geocoder: added district for larger cities
2017-04-18 17:38:17 -04:00
Ibby Hadeed
4ae50561b4 feat(flurry-analytics): add flurry analytics plugin
Added Flurry Analytics wrapper
2017-04-18 17:37:39 -04:00
Ibby Hadeed
1f0986fa6f docs(): fix reference
change executeSql doc to mention create instead of openDatabase
2017-04-18 17:36:39 -04:00
Ibby Hadeed
1be4c1c669 docs(): battery-status example fix (#1387)
Closes #1383
2017-04-18 17:36:15 -04:00
Dylan v.d Merwe
c7a6e6625a docs(): fix typo in media example (#1386) 2017-04-18 17:35:27 -04:00
SVANNER
0a7f56d960 New methods and constants available 2017-04-18 07:15:15 +02:00
Dylan v.d Merwe
f7044a08de bug(doc): battery-status example fix
Fix for https://github.com/driftyco/ionic-native/issues/1383
2017-04-17 23:26:56 +02:00
John-Luke
6168eaee47 feat(background-fetch): add status method 2017-04-17 15:22:44 -03:00
John-Luke
9c925806ed feat(action-sheet): update to newest version 2017-04-17 14:27:13 -03:00
Robert Coie
3e8211461a change executeSql doc to mention create instead of openDatabase 2017-04-16 16:27:09 -07:00
hodak
b2120c68e2 Fix Geocoder's pluginRef 2017-04-15 13:29:10 +02:00
Ankush Aggarwal
1da12b9330 added HealthDataType interface and usage instructions 2017-04-14 08:21:45 -07:00
Amit Moryossef
4bd6aaba2b fix(core): fix bug when checking if plugin exists (#1348)
* fix(cordova-plugin): add check if method exists

For https://github.com/driftyco/ionic-native/issues/1327

* fix(plugin): add typeof to undefined check
2017-04-14 09:49:57 -04:00
Ibby Hadeed
f396940044 fix(rollbar): fix pluginRef 2017-04-14 09:42:46 -04:00
Ibby Hadeed
6bba72d32a fix(media): fix issue with create method
closes #1333
2017-04-14 09:19:25 -04:00
Juan J. San Emeterio
d30b534150 docs(google-plus): options parameter is required (#1368)
Issue reported: https://forum.ionicframework.com/t/ionic-native-googleplus-unrecognized-selector-sent-to-instance/81944/3

In order to correctly call the login method on the GooglePlus provider you need to pass it the 'options' parameter even if it's empty.
2017-04-14 09:14:41 -04:00
Kendall González León
8edc27079c docs(): fix example (#1362)
Line 224 fixed, Incorrect single quotes in the string.
(don't -> do not) remove quotes for avoid bad format.
2017-04-14 09:13:52 -04:00
Stefan Huber
55f9943f86 docs(media): minor fix (#1358)
`getDuration` is synchronous, inside the example it was used with a promise, which is quite missleading...
2017-04-14 09:07:27 -04:00
Ctibor Laky
352ad7ab2f docs(): fix example (#1355) 2017-04-14 09:04:46 -04:00
Gianfrancø Palumbo
15bf509ae0 docs(): fix typo (#1354) 2017-04-14 09:04:32 -04:00
Nikhil
6b9f650a19 docs(social-sharing): fix example (#1351)
ShareViaEmail parameter for providing email "must be null or an array" because it's type is "string:[]" and the provided syntax is wrong, so i have updated that syntax.
2017-04-14 09:04:11 -04:00
Leonardo Ruhland
b30883a876 docs(): fix package name (#1340)
Fixes documentation with the new import syntax
2017-04-14 08:59:15 -04:00
Garry-H
caec80b661 docs(nfc): enhance docs (#1325)
labeled methods with classes, improved method descriptions
2017-04-14 08:58:53 -04:00
LAÉCIO FERREIRA MORAIS
620289f54b docs(): fix typo (#1324) 2017-04-14 08:58:01 -04:00
Lenglet Anthony
5a6246425f docs(): fix typo (#1323) 2017-04-14 08:57:41 -04:00
Ankush Aggarwal
43b75af58b changed any to specific types 2017-04-13 17:56:59 -07:00
Ankush Aggarwal
44957e2197 Update datatypes to match recent release of plugin
I made changes to cordova-plugin-health to accept the following array as datatypes. Earlier it was just an array of strings. Now it also contains an object with `read` and `write` array.

```
[
  'calories', 'distance',   //read and write permissions
  {
    read : ['steps'],       //read only permission
    write : ['height', 'weight']  //write only permission
  }
]
```

Don't know how to specify this array in typescript so just replaced by 'any'
2017-04-11 09:39:24 -07:00
fredroo
c15c11cf95 docs(): enhance example (#1336) 2017-04-08 16:58:36 -04:00
Ankush Aggarwal
1b429638fe docs(): add types (#1342)
Resolves - https://github.com/driftyco/ionic-native/issues/1331
2017-04-08 16:58:07 -04:00
Andréas Hanss
99576d823d Edit for 3.0 (#1345) 2017-04-08 16:57:38 -04:00
Robert Herhold
0147704a4f docs(): fix typo (#1329) 2017-04-05 23:37:08 -04:00
Yasin Simsek
f6a7e5fe9b native-geocoder: added district for larger cities 2017-04-03 12:49:29 +02:00
anastasia
ebb47ce591 fixed doc of flurry analytics wrapper 2017-04-03 13:14:08 +03:00
gujiman
57eabc002a docs(paypal): fix package name in example (#1313)
The import ref for paypal is incorrect. I've added the correct name.
2017-04-01 22:38:42 -04:00
Joel Szwarga
24c8d5d627 docs(music-controls): fix example code (#1315)
The sample code does not work...this change returns the observable first with subscribe() before actually calling the Observable's subscribe method.

In fact, the way it's written in the example, the code would not build because of typescript errors.
2017-04-01 22:38:17 -04:00
Ibby Hadeed
4ceb340630 docs(admob-free): fix plugin name 2017-03-31 23:15:27 -04:00
anastasia
ec8d318280 Finish flurry-analytics 2017-03-31 17:38:11 +03:00
anastasia
8add83612d added flurry analytics wrapper 2017-03-31 17:36:09 +03:00
Gengjun Wu
0beefb3079 docs(flashlight): fix typo (#1306)
There is a typo on line 14, changed from

 * constructor(private flashlight: FlashLight) { }

to

 * constructor(private flashlight: Flashlight) { }
2017-03-31 03:02:39 -04:00
Ibby Hadeed
4d2f720b01 chore(): update changelog 2017-03-30 15:58:15 -04:00
Ibby Hadeed
d29ca88b18 3.4.4 2017-03-30 15:58:12 -04:00
Ibby Hadeed
c94dd41f92 Merge branch 'master' of github.com:driftyco/ionic-native 2017-03-30 15:58:11 -04:00
Ibby Hadeed
145577f9bc fix(push): hasPermission is part of Push object
addresses comment in #1297
2017-03-30 15:48:46 -04:00
28 changed files with 495 additions and 70 deletions

View File

@@ -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.

View File

@@ -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)

View File

@@ -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": {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -65,7 +65,7 @@ export interface AdMobFreeRewardVideoConfig {
}
/**
* @name AdbMobFree
* @name AdMob Free
* @description
*
* @usage

View File

@@ -100,4 +100,11 @@ export class BackgroundFetch {
})
finish(): void { }
/**
* Return the status of the background-fetch
* @returns {Promise<any>}
*/
@Cordova()
status(): Promise<any> { return; }
}

View File

@@ -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);
* }
* );

View File

@@ -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; }
}

View File

@@ -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));
*
* ```
*/

View File

@@ -30,7 +30,7 @@ export interface FingerprintOptions {
* ```typescript
* import { FingerprintAIO } from '@ionic-native/fingerprint-aio';
*
* constructor(private faio: FingerpirntAIO) { }
* constructor(private faio: FingerprintAIO) { }
*
* ...
*

View File

@@ -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) { }
*
* ...
*

View 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;
}
}

View File

@@ -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
* })

View File

@@ -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: ''
})

View File

@@ -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));
*

View File

@@ -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.

View File

@@ -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);
});
}

View File

@@ -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':

View File

@@ -80,6 +80,10 @@ export interface NativeGeocoderReverseResult {
* The city.
*/
city: string;
/**
* The district.
*/
district: string;
/**
* The country name.
*/

View File

@@ -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 {

View File

@@ -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) { }
*

View File

@@ -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}

View File

@@ -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"',

View File

@@ -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!

View File

@@ -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) { }

View File

@@ -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()

View File

@@ -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) { }
*