Compare commits

..

72 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
Ibby Hadeed
3cb83831c1 fix(app-preferences): suite is sync
closes #1321
2017-05-17 07:53:20 -04:00
Ibby Hadeed
ca7659378f fix(push): fix types
closes #1331
2017-05-17 07:51:19 -04:00
Ibby Hadeed
4333bc950d refactor(media): 2017-05-17 07:34:54 -04:00
Ibby Hadeed
ee4b61e405 fix(media): create will always return MediaObject even if plugin doesnt exist 2017-05-17 07:33:25 -04:00
Ibby Hadeed
975a65d619 fix(in-app-browser): fix on method
closes #1446
2017-05-17 07:27:51 -04:00
Ibby Hadeed
d68618f878 fix(media): create should return null if plugin is not available 2017-05-17 07:21:42 -04:00
Ibby Hadeed
e5aff0f5f0 Add TODO for 4.x 2017-05-17 07:13:04 -04:00
Ibby Hadeed
e596825ee9 docs(): update 2017-05-17 07:12:08 -04:00
Ibby Hadeed
991f2f04d4 feat(printer): add check method 2017-05-17 07:09:23 -04:00
Ibby Hadeed
ecdff8c0e5 docs(): add return type for pick 2017-05-17 07:03:27 -04:00
Ibby Hadeed
55071c0d65 fix(printer): fix implementation and add pick method 2017-05-17 07:03:07 -04:00
Ibby Hadeed
7d63e808ad docs(): fix repo link 2017-05-17 06:57:53 -04:00
Ibby Hadeed
84551cac67 docs(): fix docs 2017-05-17 06:53:13 -04:00
Ibby Hadeed
92ef4f0c33 fix(background-mode): configure doesn't return anything
closes #1457
2017-05-17 06:51:43 -04:00
Ibby Hadeed
d8eb621da4 docs(): fix param type 2017-05-17 06:50:43 -04:00
Ibby Hadeed
6534283a6f docs(): fix param type 2017-05-17 06:50:10 -04:00
Daniel Sogl
5145395dd7 docs(template): fix install command (#1572) 2017-05-17 06:47:35 -04:00
Ibby Hadeed
dfd0514a43 refactor(): optimize code 2017-05-17 06:47:20 -04:00
Elias Boukamza
d5919d1736 fix(secure-storage): reject the promise if the plugin doesn't exist (#1562) 2017-05-17 06:45:54 -04:00
Ibby Hadeed
71f7051997 docs(): fix typo 2017-05-17 06:45:22 -04:00
Ibby Hadeed
2858b4bad7 remove support option 2017-05-17 06:39:08 -04:00
Ibby Hadeed
4c8deb2bed feat(linkedin): add getActiveSession method
closes #1570
2017-05-17 06:36:04 -04:00
Ibby Hadeed
277b2b15e6 Merge branch 'master' of github.com:driftyco/ionic-native 2017-05-17 06:32:49 -04:00
Ibby Hadeed
ebf402864b fix(android-permissions): fix PERMISSION property and add requestPermission
closes #1574
2017-05-17 06:32:27 -04:00
David Routhieau
6b702973ec docs(): update plugin install source (#1573) 2017-05-17 05:33:01 -04:00
Ibby Hadeed
31983d8317 chore(): update changelog 2017-05-16 05:53:31 -04:00
43 changed files with 701 additions and 191 deletions

View File

@@ -1,7 +1,7 @@
**I'm submitting a ...** (check one with "x")
[ ] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://ionicworldwide.herokuapp.com/
<!-- Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://ionicworldwide.herokuapp.com/ -->
**Current behavior:**
<!-- Describe how the bug manifests. -->

View File

@@ -1,3 +1,98 @@
<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)
### Bug Fixes
* **document-viewer:** fix params and docs for canViewDocument (#1568) ([b35417a](https://github.com/driftyco/ionic-native/commit/b35417a)), closes [#1568](https://github.com/driftyco/ionic-native/issues/1568)
* **file:** add toInternalURL (#1561) ([7c79712](https://github.com/driftyco/ionic-native/commit/7c79712)), closes [#1560](https://github.com/driftyco/ionic-native/issues/1560)
* **file:** fix repo link (#1566) ([adf9c5a](https://github.com/driftyco/ionic-native/commit/adf9c5a)), closes [#1566](https://github.com/driftyco/ionic-native/issues/1566)
* **file:** various fixes ([d0dec7a](https://github.com/driftyco/ionic-native/commit/d0dec7a)), closes [#1564](https://github.com/driftyco/ionic-native/issues/1564)
* **sqlite:** fix implementation and improve typings ([fec19b7](https://github.com/driftyco/ionic-native/commit/fec19b7))
### Features
* **mix-panel:** add timeEvent (#1536) ([965a90c](https://github.com/driftyco/ionic-native/commit/965a90c))
<a name="3.8.0"></a>
# [3.8.0](https://github.com/driftyco/ionic-native/compare/v3.7.0...v3.8.0) (2017-05-14)

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

View File

@@ -165,7 +165,7 @@ docType: "<$ doc.docType $>"
<@ endif @>
<# --- Install commands --- #>
<pre><code class="nohighlight">$ <@ if prop.install @><$ prop.install $><@ else @>ionic plugin add --save <$ prop.plugin $><@ endif @>
<pre><code class="nohighlight">$ <@ if prop.install @><$ prop.install $><@ else @>ionic cordova plugin add <$ prop.plugin $><@ endif @>
$ npm install --save @ionic-native/<$ doc.npmId $>
</code></pre>
<p>Repo:

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

@@ -36,7 +36,7 @@ import { Injectable } from '@angular/core';
@Injectable()
export class AndroidPermissions extends IonicNativePlugin {
PERMISSION: {
PERMISSION: any = {
ACCESS_CHECKIN_PROPERTIES: 'android.permission.ACCESS_CHECKIN_PROPERTIES',
ACCESS_COARSE_LOCATION: 'android.permission.ACCESS_COARSE_LOCATION',
ACCESS_FINE_LOCATION: 'android.permission.ACCESS_FINE_LOCATION',
@@ -199,13 +199,21 @@ export class AndroidPermissions extends IonicNativePlugin {
@Cordova()
checkPermission(permission: string): Promise<any> { return; }
/**
* Request permission
* @param permission {string} The name of the permission to request
* @return {Promise<any>}
*/
@Cordova()
requestPermission(permission: string): Promise<any> { return; }
/**
* Request permissions
* @param permissions {array} An array with permissions
* @param permissions {Array<string>} An array with permissions
* @return {Promise<any>} Returns a promise
*/
@Cordova()
requestPermissions(permissions: string): Promise<any> { return; }
requestPermissions(permissions: string[]): Promise<any> { return; }
/**
* This function still works now, will not support in the future.

View File

@@ -108,14 +108,16 @@ export class AppPreferences extends IonicNativePlugin {
* @returns {Object} Custom object, bound to that suite
*/
@Cordova({
platforms: ['Android']
platforms: ['Android'],
sync: true
})
suite(suiteName: string): Object { return; }
suite(suiteName: string): any { return; }
@Cordova({
platforms: ['iOS']
platforms: ['iOS'],
sync: true
})
iosSuite(suiteName: string): Object { return; }
iosSuite(suiteName: string): any { return; }
/**
* Return cloud synchronized configuration context

View File

@@ -112,7 +112,7 @@ export class BackgroundMode extends IonicNativePlugin {
/**
* Override the default title, ticker and text.
* Available only for Android platform.
* @param {Configure} options List of option to configure. See table below
* @param {BackgroundModeConfiguration} options List of option to configure. See table below
*/
@Cordova({
platforms: ['Android']
@@ -122,12 +122,13 @@ export class BackgroundMode extends IonicNativePlugin {
/**
* Modify the displayed information.
* Available only for Android platform.
* @param {Configure} options Any options you want to update. See table below.
* @param {BackgroundModeConfiguration} options Any options you want to update. See table below.
*/
@Cordova({
platforms: ['Android']
platforms: ['Android'],
sync: true
})
configure(options?: BackgroundModeConfiguration): Promise<any> { return; }
configure(options?: BackgroundModeConfiguration): void {}
/**
* Listen for events that the plugin fires. Available events are `enable`, `disable`, `activate`, `deactivate` and `failure`.

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()
@@ -88,7 +88,7 @@ export class Deeplinks extends IonicNativePlugin {
/**
* Define a set of paths to match against incoming deeplinks.
*
* @param {paths} Define a set of paths to match against incoming deeplinks.
* @param {paths} paths Define a set of paths to match against incoming deeplinks.
* paths takes an object of the form { 'path': data }. If a deeplink
* matches the path, the resulting path-data pair will be returned in the
* promise result which you can then use to navigate in the app as you see fit.
@@ -110,11 +110,13 @@ export class Deeplinks extends IonicNativePlugin {
* This handler will automatically navigate when a route matches. If you need finer-grained
* control over the behavior of a matching deeplink, use the plain `route` method.
*
* @param {paths} Define a set of paths to match against incoming deeplinks.
* @param {Nav} navController Define a set of paths to match against incoming deeplinks.
* paths takes an object of the form { 'path': data }. If a deeplink
* matches the path, the resulting path-data pair will be returned in the
* promise result which you can then use to navigate in the app as you see fit.
*
* @param {Object} paths
*
* @returns {Observable<DeeplinkMatch>} Returns an Observable that resolves each time a deeplink comes through, and
* errors if a deeplink comes through that does not match a given path.
*/

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

@@ -23,7 +23,7 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
*/
@Plugin({
pluginName: 'FileChooser',
plugin: 'http://github.com/don/cordova-filechooser.git',
plugin: 'https://github.com/don/cordova-filechooser.git',
pluginRef: 'fileChooser',
repo: 'https://github.com/don/cordova-filechooser',
platforms: ['Android']

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

@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { Plugin, CordovaInstance, IonicNativePlugin } from '@ionic-native/core';
import { Plugin, CordovaInstance, InstanceCheck, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/fromEvent';
import { Observer } from 'rxjs/Observer';
declare const cordova: Cordova & { InAppBrowser: any; };
@@ -141,8 +141,12 @@ export class InAppBrowserObject {
* @param event {string} Name of the event
* @returns {Observable<InAppBrowserEvent>} Returns back an observable that will listen to the event on subscribe, and will stop listening to the event on unsubscribe.
*/
@InstanceCheck()
on(event: string): Observable<InAppBrowserEvent> {
return Observable.fromEvent(this._objectInstance, event);
return new Observable<InAppBrowserEvent>((observer: Observer<InAppBrowserEvent>) => {
this._objectInstance.addEventListener(event, observer.next.bind(observer));
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
});
}
}

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()
@@ -100,10 +100,17 @@ export class LinkedIn extends IonicNativePlugin {
openProfile(memberId: string): Promise<any> { return; }
/**
* Checks if there is already an existing active session. This should be used to avoid unecessary login.
* Checks if there is already an existing active session. This should be used to avoid unnecessary login.
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates whether there is an active session
*/
@Cordova()
hasActiveSession(): Promise<boolean> { return; }
/**
* Checks if there is an active session and returns the access token if it exists.
* @return {Promise<any>} returns a promise that resolves with an object that contains an access token if there is an active session
*/
@Cordova()
getActiveSession(): Promise<any> { return; }
}

View File

@@ -1,19 +1,14 @@
import { Injectable } from '@angular/core';
import { CordovaInstance, Plugin, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
import { CordovaInstance, Plugin, checkAvailability, IonicNativePlugin } from '@ionic-native/core';
declare const Media: any;
// TODO for ionic native 4.x ... rename plugin class to Media and use Media.getPlugin() to retrieve the original media object
/**
* @hidden
*/
export class MediaObject {
/**
* Open a media file
* @param src {string} A URI containing the audio content.
* @param onStatusUpdate {Function} A callback function to be invoked when the status of the file changes
*/
constructor(private _objectInstance: any) {}
/**
@@ -34,17 +29,13 @@ export class MediaObject {
* Get the duration of an audio file in seconds. If the duration is unknown, it returns a value of -1.
* @returns {number} Returns a promise with the duration of the current recording
*/
@CordovaInstance({
sync: true
})
@CordovaInstance({ sync: true })
getDuration(): number { return; }
/**
* Starts or resumes playing an audio file.
*/
@CordovaInstance({
sync: true
})
@CordovaInstance({ sync: true })
play(iosOptions?: {
numberOfLoops?: number,
playAudioWhenScreenIsLocked?: boolean
@@ -53,75 +44,57 @@ export class MediaObject {
/**
* Pauses playing an audio file.
*/
@CordovaInstance({
sync: true
})
@CordovaInstance({ sync: true })
pause(): void { }
/**
* Releases the underlying operating system's audio resources. This is particularly important for Android, since there are a finite amount of OpenCore instances for media playback. Applications should call the release function for any Media resource that is no longer needed.
*/
@CordovaInstance({
sync: true
})
@CordovaInstance({ sync: true })
release(): void { }
/**
* Sets the current position within an audio file.
* @param {number} milliseconds The time position you want to set for the current audio file
*/
@CordovaInstance({
sync: true
})
@CordovaInstance({ sync: true })
seekTo(milliseconds: number): void { }
/**
* Set the volume for an audio file.
* @param volume {number} The volume to set for playback. The value must be within the range of 0.0 to 1.0.
*/
@CordovaInstance({
sync: true
})
@CordovaInstance({ sync: true })
setVolume(volume: number): void { }
/**
* Starts recording an audio file.
*/
@CordovaInstance({
sync: true
})
@CordovaInstance({ sync: true })
startRecord(): void { }
/**
* Stops recording
*/
@CordovaInstance({
sync: true
})
@CordovaInstance({ sync: true })
stopRecord(): void { }
/**
* Pauses recording
*/
@CordovaInstance({
sync: true
})
@CordovaInstance({ sync: true })
pauseRecord(): void { }
/**
* Resumes recording
*/
@CordovaInstance({
sync: true
})
@CordovaInstance({ sync: true })
resumeRecord(): void { }
/**
* Stops playing an audio file.
*/
@CordovaInstance({
sync: true
})
@CordovaInstance({ sync: true })
stop(): void { }
}
@@ -292,15 +265,19 @@ export class MediaPlugin extends IonicNativePlugin {
* @param [onError] {MediaErrorCallback} A callback function is be invoked if an error occurs.
* @return {MediaObject}
*/
@CordovaCheck()
create(src: string,
onStatusUpdate?: MediaStatusUpdateCallback,
onSuccess?: Function,
onError?: MediaErrorCallback): MediaObject {
let instance: any;
if (checkAvailability(MediaPlugin.getPluginRef(), null, MediaPlugin.getPluginName()) === true) {
// Creates a new media object
const instance = new Media(src, onSuccess, onError, onStatusUpdate);
return new MediaObject(instance);
instance = new Media(src, onSuccess, onError, onStatusUpdate);
}
return new MediaObject(instance);
}

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

@@ -1,8 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
declare var cordova: any;
import { Cordova, CordovaCheck, Plugin, IonicNativePlugin } from '@ionic-native/core';
export interface PrintOptions {
/**
@@ -41,6 +38,7 @@ export interface PrintOptions {
*/
bounds?: number[] | any;
}
/**
* @name Printer
* @description Prints documents or HTML rendered content
@@ -71,7 +69,7 @@ export interface PrintOptions {
pluginName: 'Printer',
plugin: 'de.appplant.cordova.plugin.printer',
pluginRef: 'cordova.plugins.printer',
repo: 'https://github.com/katzer/cordova-plugin-printer.git',
repo: 'https://github.com/katzer/cordova-plugin-printer',
platforms: ['Android', 'iOS']
})
@Injectable()
@@ -81,8 +79,31 @@ export class Printer extends IonicNativePlugin {
* Checks whether to device is capable of printing.
* @returns {Promise<boolean>}
*/
isAvailable(): Promise<boolean> {
return this.check()
.then((res: any) => Promise.resolve(res.avail));
}
/**
* Checks if the printer service is available (iOS) or if printer services are installed and enabled (Android).
* @return {Promise<any>} returns a promise that resolve with an object indicating whether printing is available, and providing the number of printers available
*/
@CordovaCheck()
check(): Promise<any> {
return new Promise<any>((resolve: Function) => {
Printer.getPlugin()
.check((avail: boolean, count: any) => {
resolve({ avail, count });
});
});
}
/**
* Displays a system interface allowing the user to select an available printer. To speak with a printer directly you need to know the network address by picking them before via `printer.pick`.
* @returns {Promise<any>}
*/
@Cordova()
isAvailable(): Promise<boolean> { return; }
pick(): Promise<any> { return; }
/**
* Sends content to the printer.
@@ -90,7 +111,10 @@ export class Printer extends IonicNativePlugin {
* @param options {PrintOptions} optional. The options to pass to the printer
* @returns {Promise<any>}
*/
@Cordova()
@Cordova({
successIndex: 2,
errorIndex: 4
})
print(content: string | HTMLElement, options?: PrintOptions): Promise<any> { return; }
}

View File

@@ -4,7 +4,7 @@ import { Observable } from 'rxjs/Observable';
declare var window: any;
export type EventResponse = RegistrationEventResponse | NotificationEventResponse | Error;
export type EventResponse = RegistrationEventResponse & NotificationEventResponse & Error;
export interface RegistrationEventResponse {
/**
@@ -39,7 +39,7 @@ export interface NotificationEventResponse {
/**
* An optional collection of data sent by the 3rd party push service that does not fit in the above properties.
*/
additionalData: NotificationEventAdditionalData | any;
additionalData: NotificationEventAdditionalData & any;
}
/**
@@ -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

@@ -1,14 +1,12 @@
import { Injectable } from '@angular/core';
import { CordovaInstance, Plugin, checkAvailability, IonicNativePlugin } from '@ionic-native/core';
declare var cordova: any;
import { CordovaInstance, Plugin, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
/**
* @hidden
*/
export class SecureStorageObject {
constructor(private _objectInstance?: any) { }
constructor(private _objectInstance: any) { }
/**
* Gets a stored item
@@ -120,13 +118,10 @@ export class SecureStorage extends IonicNativePlugin {
* @param store {string}
* @returns {Promise<SecureStorageObject>}
*/
@CordovaCheck()
create(store: string): Promise<SecureStorageObject> {
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 {
res(new SecureStorageObject());
}
return new Promise((res: Function, rej: Function) => {
const instance = new (SecureStorage.getPlugin())(() => res(new SecureStorageObject(instance)), rej, store);
});
}

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

View File

@@ -34,10 +34,12 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
})
@Injectable()
export class YoutubeVideoPlayer extends IonicNativePlugin {
/**
* Plays a YouTube video
* @param videoId {string} Video ID
*/
@Cordova({ sync: true })
openVideo(videoId: string): void { }
}