Compare commits

..

46 Commits

Author SHA1 Message Date
Ibby Hadeed
c0fd19fd33 chore(): update changelog 2017-05-20 06:26:59 -04:00
Ibby Hadeed
f2c4f380f8 3.10.2 2017-05-20 06:26:54 -04:00
Daniel Sogl
c96ae3db0d docs(nativegeocoder): out of beta (#1482)
Out of beta since a while
2017-05-20 06:25:45 -04:00
jasonmamy
c2a6198576 refactor(wheel-selector): added display key to override default values, added more docs (#1590) 2017-05-20 06:25:34 -04:00
Ibby Hadeed
2b3d4c9090 docs(): update install commands 2017-05-20 06:25:06 -04:00
Ibby Hadeed
dbb17d801e Merge branch 'master' of github.com:driftyco/ionic-native 2017-05-20 06:23:38 -04:00
Jonathan Alexander
0b1e4e6e84 docs(): update install command (#1592)
The install text is missing cordova so it won't install just by copying and pasting in a terminal.
2017-05-20 06:23:15 -04:00
Ibby Hadeed
8c82c87811 chore(): update changelog 2017-05-20 05:21:46 -04:00
Ibby Hadeed
9997caf506 3.10.1 2017-05-20 05:21:31 -04:00
Ibby Hadeed
c8f53d2dc3 feat(core): add getSupportedPlatforms method 2017-05-20 05:21:27 -04:00
Ibby Hadeed
a10d763a41 docs(linkedin): update repo and install command 2017-05-19 09:48:00 -04:00
Ibby Hadeed
e44fdb6730 chore(): update changelog 2017-05-19 09:44:02 -04:00
Ibby Hadeed
bb8973a0ea 3.10.0 2017-05-19 09:43:51 -04:00
Ibby Hadeed
6031a240a2 feat(native-keyboard): add native keyboard plugin (#1588)
* add native keyboard plugin

* feat(native-keyboard): add native keyboard plugin
2017-05-19 09:37:56 -04:00
Ibby Hadeed
2bd244a536 fix(admob-free): use otherPromise to fix browser development 2017-05-19 09:24:19 -04:00
Ibby Hadeed
64bff1bbed docs(): add notice about plugin taking share of earnings 2017-05-19 07:59:06 -04:00
Ibby Hadeed
da5266cd65 docs(admob-free): improve docs 2017-05-19 07:44:47 -04:00
Ibby Hadeed
c1082b1c14 fix command since I cant change permissions 2017-05-19 06:52:49 -04:00
Ibby Hadeed
2cf132ee88 Merge branch 'master' of github.com:driftyco/ionic-native 2017-05-19 06:46:03 -04:00
Ibby Hadeed
e411146e8f docs(): refactor 2017-05-19 06:38:02 -04:00
Ibby Hadeed
5f63493bdc refactor(): use const instead of var 2017-05-19 06:37:28 -04:00
Daniel Sogl
999c288b23 docs(Speech Recognition): out of beta (#1483) 2017-05-19 06:36:29 -04:00
seshachalamyv
2e83ade978 docs(): fix method name in example (#1585)
data.wasPressed
should be change as data.wasTapped
2017-05-19 06:36:04 -04:00
Ibby Hadeed
08bf57f488 chore(): config github before running ci-tests 2017-05-19 06:35:01 -04:00
Hélder Diniz
6f6392ea5c feat(user-agent): add User-Agent plugin (#1582)
* feat(user-agent): add User-Agent plugin

* feat(user-agent): Few changes upon request
2017-05-19 06:31:31 -04:00
Ibby Hadeed
0b2227d35a Merge branch 'master' of github.com:driftyco/ionic-native 2017-05-19 00:35:10 -04:00
Ibby Hadeed
4bfceadb65 refactor(tts): rename the speak method param 2017-05-19 00:35:06 -04:00
seshachalamyv
61c73eaa4e docs(): fix package name in import statement (#1581)
import { FCM } from 'ionic-native'; Corrected as import { FCM } from '@ionic-native/fcm';
2017-05-18 23:39:31 -04:00
Matias Solis de la Torre
c0c0c5cec5 docs(): update install command (#1584) 2017-05-18 23:38:58 -04:00
Ibby Hadeed
5b82d82d75 Update index.ts 2017-05-17 16:33:52 -04:00
mhartington
36be795623 docs(file): set filesaver class to hidden 2017-05-17 15:14:25 -04:00
mhartington
0996264483 docs(file): set classes to hidden
Set classes to hidden to prevent doc generation
2017-05-17 15:00:00 -04:00
Ibby Hadeed
2245bb8050 chore(): update changelog 2017-05-17 11:19:57 -04:00
Ibby Hadeed
e14e00edba 3.9.2 2017-05-17 11:19:55 -04:00
Ibby Hadeed
22102a7e4a fix(core): decorators should define enumerable properties 2017-05-17 11:19:35 -04:00
Ibby Hadeed
6416c2544c fix(action-sheet): destructiveButtonLast is optional 2017-05-17 11:07:34 -04:00
Ibby Hadeed
73a510f9c2 refactor(): remove unused import 2017-05-17 10:54:58 -04:00
Ibby Hadeed
b8b605db5e chore(): update changelog 2017-05-17 10:54:25 -04:00
Ibby Hadeed
12168d991a 3.9.1 2017-05-17 10:54:22 -04:00
Ibby Hadeed
93a119bf4b fix(core): fix issues when clearing observables 2017-05-17 10:54:09 -04:00
Ibby Hadeed
a7c62de389 refactor(core): otherPromise in wrapInstance shouldn't check for error 2017-05-17 10:47:39 -04:00
Ibby Hadeed
8aca6718e1 refactor(core): wrapInstance should return promise as-is
instance based method never throw errors like regular ones do
2017-05-17 10:46:47 -04:00
Ibby Hadeed
1ec4bdef8f docs(): update interface names 2017-05-17 10:36:05 -04:00
Ibby Hadeed
d6ed87d7cc fix merge conflict 2017-05-17 08:12:36 -04:00
Ibby Hadeed
55f3f37760 chore(): update changelog 2017-05-17 08:10:34 -04:00
Ibby Hadeed
4f547dae30 3.9.0 2017-05-17 08:10:31 -04:00
33 changed files with 578 additions and 118 deletions

View File

@@ -1,3 +1,79 @@
<a name="3.10.2"></a>
## [3.10.2](https://github.com/driftyco/ionic-native/compare/v3.10.1...v3.10.2) (2017-05-20)
<a name="3.10.1"></a>
## [3.10.1](https://github.com/driftyco/ionic-native/compare/v3.10.0...v3.10.1) (2017-05-20)
### Features
* **core:** add getSupportedPlatforms method ([c8f53d2](https://github.com/driftyco/ionic-native/commit/c8f53d2))
<a name="3.10.0"></a>
# [3.10.0](https://github.com/driftyco/ionic-native/compare/v3.9.2...v3.10.0) (2017-05-19)
### Bug Fixes
* **admob-free:** use otherPromise to fix browser development ([2bd244a](https://github.com/driftyco/ionic-native/commit/2bd244a))
### Features
* **native-keyboard:** add native keyboard plugin (#1588) ([6031a24](https://github.com/driftyco/ionic-native/commit/6031a24))
* **user-agent:** add User-Agent plugin (#1582) ([6f6392e](https://github.com/driftyco/ionic-native/commit/6f6392e))
<a name="3.9.2"></a>
## [3.9.2](https://github.com/driftyco/ionic-native/compare/v3.9.1...v3.9.2) (2017-05-17)
### Bug Fixes
* **action-sheet:** destructiveButtonLast is optional ([6416c25](https://github.com/driftyco/ionic-native/commit/6416c25))
* **core:** decorators should define enumerable properties ([22102a7](https://github.com/driftyco/ionic-native/commit/22102a7))
<a name="3.9.1"></a>
## [3.9.1](https://github.com/driftyco/ionic-native/compare/v3.9.0...v3.9.1) (2017-05-17)
### Bug Fixes
* **core:** fix issues when clearing observables ([93a119b](https://github.com/driftyco/ionic-native/commit/93a119b))
<a name="3.9.0"></a>
# [3.9.0](https://github.com/driftyco/ionic-native/compare/v3.8.1...v3.9.0) (2017-05-17)
### Bug Fixes
* **android-permissions:** fix PERMISSION property and add requestPermission ([ebf4028](https://github.com/driftyco/ionic-native/commit/ebf4028)), closes [#1574](https://github.com/driftyco/ionic-native/issues/1574)
* **app-preferences:** suite is sync ([3cb8383](https://github.com/driftyco/ionic-native/commit/3cb8383)), closes [#1321](https://github.com/driftyco/ionic-native/issues/1321)
* **background-mode:** configure doesn't return anything ([92ef4f0](https://github.com/driftyco/ionic-native/commit/92ef4f0)), closes [#1457](https://github.com/driftyco/ionic-native/issues/1457)
* **in-app-browser:** fix on method ([975a65d](https://github.com/driftyco/ionic-native/commit/975a65d)), closes [#1446](https://github.com/driftyco/ionic-native/issues/1446)
* **media:** create should return null if plugin is not available ([d68618f](https://github.com/driftyco/ionic-native/commit/d68618f))
* **media:** create will always return MediaObject even if plugin doesnt exist ([ee4b61e](https://github.com/driftyco/ionic-native/commit/ee4b61e))
* **printer:** fix implementation and add pick method ([55071c0](https://github.com/driftyco/ionic-native/commit/55071c0))
* **push:** fix types ([ca76593](https://github.com/driftyco/ionic-native/commit/ca76593)), closes [#1331](https://github.com/driftyco/ionic-native/issues/1331)
* **secure-storage:** reject the promise if the plugin doesn't exist (#1562) ([d5919d1](https://github.com/driftyco/ionic-native/commit/d5919d1))
### Features
* **linkedin:** add getActiveSession method ([4c8deb2](https://github.com/driftyco/ionic-native/commit/4c8deb2)), closes [#1570](https://github.com/driftyco/ionic-native/issues/1570)
* **printer:** add check method ([991f2f0](https://github.com/driftyco/ionic-native/commit/991f2f0))
<a name="3.8.1"></a>
## [3.8.1](https://github.com/driftyco/ionic-native/compare/v3.8.0...v3.8.1) (2017-05-16)

View File

@@ -30,6 +30,7 @@ jobs:
- run:
name: Run tslint
command: npm run lint
- run: bash ./scripts/git/config.sh
- run:
name: Build changed plugins
command: node scripts/ci-tests.js

View File

@@ -1,6 +1,6 @@
{
"name": "ionic-native",
"version": "3.8.1",
"version": "3.10.2",
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
"license": "MIT",
"devDependencies": {

2
scripts/git/config.sh Normal file
View File

@@ -0,0 +1,2 @@
git config --global user.email "hi@ionicframework.com"
git config --global user.name "Ionitron"

View File

@@ -24,7 +24,8 @@ class TestObject {
pluginName: 'TestPlugin',
pluginRef: 'testPlugin',
repo: '',
plugin: 'cordova-plugin-my-plugin'
plugin: 'cordova-plugin-my-plugin',
platforms: ['Android', 'iOS']
})
class TestPlugin extends IonicNativePlugin {
@@ -85,6 +86,10 @@ describe('Regular Decorators', () => {
expect(TestPlugin.getPlugin()).toEqual(window.testPlugin);
});
it('should return supported platforms', () => {
expect(TestPlugin.getSupportedPlatforms()).toEqual(['Android', 'iOS']);
});
});
describe('Cordova', () => {

View File

@@ -135,7 +135,8 @@ export function InstanceCheck(opts: CordovaCheckOptions = {}) {
return getPromise(() => { });
}
}
},
enumerable: true
};
};
}
@@ -159,7 +160,8 @@ export function CordovaCheck(opts: CordovaCheckOptions = {}) {
}
return Promise.reject(check && check.error);
}
}
},
enumerable: true
};
};
}
@@ -239,7 +241,8 @@ export function Cordova(opts: CordovaOptions = {}) {
return {
value: function(...args: any[]) {
return wrap(this, methodName, opts).apply(this, args);
}
},
enumerable: true
};
};
}
@@ -254,7 +257,8 @@ export function CordovaInstance(opts: any = {}) {
return {
value: function(...args: any[]) {
return wrapInstance(this, methodName, opts).apply(this, args);
}
},
enumerable: true
};
};
}
@@ -312,7 +316,8 @@ export function CordovaFunctionOverride(opts: any = {}) {
return {
value: function(...args: any[]) {
return overrideFunction(this, methodName, opts);
}
},
enumerable: true
};
};
}
@@ -348,7 +353,8 @@ export function CordovaFiniteObservable(opts: CordovaFiniteObservableOptions = {
wrappedSubscription.unsubscribe();
};
});
}
},
enumerable: true
};
};
}

View File

@@ -38,4 +38,9 @@ export class IonicNativePlugin {
*/
static getPluginInstallName(): string { return; }
/**
* Returns the plugin's supported platforms
*/
static getSupportedPlatforms(): string[] { return; }
}

View File

@@ -1,4 +1,4 @@
import { get, getPlugin, getPromise, cordovaWarn, pluginWarn } from './util';
import { getPlugin, getPromise, cordovaWarn, pluginWarn } from './util';
import { checkReady } from './bootstrap';
import { CordovaOptions } from './decorators';
@@ -177,11 +177,11 @@ function wrapObservable(pluginObj: any, methodName: string, args: any[], opts: a
if (opts.clearWithArgs) {
return callCordovaPlugin(pluginObj, opts.clearFunction, args, opts, observer.next.bind(observer), observer.error.bind(observer));
}
return get(window, pluginObj.constructor.getPluginRef())[opts.clearFunction].call(pluginObj, pluginResult);
return callCordovaPlugin(pluginObj, opts.clearFunction, []);
}
} catch (e) {
console.warn('Unable to clear the previous observable watch for', pluginObj.constructor.getPluginName(), methodName);
console.error(e);
console.warn(e);
}
};
});
@@ -276,12 +276,12 @@ export function wrapInstance(pluginObj: any, methodName: string, opts: any = {})
return () => {
try {
if (opts.clearWithArgs) {
return pluginObj._objectInstance[opts.clearFunction].apply(pluginObj._objectInstance, args);
return callInstance(pluginObj, opts.clearFunction, args, opts, observer.next.bind(observer), observer.error.bind(observer));
}
return pluginObj._objectInstance[opts.clearFunction].call(pluginObj, pluginResult);
return callInstance(pluginObj, opts.clearFunction, []);
} catch (e) {
console.warn('Unable to clear the previous observable watch for', pluginObj.constructor.getPluginName(), methodName);
console.error(e);
console.warn(e);
}
};
});
@@ -290,23 +290,16 @@ export function wrapInstance(pluginObj: any, methodName: string, opts: any = {})
return getPromise((resolve: Function, reject: Function) => {
let result = callInstance(pluginObj, methodName, args, opts, resolve, reject);
if (result && !result.error) {
if (result && !!result.then) {
result.then(resolve, reject);
} else {
reject();
}
});
} else {
let pluginResult: any, rej: Function;
const p = getPromise((resolve: Function, reject: Function) => {
pluginResult = callInstance(pluginObj, methodName, args, opts, resolve, reject);
rej = reject;
});
if (pluginResult && pluginResult.error) {
p.catch(() => { });
typeof rej === 'function' && rej(pluginResult.error);
}
return p;
return getPromise((resolve: Function, reject: Function) => callInstance(pluginObj, methodName, args, opts, resolve, reject));
}
};

View File

@@ -51,7 +51,7 @@ export interface ActionSheetOptions {
/**
* Choose if destructive button will be the last
*/
destructiveButtonLast: boolean;
destructiveButtonLast?: boolean;
}
/**

View File

@@ -96,6 +96,14 @@ export interface AdMobFreeRewardVideoConfig {
*
*
* ```
* @interfaces
* AdMobFreeBannerConfig
* AdMobFreeInterstitialConfig
* AdMobFreeRewardVideoConfig
* @classes
* AdMobFreeBanner
* AdMobFreeInterstitial
* AdMobFreeRewardVideo
*/
@Plugin({
pluginName: 'AdMobFree',
@@ -108,9 +116,10 @@ export interface AdMobFreeRewardVideoConfig {
export class AdMobFree extends IonicNativePlugin {
/**
* Convenience constructor to get event names
* Convenience object to get event names
* @type {Object}
*/
events = {
events: any = {
BANNER_LOAD: 'admob.banner.events.LOAD',
BANNER_LOAD_FAIL: 'admob.banner.events.LOAD_FAIL',
BANNER_OPEN: 'admob.banner.events.OPEN',
@@ -142,19 +151,19 @@ export class AdMobFree extends IonicNativePlugin {
}
/**
*
* Returns the AdMobFreeBanner object
* @type {AdMobFreeBanner}
*/
banner: AdMobFreeBanner = new AdMobFreeBanner();
/**
*
* Returns the AdMobFreeInterstitial object
* @type {AdMobFreeInterstitial}
*/
interstitial: AdMobFreeInterstitial = new AdMobFreeInterstitial();
/**
*
* Returns the AdMobFreeRewardVideo object
* @type {AdMobFreeRewardVideo}
*/
rewardVideo: AdMobFreeRewardVideo = new AdMobFreeRewardVideo();
@@ -183,28 +192,28 @@ export class AdMobFreeBanner {
* Hide the banner.
* @return {Promise<any>}
*/
@Cordova({ sync: true })
@Cordova({ otherPromise: true })
hide(): Promise<any> { return; }
/**
* Create banner.
* @return {Promise<any>}
*/
@Cordova({ sync: true })
@Cordova({ otherPromise: true })
prepare(): Promise<any> { return; }
/**
* Remove the banner.
* @return {Promise<any>}
*/
@Cordova({ sync: true })
@Cordova({ otherPromise: true })
remove(): Promise<any> { return; }
/**
* Show the banner.
* @return {Promise<any>}
*/
@Cordova({ sync: true })
@Cordova({ otherPromise: true })
show(): Promise<any> { return; }
}
@@ -231,21 +240,21 @@ export class AdMobFreeInterstitial {
* Check if interstitial is ready
* @return {Promise<any>}
*/
@Cordova({ sync: true })
@Cordova({ otherPromise: true })
isReady(): Promise<any> { return; }
/**
* Prepare interstitial
* @return {Promise<any>}
*/
@Cordova({ sync: true })
@Cordova({ otherPromise: true })
prepare(): Promise<any> { return; }
/**
* Show the interstitial
* @return {Promise<any>}
*/
@Cordova({ sync: true })
@Cordova({ otherPromise: true })
show(): Promise<any> { return; }
}
@@ -272,21 +281,21 @@ export class AdMobFreeRewardVideo {
* Check if reward video is ready
* @return {Promise<any>}
*/
@Cordova({ sync: true })
@Cordova({ otherPromise: true })
isReady(): Promise<any> { return; }
/**
* Prepare reward video
* @return {Promise<any>}
*/
@Cordova({ sync: true })
@Cordova({ otherPromise: true })
prepare(): Promise<any> { return; }
/**
* Show the reward video
* @return {Promise<any>}
*/
@Cordova({ sync: true })
@Cordova({ otherPromise: true })
show(): Promise<any> { return; }
}

View File

@@ -93,6 +93,8 @@ export interface AdExtras {
* @name AdMob
* @description
* Plugin for Google Ads, including AdMob / DFP (doubleclick for publisher) and mediations to other Ad networks.
*
* IMPORTANT NOTICE: this plugin takes a percentage out of your earnings if you profit more than $1,000. Read more about this on the plugin's repo. For a completely free alternative, see [AdMob Free](../admob-free).
* @usage
* ```typescript
* import { AdMob } from '@ionic-native/admob';

View File

@@ -102,7 +102,7 @@ export interface AlipayOrder {
pluginRef: 'Alipay.Base',
repo: 'https://github.com/xueron/cordova-alipay-base',
platforms: ['Android', 'iOS'],
install: 'ionic plugin add https://github.com/xueron/cordova-alipay-base --variable APP_ID=your_app_id'
install: 'ionic cordova plugin add https://github.com/xueron/cordova-alipay-base --variable APP_ID=your_app_id'
})
@Injectable()
export class Alipay extends IonicNativePlugin {

View File

@@ -79,7 +79,7 @@ export interface DeeplinkMatch {
pluginRef: 'IonicDeeplink',
repo: 'https://github.com/driftyco/ionic-plugin-deeplinks',
platforms: ['iOS', 'Android', 'Browser'],
install: 'ionic plugin add ionic-plugin-deeplinks --variable URL_SCHEME=myapp --variable DEEPLINK_SCHEME=https --variable DEEPLINK_HOST=example.com --variable ANDROID_PATH_PREFIX=/',
install: 'ionic cordova plugin add ionic-plugin-deeplinks --variable URL_SCHEME=myapp --variable DEEPLINK_SCHEME=https --variable DEEPLINK_HOST=example.com --variable ANDROID_PATH_PREFIX=/',
installVariables: ['URL_SCHEME', 'DEEPLINK_SCHEME', 'DEEPLINK_HOST', 'ANDROID_PATH_PREFIX']
})
@Injectable()

View File

@@ -43,7 +43,7 @@ export interface FacebookLoginResponse {
* Then type in the following command in your Terminal, where APP_ID and APP_NAME are the values from the Facebook Developer portal.
*
* ```bash
* ionic plugin add cordova-plugin-facebook4 --save --variable APP_ID="123456789" --variable APP_NAME="myApplication"
* ionic plugin add cordova-plugin-facebook4 --variable APP_ID="123456789" --variable APP_NAME="myApplication"
* ```
*
* After, you'll need to add the native platforms you'll be using to your app in the Facebook Developer portal under your app's Settings:
@@ -114,7 +114,7 @@ export interface FacebookLoginResponse {
plugin: 'cordova-plugin-facebook4',
pluginRef: 'facebookConnectPlugin',
repo: 'https://github.com/jeduan/cordova-plugin-facebook4',
install: 'ionic plugin add cordova-plugin-facebook4 --variable APP_ID="123456789" --variable APP_NAME="myApplication"',
install: 'ionic cordova plugin add cordova-plugin-facebook4 --variable APP_ID="123456789" --variable APP_NAME="myApplication"',
installVariables: ['APP_ID', 'APP_NAME'],
platforms: ['Android', 'iOS']
})

View File

@@ -25,7 +25,7 @@ export interface NotificationData {
*
* @usage
* ```typescript
* import { FCM } from 'ionic-native';
* import { FCM } from '@ionic-native/fcm';
*
* constructor(private fcm: FCM) {}
*
@@ -38,7 +38,7 @@ export interface NotificationData {
* })
*
* fcm.onNotification().subscribe(data=>{
* if(data.wasPressed){
* if(data.wasTapped){
* console.log("Received in background");
* } else {
* console.log("Received in foreground");

View File

@@ -400,6 +400,7 @@ export interface RemoveResult {
fileRemoved: Entry;
}
/** @hidden */
export declare class FileSaver extends EventTarget {
/**
* When the FileSaver constructor is called, the user agent must return a new FileSaver object with readyState set to INIT.
@@ -489,6 +490,7 @@ export declare class FileSaver extends EventTarget {
}
/**
* @hidden
* This interface expands on the FileSaver interface to allow for multiple write actions, rather than just saving a single Blob.
*/
export declare class FileWriter extends FileSaver {
@@ -528,6 +530,7 @@ export interface IWriteOptions {
truncate?: number; // if present, number of bytes to truncate file to before writing
}
/** @hidden */
export declare class FileError {
constructor(code: number);
static NOT_FOUND_ERR: number;
@@ -547,6 +550,7 @@ export declare class FileError {
message: string;
}
/** @hidden */
export declare class FileReader {
static EMPTY: number;
static LOADING: number;

View File

@@ -72,6 +72,9 @@ export interface FlurryAnalyticsLocation {
horizontalAccuracy?: number;
}
/**
* @hidden
*/
export class FlurryAnalyticsObject {
constructor(private _objectInstance: any) { }

View File

@@ -853,14 +853,14 @@ export class Marker {
/**
* Set the marker position.
* @param latLng {GoogleMapLatLng}
* @param latLng {LatLng}
*/
@CordovaInstance({ sync: true })
setPosition(latLng: LatLng): void { return; }
/**
* Return the marker position.
* @return {Promise<GoogleMapLatLng>}
* @return {Promise<LatLng>}
*/
@CordovaInstance()
getPosition(): Promise<LatLng> { return; }

View File

@@ -24,7 +24,7 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
pluginRef: 'window.plugins.googleplus',
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-googleplus',
platforms: ['Web', 'Android', 'iOS'],
install: 'ionic plugin add cordova-plugin-googleplus --variable REVERSED_CLIENT_ID=myreversedclientid',
install: 'ionic cordova plugin add cordova-plugin-googleplus --variable REVERSED_CLIENT_ID=myreversedclientid',
installVariables: ['REVERSED_CLIENT_ID']
})
@Injectable()

View File

@@ -52,8 +52,8 @@ export type LinkedInLoginScopes = 'r_basicprofile' | 'r_emailaddress' | 'rw_comp
pluginName: 'LinkedIn',
plugin: 'cordova-plugin-linkedin',
pluginRef: 'cordova.plugins.LinkedIn',
repo: 'https://github.com/zyramedia/cordova-plugin-linkedin',
install: 'ionic plugin add cordova-plugin-linkedin --variable APP_ID=YOUR_APP_ID',
repo: 'https://github.com/zyra/cordova-plugin-linkedin',
install: 'ionic cordova plugin add cordova-plugin-linkedin --variable APP_ID=YOUR_APP_ID',
platforms: ['Android', 'iOS']
})
@Injectable()

View File

@@ -2,7 +2,6 @@ import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/**
* @beta
* @name Native Geocoder
* @description
* Cordova plugin for native forward and reverse geocoding

View File

@@ -0,0 +1,244 @@
import { Plugin, IonicNativePlugin, Cordova } from '@ionic-native/core';
import { Injectable } from '@angular/core';
export interface NativeKeyboardOptions {
/**
* A function invoked when the user submits his input. Receives the text as a single property. Make sure your page is UTF-8 encoded so Chinese and Emoji are rendered OK.
*/
onSubmit: Function;
/**
* A function invoked when the keyboard is about to pop up. Receives the height as a single property. (iOS only)
*/
onKeyboardWillShow: Function;
/**
* A function invoked when the keyboard popped up. Receives the height as a single property.
*/
onKeyboardDidShow: Function;
/**
* A function invoked when the keyboard is about to close. (iOS only)
*/
onKeyboardWillHide: Function;
/**
* A function invoked when the keyboard closed.
*/
onKeyboardDidHide: Function;
/**
* A function invoked when any key is pressed, sends the entire text as response.
*/
onTextChanged: Function;
/**
* Highly recommended to pass in if you want to replicate the behavior of the video's above (scroll down when the keyboard opens). Pass in the scrollable DOM element containing the messages.
*/
autoscrollElement: HTMLElement;
/**
* If `autoscrollElement` was set you can also make the list scroll down initially, when the messenger bar (without the keyboard popping up) is shown.
*/
scrollToBottomAfterMessengerShows: boolean;
/**
* Setting this to `true` is like the video's above: the keyboard doesn't close upon submit. Defaults to `false`.
*/
keepOpenAfterSubmit: boolean;
/**
* Makes the messenger bar slide in from the bottom. Defaults to `false`.
*/
animated: boolean;
/**
* Open the keyboard when showing the messenger. Defaults to `false`.
*/
showKeyboard: boolean;
/**
* The default text set in the messenger input bar.
*/
text: string;
/**
* The color of the typed text. Defaults to `#444444`.
*/
textColor: string;
/**
* Like a regular HTML input placeholder.
*/
placeholder: string;
/**
* The color of the placeholder text. Defaults to `#CCCCCC`.
*/
placeholderColor: string;
/**
* The background color of the messenger bar. Defaults to `#F6F6F6`.
*/
backgroundColor: string;
/**
* The background color of the textview. Looks nicest on Android if it's the same color as the `backgroundColor` property. Defaults to `#F6F6F6`.
*/
textViewBackgroundColor: string;
/**
* The border color of the textview. Defaults to `#666666`. (iOS only)
*/
textViewBorderColor: string;
/**
* Setting this > 0 will make a counter show up on iOS (and ignore superfluous input on Android, for now)
*/
maxChars: number;
/**
* Options are: `"none"`, `"split"`, `"countdown"`, `"countdownreversed"`. Note that if `maxChars` is set, `"none"` will still show a counter. Defaults to `"none"`. (iOS only)
*/
counterStyle: string;
/**
* Options are: "default", "decimalpad", "phonepad", "numberpad", "namephonepad", "number", "email", "twitter", "url", "alphabet", "search", "ascii". (iOS only)
*/
type: string;
/**
* Options are: "light", "dark". (iOS only)
*/
appearance: string;
/**
* Disables things like the Emoji keyboard and the Predicive text entry bar (iOS only)
*/
secure: boolean;
/**
*
*/
leftButton: NativeKeyboardLeftButton;
/**
*
*/
rightButton: NativeKeyboardButton;
}
export interface NativeKeyboardButton {
/**
* Either "text" (Android only currently), "fontawesome" or "ionicon".
*/
type: string;
/**
* Depends on the type. Examples: for "text" use "Send", for "fontawesome" use "fa-battery-quarter", for "ionicon" use "\uf48a" (go to http://ionicons.com, right-click and inspect the icon and use the value you find in :before). Note that some fonticons are not supported as the embedded fonts in the plugin may lag behind a little. So try one of the older icons first.
*/
value: string;
/**
* If type is "text" you can set this to either "normal", "bold" or "italic".
*/
textStyle: string;
/**
* A function invoked when the button is pressed. Use this button to prompt the user what he wants to do next by for instance rendering an ActionSheet.
*/
onPress: Function;
}
export interface NativeKeyboardLeftButton extends NativeKeyboardButton {
/**
* Set to `true` to disable the button once text has been entered.
*/
disabledWhenTextEntered: boolean;
}
export interface NativeKeyboardUpdateMessengerOptions {
/**
* Replace the messenger's text by this. The current text remains if omitted.
*/
text: string;
/**
* Position the cursor anywhere in the text range. Defaults to the end of the text.
*/
caretIndex: number;
/**
* If `false` or omitted no changes to the keyboard state are made.
*/
showKeyboard: boolean;
}
/**
* @name Native Keyboard
* @description
* A cross platform WhatsApp / Messenger / Slack -style keyboard even. For your Cordova app.
*
*
* IMPORTANT NOTICE: this plugin is paid, please read more about this at the [plugin's repo](https://github.com/EddyVerbruggen/cordova-plugin-native-keyboard#i-like-it-hook-me-up).
*
*
* @usage
* ```
* import { NativeKeyboard } from '@ionic-native/native-keyboard';
*
*
* constructor(private nativeKeyboard: NativeKeyboard) { }
*
* ...
*
*
* ```
* @interfaces
* NativeKeyboardOptions
* NativeKeyboardButton
* NativeKeyboardLeftButton
* NativeKeyboardUpdateMessengerOptions
*/
@Plugin({
pluginName: 'NativeKeyboard',
plugin: 'cordova-plugin-native-keyboard',
pluginRef: 'NativeKeyboard',
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-native-keyboard',
platforms: ['iOS', 'Android']
})
@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<any>}
*/
@Cordova()
showMessengerKeyboard(): Promise<any> { return; }
/**
* Programmatically hide the keyboard (but not the messenger bar)
*/
@Cordova()
hideMessengerKeyboard(): Promise<any> { return; }
/**
* Manipulate the messenger while it's open. For instance if you want to update the text programmatically based on what the user typed.
* @param options
*/
@Cordova()
updateMessenger(options: NativeKeyboardUpdateMessengerOptions): Promise<any> { return; }
}

View File

@@ -4,7 +4,7 @@ import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/merge';
declare var navigator: any;
declare const navigator: any;
/**
* @name Network
@@ -30,9 +30,9 @@ declare var navigator: any;
*
* // watch network for a connection
* let connectSubscription = this.network.onConnect().subscribe(() => {
* console.log('network connected!');
* console.log('network connected!');
* // We just got a connection but we need to wait briefly
* // before we determine the connection type. Might need to wait
* // before we determine the connection type. Might need to wait.
* // prior to doing any api requests as well.
* setTimeout(() => {
* if (this.network.type === 'wifi') {

View File

@@ -44,7 +44,7 @@ import { Injectable } from '@angular/core';
plugin: 'cordova-plugin-photo-library',
pluginRef: 'cordova.plugins.photoLibrary',
repo: 'https://github.com/terikon/cordova-plugin-photo-library',
install: 'ionic plugin add cordova-plugin-photo-library --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="To choose photos"',
install: 'ionic cordova plugin add cordova-plugin-photo-library --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="To choose photos"',
platforms: ['Android', 'Browser', 'iOS']
})
@Injectable()

View File

@@ -172,7 +172,7 @@ export interface PinterestPin {
plugin: 'cordova-plugin-pinterest',
pluginRef: 'cordova.plugins.Pinterest',
repo: 'https://github.com/zyramedia/cordova-plugin-pinterest',
install: 'ionic plugin add cordova-plugin-pinterest --variable APP_ID=YOUR_APP_ID',
install: 'ionic cordova plugin add cordova-plugin-pinterest --variable APP_ID=YOUR_APP_ID',
installVariables: ['APP_ID'],
platforms: ['Android', 'iOS']
})

View File

@@ -264,7 +264,7 @@ export type PushEvent = 'registration' | 'error' | 'notification';
plugin: 'phonegap-plugin-push',
pluginRef: 'PushNotification',
repo: 'https://github.com/phonegap/phonegap-plugin-push',
install: 'ionic plugin add phonegap-plugin-push --variable SENDER_ID=XXXXXXXXX',
install: 'ionic cordova plugin add phonegap-plugin-push --variable SENDER_ID=XXXXXXXXX',
installVariables: ['SENDER_ID']
})
@Injectable()

View File

@@ -25,7 +25,7 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
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"',
install: 'ionic cordova plugin add resgrid-cordova-plugins-rollbar --variable ROLLBAR_ACCESS_TOKEN="YOUR_ROLLBAR_ACCEESS_TOKEN" --variable ROLLBAR_ENVIRONMENT="ROLLBAR_ENVIRONMENT"',
installVariables: ['ROLLBAR_ACCESS_TOKEN', 'ROLLBAR_ENVIRONMENT']
})
@Injectable()

View File

@@ -120,17 +120,8 @@ export class SecureStorage extends IonicNativePlugin {
*/
@CordovaCheck()
create(store: string): Promise<SecureStorageObject> {
<<<<<<< HEAD
return new Promise((res: Function, rej: Function) => {
const instance = new (SecureStorage.getPlugin())(() => res(new SecureStorageObject(instance)), rej, store);
=======
return new Promise((res, rej) => {
if (checkAvailability('cordova.plugins.SecureStorage', null, 'SecureStorage') === true) {
const instance = new cordova.plugins.SecureStorage(() => res(new SecureStorageObject(instance)), rej, store);
} else {
rej('SecureStorage failure: cordova plugin is not available');
}
>>>>>>> 5145395dd7bea7d2fb81b11b356a4a7497c607e7
});
}

View File

@@ -44,7 +44,6 @@ export interface SpeechRecognitionListeningOptionsAndroid {
}
/**
* @beta
* @name Speech Recognition
* @description
* This plugin does speech recognition using cloud services

View File

@@ -42,14 +42,14 @@ export class TextToSpeech extends IonicNativePlugin {
/**
* This function speaks
* @param options {string | TTSOptions} Text to speak or TTSOptions
* @param textOrOptions {string | TTSOptions} Text to speak or TTSOptions
* @return {Promise<any>} Returns a promise that resolves when the speaking finishes
*/
@Cordova({
successIndex: 1,
errorIndex: 2
})
speak(options: string | TTSOptions): Promise<any> {
speak(textOrOptions: string | TTSOptions): Promise<any> {
return;
}

View File

@@ -56,7 +56,7 @@ export interface TwitterConnectResponse {
plugin: 'twitter-connect-plugin',
pluginRef: 'TwitterConnect',
repo: 'https://github.com/ManifestWebDesign/twitter-connect-plugin',
install: 'ionic plugin add twitter-connect-plugin --variable FABRIC_KEY=fabric_API_key',
install: 'ionic cordova plugin add twitter-connect-plugin --variable FABRIC_KEY=fabric_API_key',
installVariables: ['FABRIC_KEY']
})
@Injectable()

View File

@@ -0,0 +1,73 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/**
* @name User Agent
* @description
* The UserAgent plugin provides functions to set the HTTP user-agent header. For more info about User-Agents, please [see the HTTP User-Agent docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent).
*
* Requires Cordova plugin: `cordova-useragent`. For more info, please see the [User-Agent plugin docs](https://github.com/LouisT/cordova-useragent).
*
* @usage
* ```typescript
* import { UserAgent } from '@ionic-native/user-agent';
*
*
* constructor(private userAgent: UserAgent) { }
*
* ...
*
*
* this.userAgent.set('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36')
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
*
* * this.userAgent.get()
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
*
* * this.userAgent.reset()
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
*
* ```
*/
@Plugin({
pluginName: 'UserAgent',
plugin: 'https://github.com/LouisT/cordova-useragent',
pluginRef: 'plugins.useragent',
repo: 'https://github.com/LouisT/cordova-useragent',
platforms: ['Android', 'iOS']
})
@Injectable()
export class UserAgent extends IonicNativePlugin {
/**
* Changes the current user-agent to the one sent by argument.
* @param userAgent {string} User-Agent
* @return {Promise<any>} Returns a promise that resolves when the user-agent changes
*/
@Cordova()
set(userAgent: string): Promise<any> {
return;
}
/**
* Returns the current user-agent string.
* @return {Promise<any>} Returns a promise that resolves when the user-agent is returned
*/
@Cordova()
get(): Promise<any> {
return;
}
/**
* Sets the user-agent back to default
* @return {Promise<any>} Returns a promise that resolves when the user-agent resets
*/
@Cordova()
reset(): Promise<any> {
return;
}
}

View File

@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
export interface WheelSelectorItem {
description: string;
description?: string;
}
export interface WheelSelectorOptions {
@@ -44,6 +44,13 @@ export interface WheelSelectorOptions {
* Default: false
*/
wrapWheelText?: boolean;
/**
* The json key to display, by default it is description, this allows for setting any
* key/value to be displayed
* Default: description
*/
displayKey?: string;
}
export interface WheelSelectorData {
@@ -65,54 +72,95 @@ export interface WheelSelectorData {
* ...
*
* let jsonData = {
* numbers: [
* { description: "1" },
* { description: "2" },
* { description: "3" }
* ],
* fruits: [
* { description: "Apple" },
* { description: "Banana" },
* { description: "Tangerine" }
* ],
* };
* numbers: [
* { description: "1" },
* { description: "2" },
* { description: "3" }
* ],
* fruits: [
* { description: "Apple" },
* { description: "Banana" },
* { description: "Tangerine" }
* ],
* firstNames: [
* { name: "Fred", id: '1' },
* { name: "Jane", id: '2' },
* { name: "Bob", id: '3' },
* { name: "Earl", id: '4' },
* { name: "Eunice", id: '5' }
* ],
* lastNames: [
* { name: "Johnson", id: '100' },
* { name: "Doe", id: '101' },
* { name: "Kinishiwa", id: '102' },
* { name: "Gordon", id: '103' },
* { name: "Smith", id: '104' }
* ]
* };
*
* //use most of the default values
* this.selector.show({
* title: "Select some Fruit",
* items: [
* jsonData.numbers,
* jsonData.fruits
* ]
* }).then(
* result => {
* console.log('Selected: ' + result[0].description + ' at index: ' + result[0].index
* + ' and ' + result[1].description + ' at index: ' + result[1].index);
* },
* err => console.log('Error occurred while getting result: ', err)
* );
* ...
*
* ...
* //basic number selection, index is always returned in the result
* selectANumber() {
* this.selector.show({
* title: "How Many?",
* items: [
* this.jsonData.numbers
* ],
* }).then(
* result => {
* console.log(result[0].description + ' at index: ' + result[0].index);
* },
* err => console.log('Error: ', err)
* );
* }
*
* ...
*
* //set some initial default values to display: "2", "Tangerine"
* this.selector.show({
* title: "Select some Fruit",
* items: [
* jsonData.numbers,
* jsonData.fruits
* ],
* defaultItems: [
* jsonData.numbers[1],
* jsonData.fruits[2]
* ]
* }).then(
* result => {
* console.log('Selected: ' + result[0].description + ' at index: ' + result[0].index
* + ' and ' + result[1].description + ' at index: ' + result[1].index);
* },
* err => console.log('Error occurred while getting result: ', err)
* );
* //basic selection, setting initial displayed default values: '3' 'Banana'
* selectFruit() {
* this.selector.show({
* title: "How Much?",
* items: [
* this.jsonData.numbers, this.jsonData.fruits
* ],
* positiveButtonText: "Ok",
* negativeButtonText: "Nope",
* defaultItems: [
* this.jsonData.numbers[2], // '3'
* this.jsonData.fruits[3] // 'Banana'
* ]
* }).then(
* result => {
* console.log(result[0].description + ' ' + result[1].description);
* },
* err => console.log('Error: ' + JSON.stringify(err))
* );
* }
*
* ...
*
* //more complex as overrides which key to display
* //then retrieve properties from original data
* selectNamesUsingDisplayKey() {
* this.selector.show({
* title: "Who?",
* items: [
* this.jsonData.firstNames, this.jsonData.lastNames
* ],
* displayKey: 'name',
* defaultItems: [
* this.jsonData.firstNames[2],
* this.jsonData.lastNames[3]
* ]
* }).then(
* result => {
* console.log(result[0].name + ' (id= ' + this.jsonData.firstNames[result[0].index].id + '), ' +
* result[1].name + ' (id=' + this.jsonData.lastNames[result[1].index].id + ')');
* },
* err => console.log('Error: ' + JSON.stringify(err))
* );
* }
*
* ```
*