mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-04-13 00:00:10 +08:00
Compare commits
183 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| da0fd821f7 | |||
| 6a18d3f1e0 | |||
| 5072c99938 | |||
| e40247c211 | |||
| 593607e914 | |||
| 51fc5332ff | |||
| 27fdac91fd | |||
| 3c125bbc84 | |||
| 62c39b33c6 | |||
| e6f81519cc | |||
| 64ce132262 | |||
| af91977f82 | |||
| 07443e0b53 | |||
| 72f838d768 | |||
| fa86cee3fa | |||
| 83c25b41ef | |||
| 2128703d8d | |||
| b52371b174 | |||
| 65c2665fc0 | |||
| 279b449456 | |||
| 9bd4994f01 | |||
| ab74703841 | |||
| 18a81a77a9 | |||
| 2ebfa46437 | |||
| 1d4fc03cba | |||
| e9283a994d | |||
| ed6fe880b6 | |||
| a2d979a277 | |||
| 1ccfb1d84c | |||
| 2ec0f87a79 | |||
| 03ac735476 | |||
| 9eb29f8924 | |||
| 85a1f6a35b | |||
| 3cb7d6d4d8 | |||
| 884cabd301 | |||
| 663c24d2fa | |||
| fecf8ad994 | |||
| b05ba586f8 | |||
| 4ed8f9337f | |||
| 25446441cf | |||
| 0805d7754e | |||
| d60c0800e7 | |||
| 35f498b82c | |||
| 8cf4a57a77 | |||
| cb51b5abd6 | |||
| 59a8e76ba9 | |||
| 8f985025d1 | |||
| 7d9df8c82f | |||
| 22ccbfdf8f | |||
| c6a76c26e0 | |||
| c3f9fb4a23 | |||
| abeedbf2fa | |||
| 9bdabd3ac3 | |||
| 0467a0dd32 | |||
| 3eb69b4056 | |||
| 793e2e34d3 | |||
| dd7098d5bd | |||
| 268e22456e | |||
| 9950b18e38 | |||
| b4deaaa941 | |||
| 328e5de3f3 | |||
| 41dae53bf2 | |||
| 3027b5ea16 | |||
| ec773de686 | |||
| f3b7467ffd | |||
| d9546f15ed | |||
| 52dcd808b6 | |||
| 985193bebd | |||
| 9bf9e9d073 | |||
| 8b9995a5af | |||
| 2d3add6507 | |||
| ee59b55c29 | |||
| 28bb6dc1a8 | |||
| b587a0e647 | |||
| d9d7919174 | |||
| 11c42757d7 | |||
| 4e4216ff6d | |||
| 496968b9fc | |||
| bf3f9d8799 | |||
| 6f22134851 | |||
| aaeabb9f96 | |||
| 6d4da1fff4 | |||
| c0fd19fd33 | |||
| f2c4f380f8 | |||
| c96ae3db0d | |||
| c2a6198576 | |||
| 2b3d4c9090 | |||
| dbb17d801e | |||
| 0b1e4e6e84 | |||
| 8c82c87811 | |||
| 9997caf506 | |||
| c8f53d2dc3 | |||
| a10d763a41 | |||
| e44fdb6730 | |||
| bb8973a0ea | |||
| 6031a240a2 | |||
| 2bd244a536 | |||
| 64bff1bbed | |||
| da5266cd65 | |||
| c1082b1c14 | |||
| 2cf132ee88 | |||
| e411146e8f | |||
| 5f63493bdc | |||
| 999c288b23 | |||
| 2e83ade978 | |||
| 08bf57f488 | |||
| 6f6392ea5c | |||
| 0b2227d35a | |||
| 4bfceadb65 | |||
| 61c73eaa4e | |||
| c0c0c5cec5 | |||
| 5b82d82d75 | |||
| 36be795623 | |||
| 0996264483 | |||
| 2245bb8050 | |||
| e14e00edba | |||
| 22102a7e4a | |||
| 6416c2544c | |||
| 73a510f9c2 | |||
| b8b605db5e | |||
| 12168d991a | |||
| 93a119bf4b | |||
| a7c62de389 | |||
| 8aca6718e1 | |||
| 1ec4bdef8f | |||
| d6ed87d7cc | |||
| 55f3f37760 | |||
| 4f547dae30 | |||
| 3cb83831c1 | |||
| ca7659378f | |||
| 4333bc950d | |||
| ee4b61e405 | |||
| 975a65d619 | |||
| d68618f878 | |||
| e5aff0f5f0 | |||
| e596825ee9 | |||
| 991f2f04d4 | |||
| ecdff8c0e5 | |||
| 55071c0d65 | |||
| 7d63e808ad | |||
| 84551cac67 | |||
| 92ef4f0c33 | |||
| d8eb621da4 | |||
| 6534283a6f | |||
| f223481307 | |||
| 5145395dd7 | |||
| dfd0514a43 | |||
| d5919d1736 | |||
| 71f7051997 | |||
| 2858b4bad7 | |||
| 4c8deb2bed | |||
| 277b2b15e6 | |||
| ebf402864b | |||
| 6b702973ec | |||
| 7d4e8acce8 | |||
| 31983d8317 | |||
| 8c842b00b6 | |||
| c6feaafcca | |||
| a7f7b26a76 | |||
| d0dec7a17d | |||
| 7487293d33 | |||
| 4f6ec0cfcd | |||
| b35417a017 | |||
| adf9c5a323 | |||
| 7c797123f5 | |||
| bd1794d7f5 | |||
| 46502cb864 | |||
| 02cc615c21 | |||
| 749fd8af43 | |||
| e2acde5332 | |||
| 5203d026d4 | |||
| 362ae4422b | |||
| 965a90c52c | |||
| a28de660bc | |||
| fec19b734c | |||
| 6773ed341c | |||
| dea9f42d5f | |||
| e193baf1c1 | |||
| 4835182ad5 | |||
| 49ac21145a | |||
| 8a81ee08e3 | |||
| 36d101af02 | |||
| 8e65474c1d |
@@ -4,7 +4,7 @@
|
|||||||
#### There are no rules, but here are a few things to consider:
|
#### There are no rules, but here are a few things to consider:
|
||||||
###### Before you submit an issue:
|
###### Before you submit an issue:
|
||||||
* Do a quick search to see if there are similar issues
|
* Do a quick search to see if there are similar issues
|
||||||
* Make sure that you are waiting for `deviceready` to fire before interacting with any plugin. If you are using Ionic 2, this can be done using [the `Platform.ready()` function](http://ionicframework.com/docs/api/platform/Platform/#ready).
|
* Make sure that you are waiting for `deviceready` to fire before interacting with any plugin. If you are using Ionic, this can be done using [the `Platform.ready()` function](http://ionicframework.com/docs/api/platform/Platform/#ready).
|
||||||
* **Check that you are using the latest version of** `ionic-native`, you can install the latest version by running `npm i --save @ionic-native/core@latest`
|
* **Check that you are using the latest version of** `ionic-native`, you can install the latest version by running `npm i --save @ionic-native/core@latest`
|
||||||
|
|
||||||
###### Still having problems? submit an issue with the following details:
|
###### Still having problems? submit an issue with the following details:
|
||||||
@@ -16,4 +16,4 @@
|
|||||||
## Feature request?
|
## Feature request?
|
||||||
Have a plugin you'd like to see supported? Since Ionic Native is a thin wrapper around existing Cordova plugins, adding support for new plugins is as easy as creating a new wrapper for whatever plugin you'd like to add.
|
Have a plugin you'd like to see supported? Since Ionic Native is a thin wrapper around existing Cordova plugins, adding support for new plugins is as easy as creating a new wrapper for whatever plugin you'd like to add.
|
||||||
|
|
||||||
Take a look at our [Developer Guide](https://github.com/driftyco/ionic-native/blob/master/DEVELOPER.md) for more info on adding new plugins.
|
Take a look at our [Developer Guide](https://github.com/ionic-team/ionic-native/blob/master/DEVELOPER.md) for more info on adding new plugins.
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
**I'm submitting a ...** (check one with "x")
|
||||||
|
[ ] bug report
|
||||||
|
[ ] feature request
|
||||||
|
<!-- 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. -->
|
||||||
|
|
||||||
|
**Expected behavior:**
|
||||||
|
<!-- Describe what the behavior would be without the bug. -->
|
||||||
|
|
||||||
|
**Steps to reproduce:**
|
||||||
|
<!-- If you are able to illustrate the bug or feature request with an example, please provide steps to reproduce. -->
|
||||||
|
|
||||||
|
**Related code:**
|
||||||
|
|
||||||
|
```
|
||||||
|
insert any relevant code here
|
||||||
|
```
|
||||||
|
|
||||||
|
**Other information:**
|
||||||
|
<!-- List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to fix, Stack Overflow links, forum links, etc. -->
|
||||||
|
|
||||||
|
**package.json info:**
|
||||||
|
|
||||||
|
```json
|
||||||
|
insert the content here
|
||||||
|
```
|
||||||
+741
-629
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -103,7 +103,7 @@ Next, let's look at the `watchPosition` method.
|
|||||||
|
|
||||||
The `@Cordova` decorator has a few more options now.
|
The `@Cordova` decorator has a few more options now.
|
||||||
|
|
||||||
`observable` indicates that this method may call its callbacks multiple times, so `@Cordova` wraps it in an [`Observable`](https://github.com/driftyco/ionic-native#promises-and-observables) instead of a Promise.
|
`observable` indicates that this method may call its callbacks multiple times, so `@Cordova` wraps it in an [`Observable`](https://github.com/ionic-team/ionic-native#promises-and-observables) instead of a Promise.
|
||||||
|
|
||||||
`callbackOrder` refers to the method signature of the underlying Cordova plugin, and tells Ionic Native which arguments are the callbacks to map to the wrapping Promise or Observable. In this case, the signature is [`watchPosition(success, error, options)`](https://github.com/apache/cordova-plugin-geolocation#navigatorgeolocationwatchposition), so we need to tell `@Cordova` that the callbacks are the first arguments, not the last arguments. For rare cases, you can also specify the options `successIndex` and `errorIndex` to indicate where in the argument list the callbacks are located.
|
`callbackOrder` refers to the method signature of the underlying Cordova plugin, and tells Ionic Native which arguments are the callbacks to map to the wrapping Promise or Observable. In this case, the signature is [`watchPosition(success, error, options)`](https://github.com/apache/cordova-plugin-geolocation#navigatorgeolocationwatchposition), so we need to tell `@Cordova` that the callbacks are the first arguments, not the last arguments. For rare cases, you can also specify the options `successIndex` and `errorIndex` to indicate where in the argument list the callbacks are located.
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[](https://circleci.com/gh/driftyco/ionic-native) [](http://commitizen.github.io/cz-cli/) 
|
[](https://circleci.com/gh/ionic-team/ionic-native) [](http://commitizen.github.io/cz-cli/) 
|
||||||
|
|
||||||
|
|
||||||
# Ionic Native
|
# Ionic Native
|
||||||
@@ -169,11 +169,11 @@ Spent way too long diagnosing an issue only to realize a plugin wasn't firing or
|
|||||||
|
|
||||||
|
|
||||||
## Plugin Missing?
|
## Plugin Missing?
|
||||||
Let us know or submit a PR! Take a look at [the Developer Guide](https://github.com/driftyco/ionic-native/blob/master/DEVELOPER.md) for more on how to contribute. :heart:
|
Let us know or submit a PR! Take a look at [the Developer Guide](https://github.com/ionic-team/ionic-native/blob/master/DEVELOPER.md) for more on how to contribute. :heart:
|
||||||
|
|
||||||
## Ionic V1/Angular 1 support
|
## Ionic V1/Angular 1 support
|
||||||
|
|
||||||
For Ionic V1/Angular 1 support, please use version 2 of Ionic Native. See the [2.x README](https://github.com/driftyco/ionic-native/blob/8cd648db5cddd7bdbe2bd78839b19c620cc8c04c/README.md) for usage information.
|
For Ionic V1/Angular 1 support, please use version 2 of Ionic Native. See the [2.x README](https://github.com/ionic-team/ionic-native/blob/8cd648db5cddd7bdbe2bd78839b19c620cc8c04c/README.md) for usage information.
|
||||||
|
|
||||||
# Credits
|
# Credits
|
||||||
|
|
||||||
|
|||||||
+13
-3
@@ -7,12 +7,15 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
key: ionic-site
|
key: ionic-site-{{ checksum "package.json" }}
|
||||||
- run:
|
- run:
|
||||||
name: Prepare ionic-site repo
|
name: Prepare ionic-site repo
|
||||||
command: ./scripts/docs/prepare.sh
|
command: |
|
||||||
|
if [ "${CIRCLE_BRANCH}" == "master" ]; then
|
||||||
|
./scripts/docs/prepare.sh
|
||||||
|
fi
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: ionic-site
|
key: ionic-site-{{ checksum "package.json" }}
|
||||||
paths:
|
paths:
|
||||||
- ~/ionic-site/
|
- ~/ionic-site/
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
@@ -27,6 +30,13 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
name: Run tslint
|
name: Run tslint
|
||||||
command: npm run lint
|
command: npm run lint
|
||||||
|
- run: bash ./scripts/git/config.sh
|
||||||
|
- run:
|
||||||
|
name: Build Ionic Native
|
||||||
|
command: npm run build:core && ./node_modules/.bin/tsc
|
||||||
|
- run:
|
||||||
|
name: Run tests
|
||||||
|
command: npm test
|
||||||
- add_ssh_keys
|
- add_ssh_keys
|
||||||
- deploy:
|
- deploy:
|
||||||
name: Update docs
|
name: Update docs
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
module.exports = config => {
|
||||||
|
|
||||||
|
const conf = {
|
||||||
|
frameworks: [
|
||||||
|
'jasmine',
|
||||||
|
'karma-typescript'
|
||||||
|
],
|
||||||
|
|
||||||
|
plugins: [
|
||||||
|
'karma-typescript',
|
||||||
|
'karma-jasmine',
|
||||||
|
'karma-phantomjs-launcher'
|
||||||
|
],
|
||||||
|
|
||||||
|
preprocessors: {
|
||||||
|
'src/**/*.ts': ['karma-typescript']
|
||||||
|
},
|
||||||
|
|
||||||
|
karmaTypescriptConfig: {
|
||||||
|
bundlerOptions: {
|
||||||
|
entrypoints: /\.spec\.ts$/,
|
||||||
|
transforms: [
|
||||||
|
require("karma-typescript-es6-transform")()
|
||||||
|
]
|
||||||
|
},
|
||||||
|
compilerOptions: {
|
||||||
|
lib: ['es2015', 'dom'],
|
||||||
|
paths: {
|
||||||
|
"@ionic-native/core": ["./src/@ionic-native/core"]
|
||||||
|
},
|
||||||
|
baseUrl: '.'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
files: [
|
||||||
|
{ pattern: 'src/**/*.ts', included: true, watched: true }
|
||||||
|
],
|
||||||
|
|
||||||
|
reporters: ['progress'],
|
||||||
|
|
||||||
|
port: 9876,
|
||||||
|
colors: true,
|
||||||
|
logLevel: config.INFO,
|
||||||
|
autoWatch: true,
|
||||||
|
browsers: [
|
||||||
|
'PhantomJS'
|
||||||
|
],
|
||||||
|
singleRun: false
|
||||||
|
};
|
||||||
|
|
||||||
|
config.set(conf);
|
||||||
|
|
||||||
|
};
|
||||||
Generated
+5567
File diff suppressed because it is too large
Load Diff
+33
-13
@@ -1,18 +1,22 @@
|
|||||||
{
|
{
|
||||||
"name": "ionic-native",
|
"name": "ionic-native",
|
||||||
"version": "3.8.0",
|
"version": "3.12.2",
|
||||||
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
|
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
|
||||||
|
"homepage": "https://ionicframework.com/",
|
||||||
|
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular/compiler": "4.1.2",
|
"@angular/compiler": "4.1.3",
|
||||||
"@angular/compiler-cli": "4.1.2",
|
"@angular/compiler-cli": "4.1.3",
|
||||||
"@angular/core": "4.1.2",
|
"@angular/core": "4.1.3",
|
||||||
"@types/cordova": "0.0.34",
|
"@types/cordova": "0.0.34",
|
||||||
|
"@types/jasmine": "^2.5.51",
|
||||||
|
"@types/node": "^7.0.27",
|
||||||
"canonical-path": "0.0.2",
|
"canonical-path": "0.0.2",
|
||||||
"child-process-promise": "2.2.0",
|
"child-process-promise": "2.2.1",
|
||||||
"conventional-changelog-cli": "1.2.0",
|
"conventional-changelog-cli": "1.3.1",
|
||||||
"cpr": "2.0.2",
|
"cpr": "2.0.2",
|
||||||
"cz-conventional-changelog": "1.2.0",
|
"cz-conventional-changelog": "2.0.0",
|
||||||
"decamelize": "1.2.0",
|
"decamelize": "1.2.0",
|
||||||
"dgeni": "0.4.7",
|
"dgeni": "0.4.7",
|
||||||
"dgeni-packages": "0.16.10",
|
"dgeni-packages": "0.16.10",
|
||||||
@@ -22,18 +26,25 @@
|
|||||||
"gulp-rename": "1.2.2",
|
"gulp-rename": "1.2.2",
|
||||||
"gulp-replace": "0.5.4",
|
"gulp-replace": "0.5.4",
|
||||||
"gulp-tslint": "6.1.2",
|
"gulp-tslint": "6.1.2",
|
||||||
|
"jasmine-core": "^2.6.1",
|
||||||
|
"karma": "^1.7.0",
|
||||||
|
"karma-cli": "^1.0.1",
|
||||||
|
"karma-jasmine": "^1.1.0",
|
||||||
|
"karma-phantomjs-launcher": "^1.0.4",
|
||||||
|
"karma-typescript": "^3.0.1",
|
||||||
|
"karma-typescript-es6-transform": "^1.0.0",
|
||||||
"lodash": "4.17.4",
|
"lodash": "4.17.4",
|
||||||
"minimist": "1.1.3",
|
"minimist": "1.2.0",
|
||||||
"node-html-encoder": "0.0.2",
|
"node-html-encoder": "0.0.2",
|
||||||
"q": "1.4.1",
|
"q": "1.5.0",
|
||||||
"queue": "4.2.1",
|
"queue": "4.2.1",
|
||||||
"rimraf": "2.5.4",
|
"rimraf": "2.6.1",
|
||||||
"rxjs": "5.1.1",
|
"rxjs": "5.1.1",
|
||||||
"semver": "5.3.0",
|
"semver": "5.3.0",
|
||||||
"tslint": "3.15.1",
|
"tslint": "3.15.1",
|
||||||
"tslint-ionic-rules": "0.0.8",
|
"tslint-ionic-rules": "0.0.8",
|
||||||
"typescript": "2.3.2",
|
"typescript": "2.3.3",
|
||||||
"zone.js": "^0.8.10"
|
"zone.js": "^0.8.11"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "npm run test:watch",
|
"start": "npm run test:watch",
|
||||||
@@ -45,7 +56,16 @@
|
|||||||
"shipit": "npm run build && gulp readmes && npm run npmpub",
|
"shipit": "npm run build && gulp readmes && npm run npmpub",
|
||||||
"npmpub": "node scripts/build/publish.js",
|
"npmpub": "node scripts/build/publish.js",
|
||||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
|
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
|
||||||
"postchangelog": "git commit -am \"chore(): update changelog\""
|
"postchangelog": "git commit -am \"chore(): update changelog\"",
|
||||||
|
"test": "karma start karma.conf.js --single-run",
|
||||||
|
"test:watch": "karma start karma.conf.js"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/ionic-team/ionic-native.git"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/ionic-team/ionic-native/issues"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"commitizen": {
|
"commitizen": {
|
||||||
|
|||||||
+31
-5
@@ -52,6 +52,16 @@ const PLUGINS = fs.readdirSync(PLUGINS_PATH);
|
|||||||
|
|
||||||
// Build specific list of plugins to build from arguments, if any
|
// Build specific list of plugins to build from arguments, if any
|
||||||
let pluginsToBuild = process.argv.slice(2);
|
let pluginsToBuild = process.argv.slice(2);
|
||||||
|
let ignoreErrors = false;
|
||||||
|
let errors = [];
|
||||||
|
|
||||||
|
const index = pluginsToBuild.indexOf('ignore-errors');
|
||||||
|
if (index > -1) {
|
||||||
|
ignoreErrors = true;
|
||||||
|
pluginsToBuild.splice(index, 1);
|
||||||
|
console.log('Build will continue even if errors were thrown. Errors will be printed when build finishes.');
|
||||||
|
}
|
||||||
|
|
||||||
if (!pluginsToBuild.length) {
|
if (!pluginsToBuild.length) {
|
||||||
pluginsToBuild = PLUGINS;
|
pluginsToBuild = PLUGINS;
|
||||||
}
|
}
|
||||||
@@ -102,10 +112,16 @@ const addPluginToQueue = pluginName => {
|
|||||||
exec(`${ROOT}/node_modules/.bin/ngc -p ${tsConfigPath}`, (err, stdout, stderr) => {
|
exec(`${ROOT}/node_modules/.bin/ngc -p ${tsConfigPath}`, (err, stdout, stderr) => {
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
// oops! something went wrong.
|
|
||||||
callback(`\n\nBuilding ${pluginName} failed.`);
|
if (!ignoreErrors) {
|
||||||
console.log(err);
|
// oops! something went wrong.
|
||||||
return;
|
console.log(err);
|
||||||
|
callback(`\n\nBuilding ${pluginName} failed.`);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
errors.push(err);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// we're done with this plugin!
|
// we're done with this plugin!
|
||||||
@@ -125,7 +141,17 @@ pluginsToBuild.forEach(addPluginToQueue);
|
|||||||
QUEUE.start((err) => {
|
QUEUE.start((err) => {
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log('Error building plugins. ', err);
|
console.log('Error building plugins.');
|
||||||
|
console.log(err);
|
||||||
|
process.stderr.write(err);
|
||||||
|
process.exit(1);
|
||||||
|
} else if (errors.length) {
|
||||||
|
errors.forEach(e => {
|
||||||
|
console.log(e.message) && console.log('\n');
|
||||||
|
process.stderr.write(err);
|
||||||
|
});
|
||||||
|
console.log('Build complete with errors');
|
||||||
|
process.exit(1);
|
||||||
} else {
|
} else {
|
||||||
console.log('Done processing plugins!');
|
console.log('Done processing plugins!');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,6 @@
|
|||||||
"peerDependencies": {},
|
"peerDependencies": {},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/driftyco/ionic-native.git"
|
"url": "https://github.com/ionic-team/ionic-native.git"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,6 @@
|
|||||||
"peerDependencies": {},
|
"peerDependencies": {},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/driftyco/ionic-native.git"
|
"url": "https://github.com/ionic-team/ionic-native.git"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,8 @@
|
|||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"lib": ["es2015", "dom"],
|
"lib": ["es2015", "dom"],
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"inlineSources": true
|
"inlineSources": true,
|
||||||
|
"noImplicitAny": true
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"../../src/@ionic-native/core/index.ts"
|
"../../src/@ionic-native/core/index.ts"
|
||||||
|
|||||||
@@ -16,7 +16,8 @@
|
|||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"lib": ["es2015", "dom"],
|
"lib": ["es2015", "dom"],
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"inlineSources": true
|
"inlineSources": true,
|
||||||
|
"noImplicitAny": true
|
||||||
},
|
},
|
||||||
"files": []
|
"files": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
const exec = require('child-process-promise').exec;
|
||||||
|
let diff;
|
||||||
|
exec(`git branch | grep \\* | cut -d ' ' -f2`)
|
||||||
|
.then(output => {
|
||||||
|
if (output.stderr) {
|
||||||
|
return Promise.reject(output.stderr);
|
||||||
|
}
|
||||||
|
|
||||||
|
const branch = output.stdout.trim();
|
||||||
|
|
||||||
|
if (branch !== 'master') {
|
||||||
|
|
||||||
|
console.log('Merging master branch in ...');
|
||||||
|
// not on master branch
|
||||||
|
// let's test the changes that were made
|
||||||
|
return exec(`git merge origin master`);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then((output) => {
|
||||||
|
if (output && output.stderr) {
|
||||||
|
return Promise.reject(output.stderr);
|
||||||
|
}
|
||||||
|
console.log('Checking for differences ...');
|
||||||
|
return exec(`git diff --name-status origin master`)
|
||||||
|
})
|
||||||
|
.then((output) => {
|
||||||
|
if (output && output.stderr) {
|
||||||
|
return Promise.reject(output.stderr);
|
||||||
|
}
|
||||||
|
|
||||||
|
diff = output.stdout;
|
||||||
|
diff = diff.replace(/A\s+/g, '');
|
||||||
|
diff = diff.match(/src\/@ionic-native\/plugins\/([a-zA-Z0-9\-]+)\/index\.ts/g);
|
||||||
|
|
||||||
|
if (!diff) process.exit();
|
||||||
|
|
||||||
|
console.log(`${ diff.length } plugins were modified. We will now build them to verify they still work.`);
|
||||||
|
|
||||||
|
return exec('npm run build:core --silent');
|
||||||
|
})
|
||||||
|
.then((output) => {
|
||||||
|
|
||||||
|
if (output && output.stderr) {
|
||||||
|
return Promise.reject(output.stderr);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('Built core library successfully ...');
|
||||||
|
console.log('Building plugins ...');
|
||||||
|
|
||||||
|
diff = diff.map(text => text.replace('src/@ionic-native/plugins/', '').replace('/index.ts', ''));
|
||||||
|
|
||||||
|
return exec(`npm run build:modules ${diff.join(' ')} --silent`);
|
||||||
|
})
|
||||||
|
.then((output) => {
|
||||||
|
if (output && output.stderr) {
|
||||||
|
console.log(output.stderr);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
console.log(output.stdout);
|
||||||
|
process.exit();
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
console.log(e.message || e);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
+15
-8
@@ -44,7 +44,7 @@ docType: "<$ doc.docType $>"
|
|||||||
<@- endmacro -@>
|
<@- endmacro -@>
|
||||||
|
|
||||||
<@- macro githubViewLink(doc) -@>
|
<@- macro githubViewLink(doc) -@>
|
||||||
<a href="https://github.com/driftyco/ionic-native/tree/master/<$ doc.fileInfo.relativePath $>#L<$ doc.location.start.line+1 $>-L<$ doc.location.end.line+1 $>"><$ doc.fileInfo.relativePath $> (line <$ doc.location.start.line+1 $>)</a>
|
<a href="https://github.com/ionic-team/ionic-native/tree/master/<$ doc.fileInfo.relativePath $>#L<$ doc.location.start.line+1 $>-L<$ doc.location.end.line+1 $>"><$ doc.fileInfo.relativePath $> (line <$ doc.location.start.line+1 $>)</a>
|
||||||
<@- endmacro -@>
|
<@- endmacro -@>
|
||||||
|
|
||||||
<@- macro paramTable(params, isDirective) -@>
|
<@- macro paramTable(params, isDirective) -@>
|
||||||
@@ -149,7 +149,7 @@ docType: "<$ doc.docType $>"
|
|||||||
<@- endif -@>
|
<@- endif -@>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<a class="improve-v2-docs" href="http://github.com/driftyco/ionic-native/edit/master/<$ doc.fileInfo.relativePath|replace('/home/ubuntu/ionic-native/', '')|replace('//','/') $>#L<$ doc.location.start.line $>">
|
<a class="improve-v2-docs" href="http://github.com/ionic-team/ionic-native/edit/master/<$ doc.fileInfo.relativePath|replace('/home/ubuntu/ionic-native/', '')|replace('//','/') $>#L<$ doc.location.start.line $>">
|
||||||
Improve this doc
|
Improve this doc
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
@@ -164,18 +164,25 @@ docType: "<$ doc.docType $>"
|
|||||||
</p>
|
</p>
|
||||||
<@ endif @>
|
<@ endif @>
|
||||||
|
|
||||||
<# --- Install commands --- #>
|
<# --- Plugin description --- #>
|
||||||
<pre><code class="nohighlight">$ <@ if prop.install @><$ prop.install $><@ else @>ionic plugin add --save <$ prop.plugin $><@ endif @>
|
<$ doc.description | marked $>
|
||||||
$ npm install --save @ionic-native/<$ doc.npmId $>
|
|
||||||
</code></pre>
|
|
||||||
<p>Repo:
|
<p>Repo:
|
||||||
<a href="<$ prop.repo $>">
|
<a href="<$ prop.repo $>">
|
||||||
<$ prop.repo $>
|
<$ prop.repo $>
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<# --- Plugin description --- #>
|
<# --- Install commands --- #>
|
||||||
<$ doc.description | marked $>
|
<h2>Installation</h2>
|
||||||
|
<ol class="installation">
|
||||||
|
<li>Install the Cordova and Ionic Native plugins:<br>
|
||||||
|
<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>
|
||||||
|
</li>
|
||||||
|
<li><a href="https://ionicframework.com/docs/native/#Add_Plugins_to_Your_App_Module">Add this plugin to your app's module</a></li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
<# --- Plugin supported platforms --- #>
|
<# --- Plugin supported platforms --- #>
|
||||||
<@ if prop.platforms @>
|
<@ if prop.platforms @>
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
<a style="float:right;font-size:12px;" href="http://github.com/driftyco/ionic-native/edit/master/<$ doc.fileInfo.relativePath|replace('/home/ubuntu/ionic-native/', '')|replace('//','/') $>#L<$ doc.location.start.line $>">
|
<a style="float:right;font-size:12px;" href="http://github.com/ionic-team/ionic-native/edit/master/<$ doc.fileInfo.relativePath|replace('/home/ubuntu/ionic-native/', '')|replace('//','/') $>#L<$ doc.location.start.line $>">
|
||||||
Improve this doc
|
Improve this doc
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
<@ for prop in doc.decorators[0].argumentInfo @>
|
<@ for prop in doc.decorators[0].argumentInfo @>
|
||||||
|
|
||||||
```
|
```
|
||||||
$ <@ if prop.install @><$ prop.install $><@ else @>ionic plugin add <$ prop.plugin $><@ endif @>
|
$ <@ if prop.install @><$ prop.install $><@ else @>ionic cordova plugin add <$ prop.plugin $><@ endif @>
|
||||||
$ npm install --save @ionic-native/<$ doc.npmId $>
|
$ npm install --save @ionic-native/<$ doc.npmId $>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -31,11 +31,11 @@ function run {
|
|||||||
if [ $CHANGED -eq 0 ];
|
if [ $CHANGED -eq 0 ];
|
||||||
then
|
then
|
||||||
echo "-- No changes detected for the following commit, docs not updated."
|
echo "-- No changes detected for the following commit, docs not updated."
|
||||||
echo "https://github.com/driftyco/$CIRCLE_PROJECT_REPONAME/commit/$CIRCLE_SHA1"
|
echo "https://github.com/ionic-team/$CIRCLE_PROJECT_REPONAME/commit/$CIRCLE_SHA1"
|
||||||
else
|
else
|
||||||
git config --global user.email "hi@ionicframework.com"
|
git config --global user.email "hi@ionicframework.com"
|
||||||
git config --global user.name "Ionitron"
|
git config --global user.name "Ionitron"
|
||||||
git commit -am "Automated build of native docs driftyco/$CIRCLE_PROJECT_REPONAME@$CIRCLE_SHA1"
|
git commit -am "Automated build of native docs ionic-team/$CIRCLE_PROJECT_REPONAME@$CIRCLE_SHA1"
|
||||||
# in case a different commit was pushed to ionic-site during doc/demo gen,
|
# in case a different commit was pushed to ionic-site during doc/demo gen,
|
||||||
# try to rebase around it before pushing
|
# try to rebase around it before pushing
|
||||||
git fetch
|
git fetch
|
||||||
|
|||||||
@@ -18,12 +18,12 @@ function run {
|
|||||||
if [ -z "$CHANGED" ];
|
if [ -z "$CHANGED" ];
|
||||||
then
|
then
|
||||||
echo "-- No changes detected for the following commit, docs not updated."
|
echo "-- No changes detected for the following commit, docs not updated."
|
||||||
echo "https://github.com/driftyco/$CIRCLE_PROJECT_REPONAME/commit/$CIRCLE_SHA1"
|
echo "https://github.com/ionic-team/$CIRCLE_PROJECT_REPONAME/commit/$CIRCLE_SHA1"
|
||||||
else
|
else
|
||||||
git config --global user.email "hi@ionicframework.com"
|
git config --global user.email "hi@ionicframework.com"
|
||||||
git config --global user.name "Ionitron"
|
git config --global user.name "Ionitron"
|
||||||
git add -A
|
git add -A
|
||||||
git commit -am "Automated build of native readmes for driftyco/$CIRCLE_PROJECT_REPONAME@$CIRCLE_SHA1"
|
git commit -am "Automated build of native readmes for ionic-team/$CIRCLE_PROJECT_REPONAME@$CIRCLE_SHA1"
|
||||||
# in case a different commit was pushed to ionic-site during doc/demo gen,
|
# in case a different commit was pushed to ionic-site during doc/demo gen,
|
||||||
# try to rebase around it before pushing
|
# try to rebase around it before pushing
|
||||||
git fetch
|
git fetch
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ function run {
|
|||||||
git config --global user.email "hi@ionicframework.com"
|
git config --global user.email "hi@ionicframework.com"
|
||||||
git config --global user.name "Ionitron"
|
git config --global user.name "Ionitron"
|
||||||
|
|
||||||
git clone git@github.com:driftyco/$REPOSITORY.git $DIRECTORY $ARGS
|
git clone git@github.com:ionic-team/$REPOSITORY.git $DIRECTORY $ARGS
|
||||||
cd $DIRECTORY
|
cd $DIRECTORY
|
||||||
git fetch origin --tags
|
git fetch origin --tags
|
||||||
cd ../
|
cd ../
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
git config --global user.email "hi@ionicframework.com"
|
||||||
|
git config --global user.name "Ionitron"
|
||||||
@@ -6,7 +6,7 @@ import { Injectable } from '@angular/core';
|
|||||||
* @description
|
* @description
|
||||||
*
|
*
|
||||||
* @usage
|
* @usage
|
||||||
* ```
|
* ```typescript
|
||||||
* import { {{ PluginName }} } from '@ionic-native/{{ plugin-name }}';
|
* import { {{ PluginName }} } from '@ionic-native/{{ plugin-name }}';
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import { Observable } from 'rxjs/Observable';
|
|||||||
* This plugin does something
|
* This plugin does something
|
||||||
*
|
*
|
||||||
* @usage
|
* @usage
|
||||||
* ```
|
* ```typescript
|
||||||
* import { {{ PluginName }} } from '@ionic-native/{{ plugin-name }}';
|
* import { {{ PluginName }} } from '@ionic-native/{{ plugin-name }}';
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
declare var window;
|
|
||||||
|
|
||||||
export function checkReady() {
|
export function checkReady() {
|
||||||
const DEVICE_READY_TIMEOUT = 5000;
|
const DEVICE_READY_TIMEOUT = 5000;
|
||||||
|
|
||||||
@@ -16,7 +14,7 @@ export function checkReady() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (!didFireReady && window.cordova) {
|
if (!didFireReady && !!window.cordova) {
|
||||||
console.warn(`Ionic Native: deviceready did not fire within ${DEVICE_READY_TIMEOUT}ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.`);
|
console.warn(`Ionic Native: deviceready did not fire within ${DEVICE_READY_TIMEOUT}ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.`);
|
||||||
}
|
}
|
||||||
}, DEVICE_READY_TIMEOUT);
|
}, DEVICE_READY_TIMEOUT);
|
||||||
|
|||||||
@@ -0,0 +1,239 @@
|
|||||||
|
import 'core-js';
|
||||||
|
import { Plugin, Cordova, CordovaProperty, CordovaCheck, CordovaInstance, InstanceProperty } from './decorators';
|
||||||
|
import { IonicNativePlugin } from './ionic-native-plugin';
|
||||||
|
import { ERR_CORDOVA_NOT_AVAILABLE, ERR_PLUGIN_NOT_INSTALLED } from './plugin';
|
||||||
|
|
||||||
|
declare const window: any;
|
||||||
|
|
||||||
|
class TestObject {
|
||||||
|
|
||||||
|
constructor(public _objectInstance: any) {}
|
||||||
|
|
||||||
|
@InstanceProperty
|
||||||
|
name: string;
|
||||||
|
|
||||||
|
@CordovaInstance({ sync: true })
|
||||||
|
pingSync(): string { return; }
|
||||||
|
|
||||||
|
@CordovaInstance()
|
||||||
|
ping(): Promise<any> { return; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Plugin({
|
||||||
|
pluginName: 'TestPlugin',
|
||||||
|
pluginRef: 'testPlugin',
|
||||||
|
repo: '',
|
||||||
|
plugin: 'cordova-plugin-my-plugin',
|
||||||
|
platforms: ['Android', 'iOS']
|
||||||
|
})
|
||||||
|
class TestPlugin extends IonicNativePlugin {
|
||||||
|
|
||||||
|
@CordovaProperty
|
||||||
|
name: string;
|
||||||
|
|
||||||
|
@Cordova({ sync: true })
|
||||||
|
pingSync(): string { return; }
|
||||||
|
|
||||||
|
@Cordova()
|
||||||
|
ping(): Promise<string> { return; }
|
||||||
|
|
||||||
|
@CordovaCheck()
|
||||||
|
customPing(): Promise<string> {
|
||||||
|
return Promise.resolve('pong');
|
||||||
|
}
|
||||||
|
|
||||||
|
create(): TestObject {
|
||||||
|
return new TestObject(TestPlugin.getPlugin().create());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function definePlugin() {
|
||||||
|
(window as any).testPlugin = {
|
||||||
|
name: 'John Smith',
|
||||||
|
ping: (success: Function, error: Function) => success('pong'),
|
||||||
|
pingSync: () => 'pong',
|
||||||
|
create: function TestObject() {
|
||||||
|
this.pingSync = () => 'pong';
|
||||||
|
this.ping = (success: Function, error: Function) => success('pong');
|
||||||
|
this.name = 'John Smith';
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('Regular Decorators', () => {
|
||||||
|
|
||||||
|
let plugin: TestPlugin;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
plugin = new TestPlugin();
|
||||||
|
definePlugin();
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Plugin', () => {
|
||||||
|
|
||||||
|
it('should set pluginName', () => {
|
||||||
|
expect(TestPlugin.getPluginName()).toEqual('TestPlugin');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should set pluginRef', () => {
|
||||||
|
expect(TestPlugin.getPluginRef()).toEqual('testPlugin');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return original plugin object', () => {
|
||||||
|
expect(TestPlugin.getPlugin()).toEqual(window.testPlugin);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return supported platforms', () => {
|
||||||
|
expect(TestPlugin.getSupportedPlatforms()).toEqual(['Android', 'iOS']);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Cordova', () => {
|
||||||
|
|
||||||
|
it('should do a sync function', () => {
|
||||||
|
expect(plugin.pingSync()).toEqual('pong');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should do an async function', (done: Function) => {
|
||||||
|
plugin.ping()
|
||||||
|
.then(res => {
|
||||||
|
expect(res).toEqual('pong');
|
||||||
|
done();
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
expect(e).toBeUndefined();
|
||||||
|
done('Method should have resolved');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should throw plugin_not_installed error', (done: Function) => {
|
||||||
|
|
||||||
|
delete window.testPlugin;
|
||||||
|
window.cordova = true;
|
||||||
|
|
||||||
|
expect(<any>plugin.pingSync()).toEqual(ERR_PLUGIN_NOT_INSTALLED);
|
||||||
|
|
||||||
|
plugin.ping()
|
||||||
|
.catch(e => {
|
||||||
|
expect(e).toEqual(ERR_PLUGIN_NOT_INSTALLED.error);
|
||||||
|
delete window.cordova;
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should throw cordova_not_available error', (done: Function) => {
|
||||||
|
|
||||||
|
delete window.testPlugin;
|
||||||
|
|
||||||
|
expect(<any>plugin.pingSync()).toEqual(ERR_CORDOVA_NOT_AVAILABLE);
|
||||||
|
|
||||||
|
plugin.ping()
|
||||||
|
.catch(e => {
|
||||||
|
expect(e).toEqual(ERR_CORDOVA_NOT_AVAILABLE.error);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('CordovaProperty', () => {
|
||||||
|
|
||||||
|
it('should return property value', () => {
|
||||||
|
expect(plugin.name).toEqual('John Smith');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should set property value', () => {
|
||||||
|
plugin.name = 'value2';
|
||||||
|
expect(plugin.name).toEqual('value2');
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('CordovaCheck', () => {
|
||||||
|
|
||||||
|
it('should run the method when plugin exists', (done) => {
|
||||||
|
plugin.customPing()
|
||||||
|
.then(res => {
|
||||||
|
expect(res).toEqual('pong');
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('shouldnt run the method when plugin doesnt exist', (done) => {
|
||||||
|
delete window.testPlugin;
|
||||||
|
window.cordova = true;
|
||||||
|
plugin.customPing()
|
||||||
|
.catch(e => {
|
||||||
|
expect(e).toEqual(ERR_PLUGIN_NOT_INSTALLED.error);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Instance Decorators', () => {
|
||||||
|
|
||||||
|
let instance: TestObject,
|
||||||
|
plugin: TestPlugin;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
definePlugin();
|
||||||
|
plugin = new TestPlugin();
|
||||||
|
instance = plugin.create();
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Instance plugin', () => {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('CordovaInstance', () => {
|
||||||
|
|
||||||
|
it('should call instance async method', (done) => {
|
||||||
|
instance.ping()
|
||||||
|
.then(r => {
|
||||||
|
expect(r).toEqual('pong');
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should call instance sync method', () => {
|
||||||
|
expect(instance.pingSync()).toEqual('pong');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('shouldnt call instance method when _objectInstance is undefined', () => {
|
||||||
|
|
||||||
|
delete instance._objectInstance;
|
||||||
|
instance.ping()
|
||||||
|
.then(r => {
|
||||||
|
expect(r).toBeUndefined();
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
expect(e).toBeUndefined();
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('InstanceProperty', () => {
|
||||||
|
it('should return property value', () => {
|
||||||
|
expect(instance.name).toEqual('John Smith');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should set property value', () => {
|
||||||
|
instance.name = 'John Cena';
|
||||||
|
expect(instance.name).toEqual('John Cena');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
@@ -32,6 +32,8 @@ export interface PluginConfig {
|
|||||||
* Supported platforms
|
* Supported platforms
|
||||||
*/
|
*/
|
||||||
platforms?: string[];
|
platforms?: string[];
|
||||||
|
|
||||||
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CordovaOptions {
|
export interface CordovaOptions {
|
||||||
@@ -133,7 +135,8 @@ export function InstanceCheck(opts: CordovaCheckOptions = {}) {
|
|||||||
return getPromise(() => { });
|
return getPromise(() => { });
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
enumerable: true
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -157,7 +160,8 @@ export function CordovaCheck(opts: CordovaCheckOptions = {}) {
|
|||||||
}
|
}
|
||||||
return Promise.reject(check && check.error);
|
return Promise.reject(check && check.error);
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
enumerable: true
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -182,12 +186,12 @@ export function CordovaCheck(opts: CordovaCheckOptions = {}) {
|
|||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export function Plugin(config: PluginConfig) {
|
export function Plugin(config: PluginConfig): ClassDecorator {
|
||||||
return function(cls) {
|
return function(cls: any) {
|
||||||
|
|
||||||
// Add these fields to the class
|
// Add these fields to the class
|
||||||
for (let k in config) {
|
for (let prop in config) {
|
||||||
cls[k] = config[k];
|
cls[prop] = config[prop];
|
||||||
}
|
}
|
||||||
|
|
||||||
cls['installed'] = function(printWarning?: boolean) {
|
cls['installed'] = function(printWarning?: boolean) {
|
||||||
@@ -237,7 +241,8 @@ export function Cordova(opts: CordovaOptions = {}) {
|
|||||||
return {
|
return {
|
||||||
value: function(...args: any[]) {
|
value: function(...args: any[]) {
|
||||||
return wrap(this, methodName, opts).apply(this, args);
|
return wrap(this, methodName, opts).apply(this, args);
|
||||||
}
|
},
|
||||||
|
enumerable: true
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -252,7 +257,8 @@ export function CordovaInstance(opts: any = {}) {
|
|||||||
return {
|
return {
|
||||||
value: function(...args: any[]) {
|
value: function(...args: any[]) {
|
||||||
return wrapInstance(this, methodName, opts).apply(this, args);
|
return wrapInstance(this, methodName, opts).apply(this, args);
|
||||||
}
|
},
|
||||||
|
enumerable: true
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -310,7 +316,8 @@ export function CordovaFunctionOverride(opts: any = {}) {
|
|||||||
return {
|
return {
|
||||||
value: function(...args: any[]) {
|
value: function(...args: any[]) {
|
||||||
return overrideFunction(this, methodName, opts);
|
return overrideFunction(this, methodName, opts);
|
||||||
}
|
},
|
||||||
|
enumerable: true
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -346,7 +353,8 @@ export function CordovaFiniteObservable(opts: CordovaFiniteObservableOptions = {
|
|||||||
wrappedSubscription.unsubscribe();
|
wrappedSubscription.unsubscribe();
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
|
enumerable: true
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,4 +38,9 @@ export class IonicNativePlugin {
|
|||||||
*/
|
*/
|
||||||
static getPluginInstallName(): string { return; }
|
static getPluginInstallName(): string { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the plugin's supported platforms
|
||||||
|
*/
|
||||||
|
static getSupportedPlatforms(): string[] { return; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { get, getPlugin, getPromise, cordovaWarn, pluginWarn } from './util';
|
import { getPlugin, getPromise, cordovaWarn, pluginWarn } from './util';
|
||||||
import { checkReady } from './bootstrap';
|
import { checkReady } from './bootstrap';
|
||||||
import { CordovaOptions } from './decorators';
|
import { CordovaOptions } from './decorators';
|
||||||
|
|
||||||
@@ -7,8 +7,11 @@ import 'rxjs/add/observable/fromEvent';
|
|||||||
|
|
||||||
checkReady();
|
checkReady();
|
||||||
|
|
||||||
declare var window;
|
// declare const window;
|
||||||
declare var Promise;
|
// declare var Promise;
|
||||||
|
|
||||||
|
export const ERR_CORDOVA_NOT_AVAILABLE = { error: 'cordova_not_available' };
|
||||||
|
export const ERR_PLUGIN_NOT_INSTALLED = { error: 'plugin_not_installed' };
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16,8 +19,8 @@ declare var Promise;
|
|||||||
* @return {boolean | { error: string } }
|
* @return {boolean | { error: string } }
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
export function checkAvailability(pluginRef: string, methodName?: string, pluginName?: string);
|
export function checkAvailability(pluginRef: string, methodName?: string, pluginName?: string): boolean | { error: string };
|
||||||
export function checkAvailability(pluginObj: any, methodName?: string, pluginName?: string);
|
export function checkAvailability(pluginObj: any, methodName?: string, pluginName?: string): boolean | { error: string };
|
||||||
export function checkAvailability(plugin: any, methodName?: string, pluginName?: string): boolean | { error: string } {
|
export function checkAvailability(plugin: any, methodName?: string, pluginName?: string): boolean | { error: string } {
|
||||||
|
|
||||||
let pluginRef, pluginInstance, pluginPackage;
|
let pluginRef, pluginInstance, pluginPackage;
|
||||||
@@ -35,15 +38,11 @@ export function checkAvailability(plugin: any, methodName?: string, pluginName?:
|
|||||||
if (!pluginInstance || (!!methodName && typeof pluginInstance[methodName] === 'undefined')) {
|
if (!pluginInstance || (!!methodName && typeof pluginInstance[methodName] === 'undefined')) {
|
||||||
if (!window.cordova) {
|
if (!window.cordova) {
|
||||||
cordovaWarn(pluginName, methodName);
|
cordovaWarn(pluginName, methodName);
|
||||||
return {
|
return ERR_CORDOVA_NOT_AVAILABLE;
|
||||||
error: 'cordova_not_available'
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pluginWarn(pluginName, pluginPackage, methodName);
|
pluginWarn(pluginName, pluginPackage, methodName);
|
||||||
return {
|
return ERR_PLUGIN_NOT_INSTALLED;
|
||||||
error: 'plugin_not_installed'
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -69,7 +68,7 @@ function setIndex(args: any[], opts: any = {}, resolve?: Function, reject?: Func
|
|||||||
args.unshift(reject);
|
args.unshift(reject);
|
||||||
args.unshift(resolve);
|
args.unshift(resolve);
|
||||||
} else if (opts.callbackStyle === 'node') {
|
} else if (opts.callbackStyle === 'node') {
|
||||||
args.push((err, result) => {
|
args.push((err: any, result: any) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
reject(err);
|
reject(err);
|
||||||
} else {
|
} else {
|
||||||
@@ -135,8 +134,8 @@ function callCordovaPlugin(pluginObj: any, methodName: string, args: any[], opts
|
|||||||
}
|
}
|
||||||
|
|
||||||
function wrapPromise(pluginObj: any, methodName: string, args: any[], opts: any = {}) {
|
function wrapPromise(pluginObj: any, methodName: string, args: any[], opts: any = {}) {
|
||||||
let pluginResult, rej;
|
let pluginResult: any, rej: Function;
|
||||||
const p = getPromise((resolve, reject) => {
|
const p = getPromise((resolve: Function, reject: Function) => {
|
||||||
pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, resolve, reject);
|
pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, resolve, reject);
|
||||||
rej = reject;
|
rej = reject;
|
||||||
});
|
});
|
||||||
@@ -145,13 +144,13 @@ function wrapPromise(pluginObj: any, methodName: string, args: any[], opts: any
|
|||||||
// to error
|
// to error
|
||||||
if (pluginResult && pluginResult.error) {
|
if (pluginResult && pluginResult.error) {
|
||||||
p.catch(() => { });
|
p.catch(() => { });
|
||||||
rej(pluginResult.error);
|
typeof rej === 'function' && rej(pluginResult.error);
|
||||||
}
|
}
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
function wrapOtherPromise(pluginObj: any, methodName: string, args: any[], opts: any = {}) {
|
function wrapOtherPromise(pluginObj: any, methodName: string, args: any[], opts: any = {}) {
|
||||||
return getPromise((resolve, reject) => {
|
return getPromise((resolve: Function, reject: Function) => {
|
||||||
const pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts);
|
const pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts);
|
||||||
if (pluginResult) {
|
if (pluginResult) {
|
||||||
if (pluginResult.error) {
|
if (pluginResult.error) {
|
||||||
@@ -178,11 +177,11 @@ function wrapObservable(pluginObj: any, methodName: string, args: any[], opts: a
|
|||||||
if (opts.clearWithArgs) {
|
if (opts.clearWithArgs) {
|
||||||
return callCordovaPlugin(pluginObj, opts.clearFunction, args, opts, observer.next.bind(observer), observer.error.bind(observer));
|
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) {
|
} catch (e) {
|
||||||
console.warn('Unable to clear the previous observable watch for', pluginObj.constructor.getPluginName(), methodName);
|
console.warn('Unable to clear the previous observable watch for', pluginObj.constructor.getPluginName(), methodName);
|
||||||
console.error(e);
|
console.warn(e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@@ -239,7 +238,7 @@ export function overrideFunction(pluginObj: any, methodName: string, args: any[]
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
export const wrap = function(pluginObj: any, methodName: string, opts: CordovaOptions = {}) {
|
export const wrap = function(pluginObj: any, methodName: string, opts: CordovaOptions = {}) {
|
||||||
return (...args) => {
|
return (...args: any[]) => {
|
||||||
if (opts.sync) {
|
if (opts.sync) {
|
||||||
// Sync doesn't wrap the plugin with a promise or observable, it returns the result as-is
|
// Sync doesn't wrap the plugin with a promise or observable, it returns the result as-is
|
||||||
return callCordovaPlugin(pluginObj, methodName, args, opts);
|
return callCordovaPlugin(pluginObj, methodName, args, opts);
|
||||||
@@ -259,7 +258,7 @@ export const wrap = function(pluginObj: any, methodName: string, opts: CordovaOp
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
export function wrapInstance(pluginObj: any, methodName: string, opts: any = {}) {
|
export function wrapInstance(pluginObj: any, methodName: string, opts: any = {}) {
|
||||||
return (...args) => {
|
return (...args: any[]) => {
|
||||||
if (opts.sync) {
|
if (opts.sync) {
|
||||||
|
|
||||||
return callInstance(pluginObj, methodName, args, opts);
|
return callInstance(pluginObj, methodName, args, opts);
|
||||||
@@ -277,37 +276,30 @@ export function wrapInstance(pluginObj: any, methodName: string, opts: any = {})
|
|||||||
return () => {
|
return () => {
|
||||||
try {
|
try {
|
||||||
if (opts.clearWithArgs) {
|
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) {
|
} catch (e) {
|
||||||
console.warn('Unable to clear the previous observable watch for', pluginObj.constructor.getPluginName(), methodName);
|
console.warn('Unable to clear the previous observable watch for', pluginObj.constructor.getPluginName(), methodName);
|
||||||
console.error(e);
|
console.warn(e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
} else if (opts.otherPromise) {
|
} else if (opts.otherPromise) {
|
||||||
|
|
||||||
return getPromise((resolve, reject) => {
|
return getPromise((resolve: Function, reject: Function) => {
|
||||||
let result = callInstance(pluginObj, methodName, args, opts, resolve, reject);
|
let result = callInstance(pluginObj, methodName, args, opts, resolve, reject);
|
||||||
if (result && !result.error) {
|
if (result && !!result.then) {
|
||||||
result.then(resolve, reject);
|
result.then(resolve, reject);
|
||||||
|
} else {
|
||||||
|
reject();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
let pluginResult, rej;
|
return getPromise((resolve: Function, reject: Function) => callInstance(pluginObj, methodName, args, opts, resolve, reject));
|
||||||
const p = getPromise((resolve, reject) => {
|
|
||||||
pluginResult = callInstance(pluginObj, methodName, args, opts, resolve, reject);
|
|
||||||
rej = reject;
|
|
||||||
});
|
|
||||||
if (pluginResult && pluginResult.error) {
|
|
||||||
p.catch(() => { });
|
|
||||||
rej(pluginResult.error);
|
|
||||||
}
|
|
||||||
return p;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,56 +1,57 @@
|
|||||||
declare var window: any;
|
declare const window: any;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
export function get(obj, path) {
|
export const get = (element: Element | Window, path: string): any => {
|
||||||
path = path.split('.');
|
const paths: string[] = path.split('.');
|
||||||
for (let i = 0; i < path.length; i++) {
|
let obj: any = element;
|
||||||
|
for (let i: number = 0; i < paths.length; i++) {
|
||||||
if (!obj) { return null; }
|
if (!obj) { return null; }
|
||||||
obj = obj[path[i]];
|
obj = obj[paths[i]];
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
export function getPromise(cb) {
|
export const getPromise = (callback: Function): Promise<any> => {
|
||||||
|
|
||||||
const tryNativePromise = () => {
|
const tryNativePromise = () => {
|
||||||
if (window.Promise) {
|
if (window.Promise) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
cb(resolve, reject);
|
callback(resolve, reject);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.error('No Promise support or polyfill found. To enable Ionic Native support, please add the es6-promise polyfill before this script, or run with a library like Angular 2 or on a recent browser.');
|
console.error('No Promise support or polyfill found. To enable Ionic Native support, please add the es6-promise polyfill before this script, or run with a library like Angular or on a recent browser.');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return tryNativePromise();
|
return tryNativePromise();
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @param pluginRef
|
* @param pluginRef
|
||||||
* @returns {null|*}
|
* @returns {null|*}
|
||||||
*/
|
*/
|
||||||
export function getPlugin(pluginRef: string): any {
|
export const getPlugin = (pluginRef: string): any => {
|
||||||
return get(window, pluginRef);
|
return get(window, pluginRef);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
export const pluginWarn = function(pluginName: string, plugin?: string, method?: string) {
|
export const pluginWarn = (pluginName: string, plugin?: string, method?: string): void => {
|
||||||
if (method) {
|
if (method) {
|
||||||
console.warn('Native: tried calling ' + pluginName + '.' + method + ', but the ' + pluginName + ' plugin is not installed.');
|
console.warn('Native: tried calling ' + pluginName + '.' + method + ', but the ' + pluginName + ' plugin is not installed.');
|
||||||
} else {
|
} else {
|
||||||
console.warn('Native: tried accessing the ' + pluginName + ' plugin but it\'s not installed.');
|
console.warn('Native: tried accessing the ' + pluginName + ' plugin but it\'s not installed.');
|
||||||
}
|
}
|
||||||
if (plugin) {
|
if (plugin) {
|
||||||
console.warn('Install the ' + pluginName + ' plugin: \'ionic plugin add ' + plugin + '\'');
|
console.warn('Install the ' + pluginName + ' plugin: \'ionic cordova plugin add ' + plugin + '\'');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -59,7 +60,7 @@ export const pluginWarn = function(pluginName: string, plugin?: string, method?:
|
|||||||
* @param pluginName
|
* @param pluginName
|
||||||
* @param method
|
* @param method
|
||||||
*/
|
*/
|
||||||
export const cordovaWarn = function(pluginName: string, method?: string) {
|
export const cordovaWarn = (pluginName: string, method?: string): void => {
|
||||||
if (method) {
|
if (method) {
|
||||||
console.warn('Native: tried calling ' + pluginName + '.' + method + ', but Cordova is not available. Make sure to include cordova.js or run in a device/simulator');
|
console.warn('Native: tried calling ' + pluginName + '.' + method + ', but Cordova is not available. Make sure to include cordova.js or run in a device/simulator');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export interface ActionSheetOptions {
|
|||||||
/**
|
/**
|
||||||
* Choose if destructive button will be the last
|
* Choose if destructive button will be the last
|
||||||
*/
|
*/
|
||||||
destructiveButtonLast: boolean;
|
destructiveButtonLast?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -94,7 +94,7 @@ export interface ActionSheetOptions {
|
|||||||
plugin: 'cordova-plugin-actionsheet',
|
plugin: 'cordova-plugin-actionsheet',
|
||||||
pluginRef: 'plugins.actionsheet',
|
pluginRef: 'plugins.actionsheet',
|
||||||
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-actionsheet',
|
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-actionsheet',
|
||||||
platforms: ['Android', 'iOS', 'Windows Phone 8', 'Browser']
|
platforms: ['Android', 'Browser', 'iOS', 'Windows', 'Windows Phone 8']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ActionSheet extends IonicNativePlugin {
|
export class ActionSheet extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -96,6 +96,14 @@ export interface AdMobFreeRewardVideoConfig {
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
|
* @interfaces
|
||||||
|
* AdMobFreeBannerConfig
|
||||||
|
* AdMobFreeInterstitialConfig
|
||||||
|
* AdMobFreeRewardVideoConfig
|
||||||
|
* @classes
|
||||||
|
* AdMobFreeBanner
|
||||||
|
* AdMobFreeInterstitial
|
||||||
|
* AdMobFreeRewardVideo
|
||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
pluginName: 'AdMobFree',
|
pluginName: 'AdMobFree',
|
||||||
@@ -108,9 +116,10 @@ export interface AdMobFreeRewardVideoConfig {
|
|||||||
export class AdMobFree extends IonicNativePlugin {
|
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: 'admob.banner.events.LOAD',
|
||||||
BANNER_LOAD_FAIL: 'admob.banner.events.LOAD_FAIL',
|
BANNER_LOAD_FAIL: 'admob.banner.events.LOAD_FAIL',
|
||||||
BANNER_OPEN: 'admob.banner.events.OPEN',
|
BANNER_OPEN: 'admob.banner.events.OPEN',
|
||||||
@@ -142,19 +151,19 @@ export class AdMobFree extends IonicNativePlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Returns the AdMobFreeBanner object
|
||||||
* @type {AdMobFreeBanner}
|
* @type {AdMobFreeBanner}
|
||||||
*/
|
*/
|
||||||
banner: AdMobFreeBanner = new AdMobFreeBanner();
|
banner: AdMobFreeBanner = new AdMobFreeBanner();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Returns the AdMobFreeInterstitial object
|
||||||
* @type {AdMobFreeInterstitial}
|
* @type {AdMobFreeInterstitial}
|
||||||
*/
|
*/
|
||||||
interstitial: AdMobFreeInterstitial = new AdMobFreeInterstitial();
|
interstitial: AdMobFreeInterstitial = new AdMobFreeInterstitial();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Returns the AdMobFreeRewardVideo object
|
||||||
* @type {AdMobFreeRewardVideo}
|
* @type {AdMobFreeRewardVideo}
|
||||||
*/
|
*/
|
||||||
rewardVideo: AdMobFreeRewardVideo = new AdMobFreeRewardVideo();
|
rewardVideo: AdMobFreeRewardVideo = new AdMobFreeRewardVideo();
|
||||||
@@ -183,28 +192,28 @@ export class AdMobFreeBanner {
|
|||||||
* Hide the banner.
|
* Hide the banner.
|
||||||
* @return {Promise<any>}
|
* @return {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova({ sync: true })
|
@Cordova({ otherPromise: true })
|
||||||
hide(): Promise<any> { return; }
|
hide(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create banner.
|
* Create banner.
|
||||||
* @return {Promise<any>}
|
* @return {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova({ sync: true })
|
@Cordova({ otherPromise: true })
|
||||||
prepare(): Promise<any> { return; }
|
prepare(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove the banner.
|
* Remove the banner.
|
||||||
* @return {Promise<any>}
|
* @return {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova({ sync: true })
|
@Cordova({ otherPromise: true })
|
||||||
remove(): Promise<any> { return; }
|
remove(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the banner.
|
* Show the banner.
|
||||||
* @return {Promise<any>}
|
* @return {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova({ sync: true })
|
@Cordova({ otherPromise: true })
|
||||||
show(): Promise<any> { return; }
|
show(): Promise<any> { return; }
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -231,21 +240,21 @@ export class AdMobFreeInterstitial {
|
|||||||
* Check if interstitial is ready
|
* Check if interstitial is ready
|
||||||
* @return {Promise<any>}
|
* @return {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova({ sync: true })
|
@Cordova({ otherPromise: true })
|
||||||
isReady(): Promise<any> { return; }
|
isReady(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepare interstitial
|
* Prepare interstitial
|
||||||
* @return {Promise<any>}
|
* @return {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova({ sync: true })
|
@Cordova({ otherPromise: true })
|
||||||
prepare(): Promise<any> { return; }
|
prepare(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the interstitial
|
* Show the interstitial
|
||||||
* @return {Promise<any>}
|
* @return {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova({ sync: true })
|
@Cordova({ otherPromise: true })
|
||||||
show(): Promise<any> { return; }
|
show(): Promise<any> { return; }
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -272,21 +281,21 @@ export class AdMobFreeRewardVideo {
|
|||||||
* Check if reward video is ready
|
* Check if reward video is ready
|
||||||
* @return {Promise<any>}
|
* @return {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova({ sync: true })
|
@Cordova({ otherPromise: true })
|
||||||
isReady(): Promise<any> { return; }
|
isReady(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepare reward video
|
* Prepare reward video
|
||||||
* @return {Promise<any>}
|
* @return {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova({ sync: true })
|
@Cordova({ otherPromise: true })
|
||||||
prepare(): Promise<any> { return; }
|
prepare(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the reward video
|
* Show the reward video
|
||||||
* @return {Promise<any>}
|
* @return {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova({ sync: true })
|
@Cordova({ otherPromise: true })
|
||||||
show(): Promise<any> { return; }
|
show(): Promise<any> { return; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,6 +93,8 @@ export interface AdExtras {
|
|||||||
* @name AdMob
|
* @name AdMob
|
||||||
* @description
|
* @description
|
||||||
* Plugin for Google Ads, including AdMob / DFP (doubleclick for publisher) and mediations to other Ad networks.
|
* 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
|
* @usage
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import { AdMob } from '@ionic-native/admob';
|
* import { AdMob } from '@ionic-native/admob';
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export interface AlipayOrder {
|
export interface AlipayOrder {
|
||||||
/**
|
/**
|
||||||
* appId assigned by Alipay
|
* appId assigned by Alipay
|
||||||
@@ -99,8 +101,9 @@ export interface AlipayOrder {
|
|||||||
plugin: 'cordova-alipay-base',
|
plugin: 'cordova-alipay-base',
|
||||||
pluginRef: 'Alipay.Base',
|
pluginRef: 'Alipay.Base',
|
||||||
repo: 'https://github.com/xueron/cordova-alipay-base',
|
repo: 'https://github.com/xueron/cordova-alipay-base',
|
||||||
platforms: ['Android', 'iOS'],
|
install: 'ionic cordova plugin add cordova-alipay-base --variable APP_ID=your_app_id',
|
||||||
install: 'ionic plugin add https://github.com/xueron/cordova-alipay-base --variable APP_ID=your_app_id'
|
installVariables: ['APP_ID'],
|
||||||
|
platforms: ['Android', 'iOS']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Alipay extends IonicNativePlugin {
|
export class Alipay extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ export class AndroidFingerprintAuth extends IonicNativePlugin {
|
|||||||
* @returns {Promise<any>} Returns a Promise that resolves if fingerprint auth is available on the device
|
* @returns {Promise<any>} Returns a Promise that resolves if fingerprint auth is available on the device
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
isAvailable(): Promise<{ isAvailable: boolean }> { return; }
|
isAvailable(): Promise<{ isAvailable: boolean, isHardwareDetected: boolean, hasEnrolledFingerprints: boolean }> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete the cipher used for encryption and decryption by username
|
* Delete the cipher used for encryption and decryption by username
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import { Injectable } from '@angular/core';
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class AndroidPermissions extends IonicNativePlugin {
|
export class AndroidPermissions extends IonicNativePlugin {
|
||||||
|
|
||||||
PERMISSION: {
|
PERMISSION: any = {
|
||||||
ACCESS_CHECKIN_PROPERTIES: 'android.permission.ACCESS_CHECKIN_PROPERTIES',
|
ACCESS_CHECKIN_PROPERTIES: 'android.permission.ACCESS_CHECKIN_PROPERTIES',
|
||||||
ACCESS_COARSE_LOCATION: 'android.permission.ACCESS_COARSE_LOCATION',
|
ACCESS_COARSE_LOCATION: 'android.permission.ACCESS_COARSE_LOCATION',
|
||||||
ACCESS_FINE_LOCATION: 'android.permission.ACCESS_FINE_LOCATION',
|
ACCESS_FINE_LOCATION: 'android.permission.ACCESS_FINE_LOCATION',
|
||||||
@@ -199,13 +199,21 @@ export class AndroidPermissions extends IonicNativePlugin {
|
|||||||
@Cordova()
|
@Cordova()
|
||||||
checkPermission(permission: string): Promise<any> { return; }
|
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
|
* Request permissions
|
||||||
* @param permissions {array} An array with permissions
|
* @param permissions {Array<string>} An array with permissions
|
||||||
* @return {Promise<any>} Returns a promise
|
* @return {Promise<any>} Returns a promise
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
requestPermissions(permissions: string): Promise<any> { return; }
|
requestPermissions(permissions: string[]): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function still works now, will not support in the future.
|
* This function still works now, will not support in the future.
|
||||||
|
|||||||
@@ -8,23 +8,23 @@ import { Injectable } from '@angular/core';
|
|||||||
*
|
*
|
||||||
* @usage
|
* @usage
|
||||||
* ```typescript
|
* ```typescript
|
||||||
|
* import { Platfrom } from 'ionic-angular';
|
||||||
* import { AppMinimize } from '@ionic-native/app-minimize';
|
* import { AppMinimize } from '@ionic-native/app-minimize';
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* constructor(private appMinimize: AppMinimize) { }
|
* constructor(private platform: Platform, private appMinimize: AppMinimize) { }
|
||||||
*
|
*
|
||||||
* ...
|
* ...
|
||||||
*
|
*
|
||||||
* this.plugin.minimize().then(
|
* this.platform.registerBackButtonAction(() => {
|
||||||
* success => console.log('Closed'),
|
* this.appMinimize.minimize();
|
||||||
* err => console.log('Something went wrong')
|
* });
|
||||||
* );
|
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
pluginName: 'AppMinimize',
|
pluginName: 'AppMinimize',
|
||||||
plugin: 'https://github.com/tomloprod/cordova-plugin-appminimize.git',
|
plugin: 'cordova-plugin-appminimize',
|
||||||
pluginRef: 'plugins.appMinimize',
|
pluginRef: 'plugins.appMinimize',
|
||||||
repo: 'https://github.com/tomloprod/cordova-plugin-appminimize',
|
repo: 'https://github.com/tomloprod/cordova-plugin-appminimize',
|
||||||
platforms: ['Android']
|
platforms: ['Android']
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import { Injectable } from '@angular/core';
|
|||||||
plugin: 'cordova-plugin-app-preferences',
|
plugin: 'cordova-plugin-app-preferences',
|
||||||
pluginRef: 'plugins.appPreferences',
|
pluginRef: 'plugins.appPreferences',
|
||||||
repo: 'https://github.com/apla/me.apla.cordova.app-preferences',
|
repo: 'https://github.com/apla/me.apla.cordova.app-preferences',
|
||||||
platforms: ['Android', 'BlackBerry 10', 'Browser', 'iOS', 'OS X', 'Windows 8', 'Windows Phone']
|
platforms: ['Android', 'BlackBerry 10', 'Browser', 'iOS', 'macOS', 'Windows 8', 'Windows Phone']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class AppPreferences extends IonicNativePlugin {
|
export class AppPreferences extends IonicNativePlugin {
|
||||||
@@ -108,14 +108,16 @@ export class AppPreferences extends IonicNativePlugin {
|
|||||||
* @returns {Object} Custom object, bound to that suite
|
* @returns {Object} Custom object, bound to that suite
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
platforms: ['Android']
|
platforms: ['Android'],
|
||||||
|
sync: true
|
||||||
})
|
})
|
||||||
suite(suiteName: string): Object { return; }
|
suite(suiteName: string): any { return; }
|
||||||
|
|
||||||
@Cordova({
|
@Cordova({
|
||||||
platforms: ['iOS']
|
platforms: ['iOS'],
|
||||||
|
sync: true
|
||||||
})
|
})
|
||||||
iosSuite(suiteName: string): Object { return; }
|
iosSuite(suiteName: string): any { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return cloud synchronized configuration context
|
* Return cloud synchronized configuration context
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Cordova, CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
import { Cordova, CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
|
||||||
declare var window;
|
|
||||||
|
|
||||||
export interface AppRatePreferences {
|
export interface AppRatePreferences {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -143,7 +140,7 @@ export interface AppUrls {
|
|||||||
plugin: 'cordova-plugin-apprate',
|
plugin: 'cordova-plugin-apprate',
|
||||||
pluginRef: 'AppRate',
|
pluginRef: 'AppRate',
|
||||||
repo: 'https://github.com/pushandplay/cordova-plugin-apprate',
|
repo: 'https://github.com/pushandplay/cordova-plugin-apprate',
|
||||||
platforms: ['Android', 'iOS', 'Windows (experimental)']
|
platforms: ['Android', 'BlackBerry 10', 'iOS', 'Windows']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class AppRate extends IonicNativePlugin {
|
export class AppRate extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
plugin: 'cordova-plugin-app-version',
|
plugin: 'cordova-plugin-app-version',
|
||||||
pluginRef: 'cordova.getAppVersion',
|
pluginRef: 'cordova.getAppVersion',
|
||||||
repo: 'https://github.com/whiteoctober/cordova-plugin-app-version',
|
repo: 'https://github.com/whiteoctober/cordova-plugin-app-version',
|
||||||
platforms: ['Android', 'iOS']
|
platforms: ['Android', 'iOS', 'Windows']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class AppVersion extends IonicNativePlugin {
|
export class AppVersion extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ import { Injectable } from '@angular/core';
|
|||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
pluginName: 'Appodeal',
|
pluginName: 'Appodeal',
|
||||||
plugin: 'https://github.com/appodeal/appodeal-cordova-plugin',
|
plugin: 'https://github.com/appodeal/appodeal-cordova-plugin.git',
|
||||||
pluginRef: 'Appodeal',
|
pluginRef: 'Appodeal',
|
||||||
repo: 'https://github.com/appodeal/appodeal-cordova-plugin.git',
|
repo: 'https://github.com/appodeal/appodeal-cordova-plugin',
|
||||||
platforms: ['iOS', 'Android']
|
platforms: ['iOS', 'Android']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
declare var window;
|
|
||||||
|
|
||||||
|
|
||||||
export interface BackgroundFetchConfig {
|
export interface BackgroundFetchConfig {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ import { Injectable } from '@angular/core';
|
|||||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
declare var window;
|
|
||||||
|
|
||||||
export interface BackgroundGeolocationResponse {
|
export interface BackgroundGeolocationResponse {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -127,7 +125,7 @@ export interface BackgroundGeolocationConfig {
|
|||||||
startForeground?: boolean;
|
startForeground?: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ANDROID, WP8 ONLY
|
* ANDROID ONLY
|
||||||
* When using BackgroundGeolocation.LocationProvider.ANDROID_DISTANCE_FILTER_PROVIDER:
|
* When using BackgroundGeolocation.LocationProvider.ANDROID_DISTANCE_FILTER_PROVIDER:
|
||||||
* The minimum time interval between location updates in milliseconds.
|
* The minimum time interval between location updates in milliseconds.
|
||||||
* @see Android docs (http://developer.android.com/reference/android/location/LocationManager.html#requestLocationUpdates(long,%20float,%20android.location.Criteria,%20android.app.PendingIntent))
|
* @see Android docs (http://developer.android.com/reference/android/location/LocationManager.html#requestLocationUpdates(long,%20float,%20android.location.Criteria,%20android.app.PendingIntent))
|
||||||
@@ -308,7 +306,7 @@ export interface BackgroundGeolocationConfig {
|
|||||||
plugin: 'cordova-plugin-mauron85-background-geolocation',
|
plugin: 'cordova-plugin-mauron85-background-geolocation',
|
||||||
pluginRef: 'backgroundGeolocation',
|
pluginRef: 'backgroundGeolocation',
|
||||||
repo: 'https://github.com/mauron85/cordova-plugin-background-geolocation',
|
repo: 'https://github.com/mauron85/cordova-plugin-background-geolocation',
|
||||||
platforms: ['iOS', 'Android', 'Windows Phone 8']
|
platforms: ['Android', 'iOS']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class BackgroundGeolocation extends IonicNativePlugin {
|
export class BackgroundGeolocation extends IonicNativePlugin {
|
||||||
@@ -393,7 +391,7 @@ export class BackgroundGeolocation extends IonicNativePlugin {
|
|||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
platforms: ['iOS', 'Windows Phone']
|
platforms: ['iOS']
|
||||||
})
|
})
|
||||||
finish(): Promise<any> { return; }
|
finish(): Promise<any> { return; }
|
||||||
|
|
||||||
@@ -403,7 +401,7 @@ export class BackgroundGeolocation extends IonicNativePlugin {
|
|||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
platforms: ['iOS', 'Windows Phone']
|
platforms: ['iOS']
|
||||||
})
|
})
|
||||||
changePace(isMoving: boolean): Promise<any> { return; }
|
changePace(isMoving: boolean): Promise<any> { return; }
|
||||||
|
|
||||||
@@ -422,7 +420,7 @@ export class BackgroundGeolocation extends IonicNativePlugin {
|
|||||||
* @returns {Promise<Location>}
|
* @returns {Promise<Location>}
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
platforms: ['iOS', 'Windows Phone']
|
platforms: ['iOS']
|
||||||
})
|
})
|
||||||
getStationaryLocation(): Promise<BackgroundGeolocationResponse> { return; }
|
getStationaryLocation(): Promise<BackgroundGeolocationResponse> { return; }
|
||||||
|
|
||||||
@@ -432,7 +430,7 @@ export class BackgroundGeolocation extends IonicNativePlugin {
|
|||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
platforms: ['iOS', 'Windows Phone']
|
platforms: ['iOS']
|
||||||
})
|
})
|
||||||
onStationary(): Promise<any> { return; }
|
onStationary(): Promise<any> { return; }
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ export interface BackgroundModeConfiguration {
|
|||||||
plugin: 'cordova-plugin-background-mode',
|
plugin: 'cordova-plugin-background-mode',
|
||||||
pluginRef: 'cordova.plugins.backgroundMode',
|
pluginRef: 'cordova.plugins.backgroundMode',
|
||||||
repo: 'https://github.com/katzer/cordova-plugin-background-mode',
|
repo: 'https://github.com/katzer/cordova-plugin-background-mode',
|
||||||
platforms: ['Android', 'iOS', 'Windows Phone 8']
|
platforms: ['AmazonFire OS', 'Android', 'Browser', 'iOS', 'Windows']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class BackgroundMode extends IonicNativePlugin {
|
export class BackgroundMode extends IonicNativePlugin {
|
||||||
@@ -112,7 +112,7 @@ export class BackgroundMode extends IonicNativePlugin {
|
|||||||
/**
|
/**
|
||||||
* Override the default title, ticker and text.
|
* Override the default title, ticker and text.
|
||||||
* Available only for Android platform.
|
* 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({
|
@Cordova({
|
||||||
platforms: ['Android']
|
platforms: ['Android']
|
||||||
@@ -122,12 +122,13 @@ export class BackgroundMode extends IonicNativePlugin {
|
|||||||
/**
|
/**
|
||||||
* Modify the displayed information.
|
* Modify the displayed information.
|
||||||
* Available only for Android platform.
|
* 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({
|
@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`.
|
* Listen for events that the plugin fires. Available events are `enable`, `disable`, `activate`, `deactivate` and `failure`.
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
plugin: 'cordova-plugin-badge',
|
plugin: 'cordova-plugin-badge',
|
||||||
pluginRef: 'cordova.plugins.notification.badge',
|
pluginRef: 'cordova.plugins.notification.badge',
|
||||||
repo: 'https://github.com/katzer/cordova-plugin-badge',
|
repo: 'https://github.com/katzer/cordova-plugin-badge',
|
||||||
platforms: ['Android', 'iOS', 'Browser', 'Windows', 'Amazon FireOS', 'Windows Phone 8']
|
platforms: ['Android', 'Browser', 'iOS', 'Windows']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Badge extends IonicNativePlugin {
|
export class Badge extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
|
||||||
export interface BarcodeScannerOptions {
|
export interface BarcodeScannerOptions {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -93,7 +92,7 @@ export interface BarcodeScanResult {
|
|||||||
plugin: 'phonegap-plugin-barcodescanner',
|
plugin: 'phonegap-plugin-barcodescanner',
|
||||||
pluginRef: 'cordova.plugins.barcodeScanner',
|
pluginRef: 'cordova.plugins.barcodeScanner',
|
||||||
repo: 'https://github.com/phonegap/phonegap-plugin-barcodescanner',
|
repo: 'https://github.com/phonegap/phonegap-plugin-barcodescanner',
|
||||||
platforms: ['Android', 'iOS', 'Windows Phone 8', 'Windows 10', 'Windows 8', 'BlackBerry 10', 'Browser']
|
platforms: ['Android', 'BlackBerry 10', 'Browser', 'iOS', 'Windows']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class BarcodeScanner extends IonicNativePlugin {
|
export class BarcodeScanner extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @beta
|
||||||
|
* @name Base64
|
||||||
|
* @description
|
||||||
|
* This Plugin is used to encode base64 of any file, it uses js code for iOS, but in case of android it uses native code to handle android versions lower than v.3
|
||||||
|
*
|
||||||
|
* @usage
|
||||||
|
* ```typescript
|
||||||
|
* import { Base64 } from '@ionic-native/base64';
|
||||||
|
*
|
||||||
|
* constructor(private base64: Base64) { }
|
||||||
|
*
|
||||||
|
* ...
|
||||||
|
*
|
||||||
|
* let filePath: string = 'file:///...';
|
||||||
|
* this.base64.encodeFile(filePath).then((base64File: string) => {
|
||||||
|
* console.log(base64File);
|
||||||
|
* }, (err) => {
|
||||||
|
* console.log(err);
|
||||||
|
* });
|
||||||
|
*
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
@Plugin({
|
||||||
|
pluginName: 'Base64',
|
||||||
|
plugin: 'com-badrit-base64',
|
||||||
|
pluginRef: 'plugins.Base64',
|
||||||
|
repo: 'https://github.com/hazemhagrass/phonegap-base64',
|
||||||
|
platforms: ['Android', 'iOS']
|
||||||
|
})
|
||||||
|
@Injectable()
|
||||||
|
export class Base64 extends IonicNativePlugin {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function encodes base64 of any file
|
||||||
|
* @param {string} filePath Absolute file path
|
||||||
|
* @return {Promise<string>} Returns a promise that resolves when the file is successfully encoded
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
encodeFile(filePath: string): Promise<string> { return; }
|
||||||
|
|
||||||
|
}
|
||||||
@@ -49,7 +49,7 @@ export interface BatteryStatusResponse {
|
|||||||
plugin: 'cordova-plugin-battery-status',
|
plugin: 'cordova-plugin-battery-status',
|
||||||
pluginRef: 'navigator.battery',
|
pluginRef: 'navigator.battery',
|
||||||
repo: 'https://github.com/apache/cordova-plugin-battery-status',
|
repo: 'https://github.com/apache/cordova-plugin-battery-status',
|
||||||
platforms: ['Amazon Fire OS', 'iOS', 'Android', 'BlackBerry 10', 'Windows Phone 7', 'Windows Phone 8', 'Windows', 'Firefox OS', 'Browser']
|
platforms: ['Amazon Fire OS', 'Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Tizen', 'Ubuntu', 'Windows']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class BatteryStatus extends IonicNativePlugin {
|
export class BatteryStatus extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ import { Observable } from 'rxjs/Observable';
|
|||||||
plugin: 'cordova-plugin-ble-central',
|
plugin: 'cordova-plugin-ble-central',
|
||||||
pluginRef: 'ble',
|
pluginRef: 'ble',
|
||||||
repo: 'https://github.com/don/cordova-plugin-ble-central',
|
repo: 'https://github.com/don/cordova-plugin-ble-central',
|
||||||
platforms: ['iOS', 'Android']
|
platforms: ['Android', 'iOS']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class BLE extends IonicNativePlugin {
|
export class BLE extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ import { Observable } from 'rxjs/Observable';
|
|||||||
repo: 'https://github.com/don/BluetoothSerial',
|
repo: 'https://github.com/don/BluetoothSerial',
|
||||||
plugin: 'cordova-plugin-bluetooth-serial',
|
plugin: 'cordova-plugin-bluetooth-serial',
|
||||||
pluginRef: 'bluetoothSerial',
|
pluginRef: 'bluetoothSerial',
|
||||||
platforms: ['Android', 'iOS', 'Windows Phone', 'Browser']
|
platforms: ['Android', 'iOS', 'Windows Phone 8']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class BluetoothSerial extends IonicNativePlugin {
|
export class BluetoothSerial extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Brightness
|
* @name Brightness
|
||||||
* @description
|
* @description
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
* @name Call Number
|
* @name Call Number
|
||||||
* @description
|
* @description
|
||||||
* Call a number directly from your Cordova/Ionic application.
|
* Call a number directly from your Cordova/Ionic application.
|
||||||
|
* **NOTE**: The iOS Simulator (and maybe Android Simulators) do not provide access to the phone subsystem.
|
||||||
*
|
*
|
||||||
* @usage
|
* @usage
|
||||||
* ```typescript
|
* ```typescript
|
||||||
@@ -14,7 +15,7 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
* ...
|
* ...
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* this.callNumber.callNumber(18001010101, true)
|
* this.callNumber.callNumber("18001010101", true)
|
||||||
* .then(() => console.log('Launched dialer!'))
|
* .then(() => console.log('Launched dialer!'))
|
||||||
* .catch(() => console.log('Error launching dialer'));
|
* .catch(() => console.log('Error launching dialer'));
|
||||||
*
|
*
|
||||||
@@ -25,7 +26,7 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
plugin: 'call-number',
|
plugin: 'call-number',
|
||||||
pluginRef: 'plugins.CallNumber',
|
pluginRef: 'plugins.CallNumber',
|
||||||
repo: 'https://github.com/Rohfosho/CordovaCallNumberPlugin',
|
repo: 'https://github.com/Rohfosho/CordovaCallNumberPlugin',
|
||||||
platforms: ['iOS', 'Android']
|
platforms: ['Android', 'iOS']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class CallNumber extends IonicNativePlugin {
|
export class CallNumber extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ export interface CameraPopoverOptions {
|
|||||||
plugin: 'cordova-plugin-camera',
|
plugin: 'cordova-plugin-camera',
|
||||||
pluginRef: 'navigator.camera',
|
pluginRef: 'navigator.camera',
|
||||||
repo: 'https://github.com/apache/cordova-plugin-camera',
|
repo: 'https://github.com/apache/cordova-plugin-camera',
|
||||||
platforms: ['Android', 'BlackBerry', 'Browser', 'Firefox', 'FireOS', 'iOS', 'Windows', 'Windows Phone 8', 'Ubuntu']
|
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone 8']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Camera extends IonicNativePlugin {
|
export class Camera extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ export interface CardIOResponse {
|
|||||||
plugin: 'card.io.cordova.mobilesdk',
|
plugin: 'card.io.cordova.mobilesdk',
|
||||||
pluginRef: 'CardIO',
|
pluginRef: 'CardIO',
|
||||||
repo: 'https://github.com/card-io/card.io-Cordova-Plugin',
|
repo: 'https://github.com/card-io/card.io-Cordova-Plugin',
|
||||||
platforms: ['iOS', 'Android']
|
platforms: ['Android', 'iOS']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class CardIO extends IonicNativePlugin {
|
export class CardIO extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
* @description
|
* @description
|
||||||
* Clipboard management plugin for Cordova that supports iOS, Android, and Windows Phone 8.
|
* Clipboard management plugin for Cordova that supports iOS, Android, and Windows Phone 8.
|
||||||
*
|
*
|
||||||
* Requires Cordova plugin: https://github.com/VersoSolutions/CordovaClipboard
|
|
||||||
* For more info, please see the [Clipboard plugin docs](https://github.com/VersoSolutions/CordovaClipboard.git).
|
|
||||||
*
|
*
|
||||||
* @usage
|
* @usage
|
||||||
* ```typescript
|
* ```typescript
|
||||||
@@ -31,10 +29,10 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
pluginName: 'Clipboard',
|
pluginName: 'Clipboard',
|
||||||
plugin: 'https://github.com/VersoSolutions/CordovaClipboard.git',
|
plugin: 'danielsogl-cordova-plugin-clipboard',
|
||||||
pluginRef: 'cordova.plugins.clipboard',
|
pluginRef: 'cordova.plugins.clipboard',
|
||||||
repo: 'https://github.com/VersoSolutions/CordovaClipboard',
|
repo: 'https://github.com/danielsogl/cordova-plugin-clipboard',
|
||||||
platforms: ['Amazon Fire OS', 'iOS', 'Android', 'BlackBerry 10', 'Windows Phone 7', 'Windows Phone 8', 'Windows', 'Firefox OS', 'Browser']
|
platforms: ['Android', 'iOS', 'Windows', 'Windows Phone 8']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Clipboard extends IonicNativePlugin {
|
export class Clipboard extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -109,8 +109,8 @@ interface LocalPackage_Static {
|
|||||||
}
|
}
|
||||||
/* tslint:enable */
|
/* tslint:enable */
|
||||||
|
|
||||||
declare var RemotePackage: RemotePackage_Static;
|
declare const RemotePackage: RemotePackage_Static;
|
||||||
declare var LocalPackage: LocalPackage_Static;
|
declare const LocalPackage: LocalPackage_Static;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the JSON format of the current package information file.
|
* Defines the JSON format of the current package information file.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { CordovaInstance, InstanceProperty, Plugin, getPromise, InstanceCheck, checkAvailability, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
|
import { CordovaInstance, InstanceProperty, Plugin, getPromise, InstanceCheck, checkAvailability, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
declare var window: any,
|
declare const window: any,
|
||||||
navigator: any;
|
navigator: any;
|
||||||
|
|
||||||
export type ContactFieldType = '*' | 'addresses' | 'birthday' | 'categories' | 'country' | 'department' | 'displayName' | 'emails' | 'familyName' | 'formatted' | 'givenName' | 'honorificPrefix' | 'honorificSuffix' | 'id' | 'ims' | 'locality' | 'middleName' | 'name' | 'nickname' | 'note' | 'organizations' | 'phoneNumbers' | 'photos' | 'postalCode' | 'region' | 'streetAddress' | 'title' | 'urls';
|
export type ContactFieldType = '*' | 'addresses' | 'birthday' | 'categories' | 'country' | 'department' | 'displayName' | 'emails' | 'familyName' | 'formatted' | 'givenName' | 'honorificPrefix' | 'honorificSuffix' | 'id' | 'ims' | 'locality' | 'middleName' | 'name' | 'nickname' | 'note' | 'organizations' | 'phoneNumbers' | 'photos' | 'postalCode' | 'region' | 'streetAddress' | 'title' | 'urls';
|
||||||
@@ -49,6 +49,7 @@ export interface IContactProperties {
|
|||||||
|
|
||||||
/** An array of web pages associated with the contact. */
|
/** An array of web pages associated with the contact. */
|
||||||
urls?: IContactField[];
|
urls?: IContactField[];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -71,6 +72,8 @@ export class Contact implements IContactProperties {
|
|||||||
@InstanceProperty categories: IContactField[];
|
@InstanceProperty categories: IContactField[];
|
||||||
@InstanceProperty urls: IContactField[];
|
@InstanceProperty urls: IContactField[];
|
||||||
|
|
||||||
|
[key: string]: any;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
if (checkAvailability('navigator.contacts', 'create', 'Contacts') === true) {
|
if (checkAvailability('navigator.contacts', 'create', 'Contacts') === true) {
|
||||||
this._objectInstance = navigator.contacts.create();
|
this._objectInstance = navigator.contacts.create();
|
||||||
@@ -92,8 +95,8 @@ export class Contact implements IContactProperties {
|
|||||||
|
|
||||||
@InstanceCheck()
|
@InstanceCheck()
|
||||||
save(): Promise<any> {
|
save(): Promise<any> {
|
||||||
return getPromise((resolve, reject) => {
|
return getPromise((resolve: Function, reject: Function) => {
|
||||||
this._objectInstance.save((contact) => {
|
this._objectInstance.save((contact: any) => {
|
||||||
this._objectInstance = contact;
|
this._objectInstance = contact;
|
||||||
resolve(this);
|
resolve(this);
|
||||||
}, reject);
|
}, reject);
|
||||||
@@ -114,7 +117,7 @@ export interface IContactError {
|
|||||||
/**
|
/**
|
||||||
* @hidden
|
* @hidden
|
||||||
*/
|
*/
|
||||||
export declare var ContactError: {
|
export declare const ContactError: {
|
||||||
new (code: number): IContactError;
|
new (code: number): IContactError;
|
||||||
UNKNOWN_ERROR: number;
|
UNKNOWN_ERROR: number;
|
||||||
INVALID_ARGUMENT_ERROR: number;
|
INVALID_ARGUMENT_ERROR: number;
|
||||||
@@ -291,7 +294,7 @@ export class ContactFindOptions implements IContactFindOptions {
|
|||||||
plugin: 'cordova-plugin-contacts',
|
plugin: 'cordova-plugin-contacts',
|
||||||
pluginRef: 'navigator.contacts',
|
pluginRef: 'navigator.contacts',
|
||||||
repo: 'https://github.com/apache/cordova-plugin-contacts',
|
repo: 'https://github.com/apache/cordova-plugin-contacts',
|
||||||
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows 8', 'Windows Phone']
|
platforms: ['Android', 'BlackBerry 10', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone 8']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Contacts extends IonicNativePlugin {
|
export class Contacts extends IonicNativePlugin {
|
||||||
@@ -312,8 +315,8 @@ export class Contacts extends IonicNativePlugin {
|
|||||||
*/
|
*/
|
||||||
@CordovaCheck()
|
@CordovaCheck()
|
||||||
find(fields: ContactFieldType[], options?: IContactFindOptions): Promise<Contact[]> {
|
find(fields: ContactFieldType[], options?: IContactFindOptions): Promise<Contact[]> {
|
||||||
return getPromise((resolve, reject) => {
|
return getPromise((resolve: Function, reject: Function) => {
|
||||||
navigator.contacts.find(fields, (contacts) => {
|
navigator.contacts.find(fields, (contacts: any[]) => {
|
||||||
resolve(contacts.map(processContact));
|
resolve(contacts.map(processContact));
|
||||||
}, reject, options);
|
}, reject, options);
|
||||||
});
|
});
|
||||||
@@ -325,8 +328,8 @@ export class Contacts extends IonicNativePlugin {
|
|||||||
*/
|
*/
|
||||||
@CordovaCheck()
|
@CordovaCheck()
|
||||||
pickContact(): Promise<Contact> {
|
pickContact(): Promise<Contact> {
|
||||||
return getPromise((resolve, reject) => {
|
return getPromise((resolve: Function, reject: Function) => {
|
||||||
navigator.contacts.pickContact((contact) => resolve(processContact(contact)), reject);
|
navigator.contacts.pickContact((contact: any) => resolve(processContact(contact)), reject);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -335,7 +338,7 @@ export class Contacts extends IonicNativePlugin {
|
|||||||
/**
|
/**
|
||||||
* @hidden
|
* @hidden
|
||||||
*/
|
*/
|
||||||
function processContact(contact) {
|
function processContact(contact: any) {
|
||||||
let newContact = new Contact();
|
let newContact = new Contact();
|
||||||
for (let prop in contact) {
|
for (let prop in contact) {
|
||||||
if (typeof contact[prop] === 'function') continue;
|
if (typeof contact[prop] === 'function') continue;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import { Injectable } from '@angular/core';
|
|||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
pluginName: 'CouchbaseLite',
|
pluginName: 'CouchbaseLite',
|
||||||
plugin: 'https://github.com/couchbaselabs/Couchbase-Lite-PhoneGap-Plugin',
|
plugin: 'couchbase-lite-phonegap-plugin',
|
||||||
pluginRef: 'cblite',
|
pluginRef: 'cblite',
|
||||||
repo: 'https://github.com/couchbaselabs/Couchbase-Lite-PhoneGap-Plugin',
|
repo: 'https://github.com/couchbaselabs/Couchbase-Lite-PhoneGap-Plugin',
|
||||||
platforms: ['Android', 'iOS']
|
platforms: ['Android', 'iOS']
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ import { Observable } from 'rxjs/Observable';
|
|||||||
plugin: 'cordova-plugin-dbmeter',
|
plugin: 'cordova-plugin-dbmeter',
|
||||||
pluginRef: 'DBMeter',
|
pluginRef: 'DBMeter',
|
||||||
repo: 'https://github.com/akofman/cordova-plugin-dbmeter',
|
repo: 'https://github.com/akofman/cordova-plugin-dbmeter',
|
||||||
platforms: ['iOS', 'Android']
|
platforms: ['Android', 'iOS']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class DBMeter extends IonicNativePlugin {
|
export class DBMeter extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ export interface DeeplinkMatch {
|
|||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* Alternatively, if you're using Ionic 2, there's a convenience method that takes a reference to a `NavController` and handles
|
* Alternatively, if you're using Ionic, there's a convenience method that takes a reference to a `NavController` and handles
|
||||||
* the actual navigation for you:
|
* the actual navigation for you:
|
||||||
*
|
*
|
||||||
* ```typescript
|
* ```typescript
|
||||||
@@ -67,7 +67,7 @@ export interface DeeplinkMatch {
|
|||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* See the [Ionic 2 Deeplinks Demo](https://github.com/driftyco/ionic2-deeplinks-demo/blob/master/app/app.ts) for an example of how to
|
* See the [Ionic Deeplinks Demo](https://github.com/ionic-team/ionic2-deeplinks-demo/blob/master/app/app.ts) for an example of how to
|
||||||
* retrieve the `NavController` reference at runtime.
|
* retrieve the `NavController` reference at runtime.
|
||||||
*
|
*
|
||||||
* @interfaces
|
* @interfaces
|
||||||
@@ -77,10 +77,10 @@ export interface DeeplinkMatch {
|
|||||||
pluginName: 'Deeplinks',
|
pluginName: 'Deeplinks',
|
||||||
plugin: 'ionic-plugin-deeplinks',
|
plugin: 'ionic-plugin-deeplinks',
|
||||||
pluginRef: 'IonicDeeplink',
|
pluginRef: 'IonicDeeplink',
|
||||||
repo: 'https://github.com/driftyco/ionic-plugin-deeplinks',
|
repo: 'https://github.com/ionic-team/ionic-plugin-deeplinks',
|
||||||
platforms: ['iOS', 'Android', 'Browser'],
|
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=/',
|
||||||
install: 'ionic 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'],
|
||||||
installVariables: ['URL_SCHEME', 'DEEPLINK_SCHEME', 'DEEPLINK_HOST', 'ANDROID_PATH_PREFIX']
|
platforms: ['Android', 'Browser', 'iOS']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Deeplinks extends IonicNativePlugin {
|
export class Deeplinks extends IonicNativePlugin {
|
||||||
@@ -88,7 +88,7 @@ export class Deeplinks extends IonicNativePlugin {
|
|||||||
/**
|
/**
|
||||||
* Define a set of paths to match against incoming deeplinks.
|
* 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
|
* 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
|
* 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.
|
* promise result which you can then use to navigate in the app as you see fit.
|
||||||
@@ -98,29 +98,31 @@ export class Deeplinks extends IonicNativePlugin {
|
|||||||
@Cordova({
|
@Cordova({
|
||||||
observable: true
|
observable: true
|
||||||
})
|
})
|
||||||
route(paths): Observable<DeeplinkMatch> { return; }
|
route(paths: any): Observable<DeeplinkMatch> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* This is a convenience version of `route` that takes a reference to a NavController
|
* This is a convenience version of `route` that takes a reference to a NavController
|
||||||
* from Ionic 2, or a custom class that conforms to this protocol:
|
* from Ionic, or a custom class that conforms to this protocol:
|
||||||
*
|
*
|
||||||
* NavController.push = function(View, Params){}
|
* NavController.push = function(View, Params){}
|
||||||
*
|
*
|
||||||
* This handler will automatically navigate when a route matches. If you need finer-grained
|
* 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.
|
* 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
|
* 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
|
* 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.
|
* 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
|
* @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.
|
* errors if a deeplink comes through that does not match a given path.
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
observable: true
|
observable: true
|
||||||
})
|
})
|
||||||
routeWithNavController(navController, paths): Observable<DeeplinkMatch> { return; }
|
routeWithNavController(navController: any, paths: any): Observable<DeeplinkMatch> { return; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
pluginName: 'DeviceAccounts',
|
pluginName: 'DeviceAccounts',
|
||||||
plugin: 'https://github.com/loicknuchel/cordova-device-accounts.git',
|
plugin: 'cordova-device-accounts',
|
||||||
pluginRef: 'plugins.DeviceAccounts',
|
pluginRef: 'plugins.DeviceAccounts',
|
||||||
repo: 'https://github.com/loicknuchel/cordova-device-accounts',
|
repo: 'https://github.com/danielsogl/cordova-device-accounts',
|
||||||
platforms: ['Android']
|
platforms: ['Android']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ export interface DeviceMotionAccelerometerOptions {
|
|||||||
plugin: 'cordova-plugin-device-motion',
|
plugin: 'cordova-plugin-device-motion',
|
||||||
pluginRef: 'navigator.accelerometer',
|
pluginRef: 'navigator.accelerometer',
|
||||||
repo: 'https://github.com/apache/cordova-plugin-device-motion',
|
repo: 'https://github.com/apache/cordova-plugin-device-motion',
|
||||||
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
|
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone 8']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class DeviceMotion extends IonicNativePlugin {
|
export class DeviceMotion extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ export interface DeviceOrientationCompassOptions {
|
|||||||
plugin: 'cordova-plugin-device-orientation',
|
plugin: 'cordova-plugin-device-orientation',
|
||||||
pluginRef: 'navigator.compass',
|
pluginRef: 'navigator.compass',
|
||||||
repo: 'https://github.com/apache/cordova-plugin-device-orientation',
|
repo: 'https://github.com/apache/cordova-plugin-device-orientation',
|
||||||
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
|
platforms: ['Amazon Fire OS', 'Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class DeviceOrientation extends IonicNativePlugin {
|
export class DeviceOrientation extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
import { CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
declare var window: any;
|
declare const window: any;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Device
|
* @name Device
|
||||||
@@ -24,7 +24,7 @@ declare var window: any;
|
|||||||
plugin: 'cordova-plugin-device',
|
plugin: 'cordova-plugin-device',
|
||||||
pluginRef: 'device',
|
pluginRef: 'device',
|
||||||
repo: 'https://github.com/apache/cordova-plugin-device',
|
repo: 'https://github.com/apache/cordova-plugin-device',
|
||||||
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'OS X', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
|
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'macOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Device extends IonicNativePlugin {
|
export class Device extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ export interface DialogsPromptCallback {
|
|||||||
pluginName: 'Dialogs',
|
pluginName: 'Dialogs',
|
||||||
plugin: 'cordova-plugin-dialogs',
|
plugin: 'cordova-plugin-dialogs',
|
||||||
pluginRef: 'navigator.notification',
|
pluginRef: 'navigator.notification',
|
||||||
repo: 'https://github.com/apache/cordova-plugin-dialogs.git',
|
repo: 'https://github.com/apache/cordova-plugin-dialogs',
|
||||||
platforms: ['Android', 'BlackBerry 10', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone']
|
platforms: ['Amazon Fire OS', 'Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Dialogs extends IonicNativePlugin {
|
export class Dialogs extends IonicNativePlugin {
|
||||||
@@ -69,13 +69,13 @@ export class Dialogs extends IonicNativePlugin {
|
|||||||
* @param {string} message Dialog message.
|
* @param {string} message Dialog message.
|
||||||
* @param {string} title Dialog title. (Optional, defaults to Confirm)
|
* @param {string} title Dialog title. (Optional, defaults to Confirm)
|
||||||
* @param {Array<string>} buttonLabels Array of strings specifying button labels. (Optional, defaults to [OK,Cancel])
|
* @param {Array<string>} buttonLabels Array of strings specifying button labels. (Optional, defaults to [OK,Cancel])
|
||||||
* @returns {Promise<number>} Returns a promise that resolves the button index that was clicked. Note that the index use one-based indexing.
|
* @returns {Promise<number>} Returns a promise that resolves the button index that was clicked, or 0 if the user has dismissed the dialog by clicking outside the dialog box. Note that the index use one-based indexing.
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
successIndex: 1,
|
successIndex: 1,
|
||||||
errorIndex: 4
|
errorIndex: 4
|
||||||
})
|
})
|
||||||
confirm(message, title?: string, buttonLabels?: string[]): Promise<number> { return; }
|
confirm(message: string, title?: string, buttonLabels?: string[]): Promise<number> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a native dialog box that is more customizable than the browser's prompt function.
|
* Displays a native dialog box that is more customizable than the browser's prompt function.
|
||||||
|
|||||||
@@ -42,10 +42,11 @@ export interface DocumentViewerOptions {
|
|||||||
* constructor(private document: DocumentViewer) { }
|
* constructor(private document: DocumentViewer) { }
|
||||||
*
|
*
|
||||||
* ...
|
* ...
|
||||||
* const options = {
|
* const options: DocumentViewerOptions = {
|
||||||
* title: 'My PDF'
|
* title: 'My PDF'
|
||||||
* }
|
* }
|
||||||
* this.document.view('assets/myFile.pdf', 'application/pdf', options)
|
*
|
||||||
|
* this.document.viewDocument('assets/myFile.pdf', 'application/pdf', options)
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
@@ -82,20 +83,20 @@ export class DocumentViewer extends IonicNativePlugin {
|
|||||||
* @param [onError] {Function}
|
* @param [onError] {Function}
|
||||||
*/
|
*/
|
||||||
@Cordova({ sync: true })
|
@Cordova({ sync: true })
|
||||||
canViewDocument(url: string, contentType: string, options: Array<DocumentViewerOptions>, onPossible?: Function, onMissingApp?: Function, onImpossible?: Function, onError?: Function): void { }
|
canViewDocument(url: string, contentType: string, options: DocumentViewerOptions, onPossible?: Function, onMissingApp?: Function, onImpossible?: Function, onError?: Function): void { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opens the file
|
* Opens the file
|
||||||
*
|
*
|
||||||
* @param url {string} Url to the file
|
* @param url {string} Url to the file
|
||||||
* @param contentType {string} Content type of the file
|
* @param contentType {string} Content type of the file
|
||||||
* @param options {Array<DocumentViewerOptions>} options
|
* @param options {DocumentViewerOptions} options
|
||||||
* @param [onShow] {Function}
|
* @param [onShow] {Function}
|
||||||
* @param [onClose] {Function}
|
* @param [onClose] {Function}
|
||||||
* @param [onMissingApp] {Function}
|
* @param [onMissingApp] {Function}
|
||||||
* @param [onError] {Function}
|
* @param [onError] {Function}
|
||||||
*/
|
*/
|
||||||
@Cordova({ sync: true })
|
@Cordova({ sync: true })
|
||||||
viewDocument(url: string, contentType: string, options: Array<DocumentViewerOptions>, onShow?: Function, onClose?: Function, onMissingApp?: Function, onError?: Function): void { }
|
viewDocument(url: string, contentType: string, options: DocumentViewerOptions, onShow?: Function, onClose?: Function, onMissingApp?: Function, onError?: Function): void { }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Cordova, Plugin, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
|
import { Cordova, Plugin, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
declare var cordova: any;
|
interface Cordova {
|
||||||
|
plugins: CordovaPlugins & { email: any };
|
||||||
|
}
|
||||||
|
|
||||||
|
declare const cordova: Cordova;
|
||||||
|
|
||||||
export interface EmailComposerOptions {
|
export interface EmailComposerOptions {
|
||||||
|
|
||||||
@@ -73,7 +77,7 @@ export interface EmailComposerOptions {
|
|||||||
plugin: 'cordova-plugin-email',
|
plugin: 'cordova-plugin-email',
|
||||||
pluginRef: 'cordova.plugins.email',
|
pluginRef: 'cordova.plugins.email',
|
||||||
repo: 'https://github.com/hypery2k/cordova-email-plugin',
|
repo: 'https://github.com/hypery2k/cordova-email-plugin',
|
||||||
platforms: ['Android', 'iOS']
|
platforms: ['Amazon Fire OS', 'Android', 'Browser', 'iOS', 'Windows']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class EmailComposer extends IonicNativePlugin {
|
export class EmailComposer extends IonicNativePlugin {
|
||||||
@@ -88,7 +92,7 @@ export class EmailComposer extends IonicNativePlugin {
|
|||||||
isAvailable(app?: string): Promise<any> {
|
isAvailable(app?: string): Promise<any> {
|
||||||
return new Promise<boolean>((resolve, reject) => {
|
return new Promise<boolean>((resolve, reject) => {
|
||||||
if (app) {
|
if (app) {
|
||||||
cordova.plugins.email.isAvailable(app, (isAvailable) => {
|
cordova.plugins.email.isAvailable(app, (isAvailable: boolean) => {
|
||||||
if (isAvailable) {
|
if (isAvailable) {
|
||||||
resolve();
|
resolve();
|
||||||
} else {
|
} else {
|
||||||
@@ -96,7 +100,7 @@ export class EmailComposer extends IonicNativePlugin {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
cordova.plugins.email.isAvailable((isAvailable) => {
|
cordova.plugins.email.isAvailable((isAvailable: boolean) => {
|
||||||
if (isAvailable) {
|
if (isAvailable) {
|
||||||
resolve();
|
resolve();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export interface EstimoteBeaconRegion {
|
|||||||
plugin: 'cordova-plugin-estimote',
|
plugin: 'cordova-plugin-estimote',
|
||||||
pluginRef: 'estimote.beacons',
|
pluginRef: 'estimote.beacons',
|
||||||
repo: 'https://github.com/evothings/phonegap-estimotebeacons',
|
repo: 'https://github.com/evothings/phonegap-estimotebeacons',
|
||||||
platforms: ['iOS', 'Android']
|
platforms: ['Android', 'iOS']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class EstimoteBeacons extends IonicNativePlugin {
|
export class EstimoteBeacons extends IonicNativePlugin {
|
||||||
@@ -512,4 +512,3 @@ export class EstimoteBeacons extends IonicNativePlugin {
|
|||||||
writeConnectedMinor(minor: number): Promise<any> { return; }
|
writeConnectedMinor(minor: number): Promise<any> { return; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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.
|
* Then type in the following command in your Terminal, where APP_ID and APP_NAME are the values from the Facebook Developer portal.
|
||||||
*
|
*
|
||||||
* ```bash
|
* ```bash
|
||||||
* ionic plugin add cordova-plugin-facebook4 --save --variable APP_ID="123456789" --variable APP_NAME="myApplication"
|
* ionic cordova 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:
|
* 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,9 +114,9 @@ export interface FacebookLoginResponse {
|
|||||||
plugin: 'cordova-plugin-facebook4',
|
plugin: 'cordova-plugin-facebook4',
|
||||||
pluginRef: 'facebookConnectPlugin',
|
pluginRef: 'facebookConnectPlugin',
|
||||||
repo: 'https://github.com/jeduan/cordova-plugin-facebook4',
|
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'],
|
installVariables: ['APP_ID', 'APP_NAME'],
|
||||||
platforms: ['Android', 'iOS']
|
platforms: ['Android', 'iOS', 'Browser']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Facebook extends IonicNativePlugin {
|
export class Facebook extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -25,32 +25,32 @@ export interface NotificationData {
|
|||||||
*
|
*
|
||||||
* @usage
|
* @usage
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import { FCM } from 'ionic-native';
|
* import { FCM } from '@ionic-native/fcm';
|
||||||
*
|
*
|
||||||
* constructor(private fcm: FCM) {}
|
* constructor(private fcm: FCM) {}
|
||||||
*
|
*
|
||||||
* ...
|
* ...
|
||||||
*
|
*
|
||||||
* fcm.subscribeToTopic('marketing');
|
* fcm.subscribeToTopic('marketing');
|
||||||
*
|
*
|
||||||
* fcm.getToken().then(token=>{
|
* fcm.getToken().then(token=>{
|
||||||
* backend.registerToken(token);
|
* backend.registerToken(token);
|
||||||
* })
|
* })
|
||||||
*
|
*
|
||||||
* fcm.onNotification().subscribe(data=>{
|
* fcm.onNotification().subscribe(data=>{
|
||||||
* if(data.wasPressed){
|
* if(data.wasTapped){
|
||||||
* console.log("Received in background");
|
* console.log("Received in background");
|
||||||
* } else {
|
* } else {
|
||||||
* console.log("Received in foreground");
|
* console.log("Received in foreground");
|
||||||
* };
|
* };
|
||||||
* })
|
* })
|
||||||
*
|
*
|
||||||
* fcm.onTokenRefresh().subscribe(token=>{
|
* fcm.onTokenRefresh().subscribe(token=>{
|
||||||
* backend.registerToken(token);
|
* backend.registerToken(token);
|
||||||
* })
|
* })
|
||||||
*
|
*
|
||||||
* fcm.unsubscribeFromTopic('marketing');
|
* fcm.unsubscribeFromTopic('marketing');
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* @interfaces
|
* @interfaces
|
||||||
* NotificationData
|
* NotificationData
|
||||||
@@ -60,14 +60,14 @@ export interface NotificationData {
|
|||||||
plugin: 'cordova-plugin-fcm',
|
plugin: 'cordova-plugin-fcm',
|
||||||
pluginRef: 'FCMPlugin',
|
pluginRef: 'FCMPlugin',
|
||||||
repo: 'https://github.com/fechanique/cordova-plugin-fcm',
|
repo: 'https://github.com/fechanique/cordova-plugin-fcm',
|
||||||
platforms: ['iOS', 'Android']
|
platforms: ['Android', 'iOS']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class FCM extends IonicNativePlugin {
|
export class FCM extends IonicNativePlugin {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get's device's current registration id
|
* Get's device's current registration id
|
||||||
*
|
*
|
||||||
* @returns {Promise<string>} Returns a Promise that resolves with the registration id token
|
* @returns {Promise<string>} Returns a Promise that resolves with the registration id token
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
@@ -75,7 +75,7 @@ export class FCM extends IonicNativePlugin {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Event firing on the token refresh
|
* Event firing on the token refresh
|
||||||
*
|
*
|
||||||
* @returns {Observable<string>} Returns an Observable that notifies with the change of device's registration id
|
* @returns {Observable<string>} Returns an Observable that notifies with the change of device's registration id
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
@@ -85,9 +85,9 @@ export class FCM extends IonicNativePlugin {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Subscribes you to a [topic](https://firebase.google.com/docs/notifications/android/console-topics)
|
* Subscribes you to a [topic](https://firebase.google.com/docs/notifications/android/console-topics)
|
||||||
*
|
*
|
||||||
* @param {string} topic Topic to be subscribed to
|
* @param {string} topic Topic to be subscribed to
|
||||||
*
|
*
|
||||||
* @returns {Promise<any>} Returns a promise resolving in result of subscribing to a topic
|
* @returns {Promise<any>} Returns a promise resolving in result of subscribing to a topic
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
@@ -95,9 +95,9 @@ export class FCM extends IonicNativePlugin {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Unubscribes you from a [topic](https://firebase.google.com/docs/notifications/android/console-topics)
|
* Unubscribes you from a [topic](https://firebase.google.com/docs/notifications/android/console-topics)
|
||||||
*
|
*
|
||||||
* @param {string} topic Topic to be unsubscribed from
|
* @param {string} topic Topic to be unsubscribed from
|
||||||
*
|
*
|
||||||
* @returns {Promise<any>} Returns a promise resolving in result of unsubscribing from a topic
|
* @returns {Promise<any>} Returns a promise resolving in result of unsubscribing from a topic
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
@@ -105,7 +105,7 @@ export class FCM extends IonicNativePlugin {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Watch for incoming notifications
|
* Watch for incoming notifications
|
||||||
*
|
*
|
||||||
* @returns {Observable<any>} returns an object with data from the notification
|
* @returns {Observable<any>} returns an object with data from the notification
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
pluginName: 'FileChooser',
|
pluginName: 'FileChooser',
|
||||||
plugin: 'http://github.com/don/cordova-filechooser.git',
|
plugin: 'cordova-plugin-filechooser',
|
||||||
pluginRef: 'fileChooser',
|
pluginRef: 'fileChooser',
|
||||||
repo: 'https://github.com/don/cordova-filechooser',
|
repo: 'https://github.com/ihadeed/cordova-filechooser',
|
||||||
platforms: ['Android']
|
platforms: ['Android']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
declare var window: any;
|
declare const window: any;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name File Path
|
* @name File Path
|
||||||
|
|||||||
@@ -2,11 +2,37 @@ import { Injectable } from '@angular/core';
|
|||||||
import { CordovaProperty, Plugin, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
|
import { CordovaProperty, Plugin, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
export interface IFile extends Blob {
|
export interface IFile extends Blob {
|
||||||
lastModified: number;
|
/**
|
||||||
lastModifiedDate: number;
|
* Name of the file, without path information
|
||||||
|
*/
|
||||||
name: string;
|
name: string;
|
||||||
|
/**
|
||||||
|
* Last modified date
|
||||||
|
*/
|
||||||
|
lastModified: number;
|
||||||
|
/**
|
||||||
|
* Last modified date
|
||||||
|
*/
|
||||||
|
lastModifiedDate: number;
|
||||||
|
/**
|
||||||
|
* Size in bytes
|
||||||
|
*/
|
||||||
size: number;
|
size: number;
|
||||||
|
/**
|
||||||
|
* File mime type
|
||||||
|
*/
|
||||||
type: string;
|
type: string;
|
||||||
|
localURL: string;
|
||||||
|
start: number;
|
||||||
|
end: number;
|
||||||
|
/**
|
||||||
|
* Returns a "slice" of the file. Since Cordova Files don't contain the actual
|
||||||
|
* content, this really returns a File with adjusted start and end.
|
||||||
|
* Slices of slices are supported.
|
||||||
|
* @param start {Number} The index at which to start the slice (inclusive).
|
||||||
|
* @param end {Number} The index at which to end the slice (exclusive).
|
||||||
|
*/
|
||||||
|
slice(start: number, end: number): Blob;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LocalFileSystem {
|
export interface LocalFileSystem {
|
||||||
@@ -85,6 +111,11 @@ export interface FileSystem {
|
|||||||
* @readonly
|
* @readonly
|
||||||
*/
|
*/
|
||||||
root: DirectoryEntry;
|
root: DirectoryEntry;
|
||||||
|
|
||||||
|
toJSON(): string;
|
||||||
|
|
||||||
|
encodeURIPath(path: string): string;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Entry {
|
export interface Entry {
|
||||||
@@ -106,6 +137,14 @@ export interface Entry {
|
|||||||
*/
|
*/
|
||||||
getMetadata(successCallback: MetadataCallback, errorCallback?: ErrorCallback): void;
|
getMetadata(successCallback: MetadataCallback, errorCallback?: ErrorCallback): void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the metadata of the entry.
|
||||||
|
* @param successCallback {Function} is called with a Metadata object
|
||||||
|
* @param errorCallback {Function} is called with a FileError
|
||||||
|
* @param metadataObject {Metadata} keys and values to set
|
||||||
|
*/
|
||||||
|
setMetadata(successCallback: MetadataCallback, errorCallback: ErrorCallback, metadataObject: Metadata): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the entry, excluding the path leading to it.
|
* The name of the entry, excluding the path leading to it.
|
||||||
*/
|
*/
|
||||||
@@ -121,6 +160,11 @@ export interface Entry {
|
|||||||
*/
|
*/
|
||||||
filesystem: FileSystem;
|
filesystem: FileSystem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* an alternate URL which can be used by native webview controls, for example media players.
|
||||||
|
*/
|
||||||
|
nativeURL: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move an entry to a different location on the file system. It is an error to try to:
|
* Move an entry to a different location on the file system. It is an error to try to:
|
||||||
*
|
*
|
||||||
@@ -159,6 +203,12 @@ export interface Entry {
|
|||||||
*/
|
*/
|
||||||
toURL(): string;
|
toURL(): string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a URL that can be passed across the bridge to identify this entry.
|
||||||
|
* @return string URL that can be passed across the bridge to identify this entry
|
||||||
|
*/
|
||||||
|
toInternalURL(): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes a file or directory. It is an error to attempt to delete a directory that is not empty. It is an error to attempt to delete the root directory of a filesystem.
|
* Deletes a file or directory. It is an error to attempt to delete a directory that is not empty. It is an error to attempt to delete the root directory of a filesystem.
|
||||||
* @param successCallback A callback that is called on success.
|
* @param successCallback A callback that is called on success.
|
||||||
@@ -234,6 +284,8 @@ export interface DirectoryEntry extends Entry {
|
|||||||
* </ul>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
export interface DirectoryReader {
|
export interface DirectoryReader {
|
||||||
|
localURL: string;
|
||||||
|
hasReadEntries: boolean;
|
||||||
/**
|
/**
|
||||||
* Read the next block of entries from this directory.
|
* Read the next block of entries from this directory.
|
||||||
* @param successCallback Called once per successful call to readEntries to deliver the next previously-unreported set of Entries in the associated Directory. If all Entries have already been returned from previous invocations of readEntries, successCallback must be called with a zero-length array as an argument.
|
* @param successCallback Called once per successful call to readEntries to deliver the next previously-unreported set of Entries in the associated Directory. If all Entries have already been returned from previous invocations of readEntries, successCallback must be called with a zero-length array as an argument.
|
||||||
@@ -348,6 +400,7 @@ export interface RemoveResult {
|
|||||||
fileRemoved: Entry;
|
fileRemoved: Entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @hidden */
|
||||||
export declare class FileSaver extends EventTarget {
|
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.
|
* When the FileSaver constructor is called, the user agent must return a new FileSaver object with readyState set to INIT.
|
||||||
@@ -437,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.
|
* 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 {
|
export declare class FileWriter extends FileSaver {
|
||||||
@@ -476,6 +530,7 @@ export interface IWriteOptions {
|
|||||||
truncate?: number; // if present, number of bytes to truncate file to before writing
|
truncate?: number; // if present, number of bytes to truncate file to before writing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @hidden */
|
||||||
export declare class FileError {
|
export declare class FileError {
|
||||||
constructor(code: number);
|
constructor(code: number);
|
||||||
static NOT_FOUND_ERR: number;
|
static NOT_FOUND_ERR: number;
|
||||||
@@ -495,10 +550,12 @@ export declare class FileError {
|
|||||||
message: string;
|
message: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @hidden */
|
||||||
export declare class FileReader {
|
export declare class FileReader {
|
||||||
static EMPTY: number;
|
static EMPTY: number;
|
||||||
static LOADING: number;
|
static LOADING: number;
|
||||||
static DONE: number;
|
static DONE: number;
|
||||||
|
static READ_CHUNK_SIZE: number;
|
||||||
|
|
||||||
readyState: number; // see constants in var declaration below
|
readyState: number; // see constants in var declaration below
|
||||||
error: Error;
|
error: Error;
|
||||||
@@ -517,6 +574,11 @@ export declare class FileReader {
|
|||||||
readAsBinaryString(fe: IFile): void;
|
readAsBinaryString(fe: IFile): void;
|
||||||
readAsArrayBuffer(fe: IFile): void;
|
readAsArrayBuffer(fe: IFile): void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hidden
|
||||||
|
*/
|
||||||
|
[key: string]: any;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Window extends LocalFileSystem {}
|
interface Window extends LocalFileSystem {}
|
||||||
@@ -546,13 +608,19 @@ declare const window: Window;
|
|||||||
* The (now-defunct) Directories and System extensions Latest: http: //www.w3.org/TR/2012/WD-file-system-api-20120417/
|
* The (now-defunct) Directories and System extensions Latest: http: //www.w3.org/TR/2012/WD-file-system-api-20120417/
|
||||||
* Although most of the plugin code was written when an earlier spec was current: http: //www.w3.org/TR/2011/WD-file-system-api-20110419/
|
* Although most of the plugin code was written when an earlier spec was current: http: //www.w3.org/TR/2011/WD-file-system-api-20110419/
|
||||||
* It also implements the FileWriter spec : http: //dev.w3.org/2009/dap/file-system/file-writer.html
|
* It also implements the FileWriter spec : http: //dev.w3.org/2009/dap/file-system/file-writer.html
|
||||||
|
* @interfaces
|
||||||
|
* IFile
|
||||||
|
* Entry
|
||||||
|
* DirectoryEntry
|
||||||
|
* DirectoryReader
|
||||||
|
* FileSystem
|
||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
pluginName: 'File',
|
pluginName: 'File',
|
||||||
plugin: 'cordova-plugin-file',
|
plugin: 'cordova-plugin-file',
|
||||||
pluginRef: 'cordova.file',
|
pluginRef: 'cordova.file',
|
||||||
repo: 'https: //github.com/apache/cordova-plugin-file',
|
repo: 'https://github.com/apache/cordova-plugin-file',
|
||||||
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'OS X', 'Ubuntu', 'Windows', 'Windows Phone']
|
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'macOS', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class File extends IonicNativePlugin {
|
export class File extends IonicNativePlugin {
|
||||||
@@ -630,7 +698,7 @@ export class File extends IonicNativePlugin {
|
|||||||
@CordovaProperty
|
@CordovaProperty
|
||||||
sharedDirectory: string;
|
sharedDirectory: string;
|
||||||
|
|
||||||
cordovaFileError: {} = {
|
cordovaFileError: any = {
|
||||||
1: 'NOT_FOUND_ERR',
|
1: 'NOT_FOUND_ERR',
|
||||||
2: 'SECURITY_ERR',
|
2: 'SECURITY_ERR',
|
||||||
3: 'ABORT_ERR',
|
3: 'ABORT_ERR',
|
||||||
|
|||||||
@@ -0,0 +1,85 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @beta
|
||||||
|
* @name Firebase Analytics
|
||||||
|
* @description
|
||||||
|
* Cordova plugin for Firebase Analytics
|
||||||
|
*
|
||||||
|
* Go yo firebase console and export google-services.json and GoogleService-Info.plist. Put those files into the root of your cordova app folder.
|
||||||
|
*
|
||||||
|
* NOTE: on iOS in order to collect demographic, age, gender data etc. you should additionally include AdSupport.framework into your project.
|
||||||
|
*
|
||||||
|
* @usage
|
||||||
|
* ```typescript
|
||||||
|
* import { FirebaseAnalytics } from '@ionic-native/firebase-analytics';
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* constructor(private firebaseAnalytics: FirebaseAnalytics) { }
|
||||||
|
*
|
||||||
|
* ...
|
||||||
|
*
|
||||||
|
* this.firebaseAnalytics.logEvent('page_view', {page: "dashboard"})
|
||||||
|
* .then((res: any) => console.log(res))
|
||||||
|
* .catch((error: any) => console.error(error));
|
||||||
|
*
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
@Plugin({
|
||||||
|
pluginName: 'FirebaseAnalytics',
|
||||||
|
plugin: 'cordova-plugin-firebase-analytics',
|
||||||
|
pluginRef: 'cordova.plugins.firebase.analytics',
|
||||||
|
repo: 'https://github.com/chemerisuk/cordova-plugin-firebase-analytics',
|
||||||
|
platforms: ['Android', 'iOS']
|
||||||
|
})
|
||||||
|
@Injectable()
|
||||||
|
export class FirebaseAnalytics extends IonicNativePlugin {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Logs an app event.
|
||||||
|
* Be aware of automatically collected events.
|
||||||
|
* @param name {string} The name of the event
|
||||||
|
* @param params {any} Some param to configure something
|
||||||
|
* @return {Promise<any>} Returns a promise
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
logEvent(name: string, params: any): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the user ID property.
|
||||||
|
* This feature must be used in accordance with Google's Privacy Policy.
|
||||||
|
* @param id {string} THe user ID
|
||||||
|
* @return {Promise<any>} Returns a promise
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
setUserId(id: string): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This feature must be used in accordance with Google's Privacy Policy.
|
||||||
|
* Be aware of automatically collected user properties.
|
||||||
|
* @param name {string} The property name
|
||||||
|
* @param value {string} The property value
|
||||||
|
* @return {Promise<any>} Returns a promise
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
setUserProperty(name: string, value: string): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets whether analytics collection is enabled for this app on this device.
|
||||||
|
* @param enabled {boolean}
|
||||||
|
* @return {Promise<any>} Returns a promise
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
setEnabled(enabled: boolean): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the current screen name, which specifies the current visual context in your app.
|
||||||
|
* This helps identify the areas in your app where users spend their time and how they interact with your app.
|
||||||
|
* @param name {string} The name of the screen
|
||||||
|
* @return {Promise<any>} Returns a promise
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
setCurrentScreen(name: string): Promise<any> { return; }
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
export interface DynamicLinksOptions {
|
||||||
|
title: string;
|
||||||
|
message: string;
|
||||||
|
deepLink?: string;
|
||||||
|
callToActionText?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @beta
|
||||||
|
* @name Firebase Dynamic Links
|
||||||
|
* @description
|
||||||
|
* Cordova plugin for Firebase Invites and Firebase Dynamic Links
|
||||||
|
*
|
||||||
|
* Variables APP_DOMAIN and APP_PATH specify web URL where your app will start an activity to handle the link. They also used to setup support for App Indexing.
|
||||||
|
*
|
||||||
|
* Go to firebase console and export google-services.json and GoogleService-Info.plist. Put those files into the root of your cordova app folder.
|
||||||
|
*
|
||||||
|
* Preferences:
|
||||||
|
*
|
||||||
|
* Preferences GoogleIOSClientId and GoogleAndroidClientId are used to setup dynamic links when you have an app for several platforms.
|
||||||
|
* You can find values at your GoogleService-Info.plist (key ANDROID_CLIENT_ID) and google-services.json (key client[0].oauth_client[0].client_id).
|
||||||
|
*
|
||||||
|
*config.xml:
|
||||||
|
* ```xml
|
||||||
|
* <platform name="android">
|
||||||
|
* <preference name="GoogleIOSClientId" value="..." />
|
||||||
|
* </platform>
|
||||||
|
* <platform name="ios">
|
||||||
|
* <preference name="GoogleAndroidClientId" value="..." />
|
||||||
|
* </platform>
|
||||||
|
* ```
|
||||||
|
* @usage
|
||||||
|
* ```typescript
|
||||||
|
* import { FirebaseDynamicLinks } from '@ionic-native/firebase-dynamic-links';
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* constructor(private firebaseDynamicLinks: FirebaseDynamicLinks) { }
|
||||||
|
*
|
||||||
|
* ...
|
||||||
|
*
|
||||||
|
* const options: DynamicLinksOptions = {
|
||||||
|
* title: 'My Title';
|
||||||
|
* message: 'My message';
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* this.firebaseDynamicLinks.sendInvitation(options)
|
||||||
|
* .then((res: any) => console.log(res))
|
||||||
|
* .catch((error: any) => console.error(error));
|
||||||
|
*
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* @interfaces
|
||||||
|
* DynamicLinksOptions
|
||||||
|
*/
|
||||||
|
@Plugin({
|
||||||
|
pluginName: 'FirebaseDynamicLinks',
|
||||||
|
plugin: ' cordova-plugin-firebase-dynamiclinks',
|
||||||
|
pluginRef: 'cordova.plugins.firebase.dynamiclinks',
|
||||||
|
repo: 'https://github.com/chemerisuk/cordova-plugin-firebase-dynamiclinks',
|
||||||
|
install: 'ionic cordova plugin add cordova-plugin-firebase-dynamiclinks --save --variable APP_DOMAIN="example.com" --variable APP_PATH="/"',
|
||||||
|
installVariables: ['APP_DOMAIN', 'APP_PATH'],
|
||||||
|
platforms: ['Android', 'iOS']
|
||||||
|
})
|
||||||
|
@Injectable()
|
||||||
|
export class FirebaseDynamicLinks extends IonicNativePlugin {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers callback that is triggered on each dynamic link click.
|
||||||
|
* @return {Promise<any>} Returns a promise
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
onDynamicLink(): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display invitation dialog.
|
||||||
|
* @param options {DynamicLinksOptions} Some param to configure something
|
||||||
|
* @return {Promise<any>} Returns a promise
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
sendInvitation(options: DynamicLinksOptions): Promise<any> { return; }
|
||||||
|
|
||||||
|
}
|
||||||
@@ -23,7 +23,7 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
pluginName: 'Flashlight',
|
pluginName: 'Flashlight',
|
||||||
plugin: 'cordova-plugin-flashlight',
|
plugin: 'cordova-plugin-flashlight',
|
||||||
pluginRef: 'window.plugins.flashlight',
|
pluginRef: 'window.plugins.flashlight',
|
||||||
repo: 'https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin.git',
|
repo: 'https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin',
|
||||||
platforms: ['Android', 'iOS', 'Windows Phone 8']
|
platforms: ['Android', 'iOS', 'Windows Phone 8']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|||||||
@@ -72,6 +72,9 @@ export interface FlurryAnalyticsLocation {
|
|||||||
horizontalAccuracy?: number;
|
horizontalAccuracy?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hidden
|
||||||
|
*/
|
||||||
export class FlurryAnalyticsObject {
|
export class FlurryAnalyticsObject {
|
||||||
|
|
||||||
constructor(private _objectInstance: any) { }
|
constructor(private _objectInstance: any) { }
|
||||||
@@ -208,8 +211,8 @@ export class FlurryAnalyticsObject {
|
|||||||
pluginName: 'FlurryAnalytics',
|
pluginName: 'FlurryAnalytics',
|
||||||
plugin: 'cordova-plugin-flurryanalytics',
|
plugin: 'cordova-plugin-flurryanalytics',
|
||||||
pluginRef: 'FlurryAnalytics',
|
pluginRef: 'FlurryAnalytics',
|
||||||
repo: 'https://github.com/blakgeek/cordova-plugin-flurryanalytics.git',
|
repo: 'https://github.com/blakgeek/cordova-plugin-flurryanalytics',
|
||||||
platforms: ['Android', 'iOS', 'Browser']
|
platforms: ['Android', 'iOS']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class FlurryAnalytics extends IonicNativePlugin {
|
export class FlurryAnalytics extends IonicNativePlugin {
|
||||||
@@ -224,7 +227,7 @@ export class FlurryAnalytics extends IonicNativePlugin {
|
|||||||
let instance: any;
|
let instance: any;
|
||||||
|
|
||||||
if (checkAvailability(FlurryAnalytics.pluginRef, null, FlurryAnalytics.pluginName) === true) {
|
if (checkAvailability(FlurryAnalytics.pluginRef, null, FlurryAnalytics.pluginName) === true) {
|
||||||
instance = new (window as any).FlurryAnalaytics(options);
|
instance = new (window as any).FlurryAnalytics(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new FlurryAnalyticsObject(instance);
|
return new FlurryAnalyticsObject(instance);
|
||||||
|
|||||||
@@ -0,0 +1,133 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name FTP
|
||||||
|
* @description
|
||||||
|
* This cordova plugin is created to use ftp (client) in web/js.
|
||||||
|
*
|
||||||
|
* @usage
|
||||||
|
* ```typescript
|
||||||
|
* import { FTP } from '@ionic-native/ftp';
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* constructor(private fTP: FTP) { }
|
||||||
|
*
|
||||||
|
* ...
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* this.fTP.connect('ftp_host', 'ftp_user', 'ftp_password')
|
||||||
|
* .then((res: any) => console.log('Login successful', res))
|
||||||
|
* .catch((error: any) => console.error(error));
|
||||||
|
*
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
@Plugin({
|
||||||
|
pluginName: 'FTP',
|
||||||
|
plugin: 'cordova-plugin-ftp',
|
||||||
|
pluginRef: 'cordova.plugin.ftp',
|
||||||
|
repo: 'https://github.com/xfally/cordova-plugin-ftp',
|
||||||
|
platforms: ['Android', 'iOS']
|
||||||
|
})
|
||||||
|
@Injectable()
|
||||||
|
export class FTP extends IonicNativePlugin {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Connect to one ftp server.
|
||||||
|
*
|
||||||
|
* Just need to init the connection once. If success, you can do any ftp actions later.
|
||||||
|
* @param hostname {string} The ftp server url. Like ip without protocol prefix, e.g. "192.168.1.1".
|
||||||
|
* @param username {string} The ftp login username. If it and `password` are all blank/undefined, the default username "anonymous" is used.
|
||||||
|
* @param password {string} The ftp login password. If it and `username` are all blank/undefined, the default password "anonymous@" is used.
|
||||||
|
* @return {Promise<any>} The success callback. Notice: For iOS, if triggered, means `init` success, but NOT means the later action, e.g. `ls`... `download` will success!
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
connect(hostname: string, username: string, password: string): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List files (with info of `name`, `type`, `link`, `size`, `modifiedDate`) under one directory on the ftp server.
|
||||||
|
* You can get one file's name using `fileList[x].name` (`x` is the location in array).
|
||||||
|
*
|
||||||
|
* Explain key:
|
||||||
|
* - name: file name (utf-8).
|
||||||
|
* - type: file type. number `0` means regular file, `1` means directory, `2` means symbolic link, `-1` means unknown type (maybe block dev, char dev...).
|
||||||
|
* - link: if the file is a symbolic link, then this field store symbolic link information (utf-8), else it's a blank string.
|
||||||
|
* - size: file size in bytes.
|
||||||
|
* - modifiedDate: modified date of this file. date format is `yyyy-MM-dd HH:mm:ss zzz`, e.g "2015-12-01 20:45:00 GMT+8".
|
||||||
|
*
|
||||||
|
* @param path {string} The path on the ftp server. e.g. "/adf/123/".
|
||||||
|
* @return {Promise<any>} Returns a promise
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
ls(path: string): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create one directory on the ftp server.
|
||||||
|
*
|
||||||
|
* @param path {string} The path on the ftp server. e.g. "/adf/123/".
|
||||||
|
* @return {Promise<any>} Returns a promise
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
mkdir(path: string): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete one directory on the ftp server.
|
||||||
|
*
|
||||||
|
* Tip: As many ftp server could not rm dir when it's not empty, so rm all files under the dir at first is recommended.
|
||||||
|
*
|
||||||
|
* @param path {string} The file (with full path) you want to delete. e.g. "/adf/123/newDir/myFile".
|
||||||
|
* @return {Promise<any>} Returns a promise
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
rmdir(path: string): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete one file on the ftp server.
|
||||||
|
*
|
||||||
|
* @param file {string} The file (with full path) you want to delete. e.g. "/adf/123/newDir/myFile".
|
||||||
|
* @return {Promise<any>} Returns a promise
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
rm(file: string): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Upload one local file to the ftp server.
|
||||||
|
*
|
||||||
|
* @param localFile {string} The file (with full path) you want to upload. e.g. "/local/path/to/localFile".
|
||||||
|
* @param remoteFile {string} The file (with full path) you want to located on the ftp server. e.g. "/adf/123/newDir/remoteFile".
|
||||||
|
* @return {Promise<any>} Returns a promise.
|
||||||
|
* It will be triggered many times according the file's size.
|
||||||
|
* The arg `0`, `0.1xx`, `0.2xx` ... `1` means the upload percent. When it reach `1`, means success.
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
upload(localFile: string, remoteFile: string): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Download one remote file on the ftp server to local path.
|
||||||
|
*
|
||||||
|
* @param localFile {string} The file (with full path) you want to upload. e.g. "/local/path/to/localFile".
|
||||||
|
* @param remoteFile {string} The file (with full path) you want to located on the ftp server. e.g. "/adf/123/newDir/remoteFile".
|
||||||
|
* @return {Promise<any>} Returns a promise.
|
||||||
|
* It will be triggered many times according the file's size.
|
||||||
|
* The arg `0`, `0.1xx`, `0.2xx` ... `1` means the upload percent. When it reach `1`, means success.
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
download(localFile: string, remoteFile: string): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cancel all requests. Always success.
|
||||||
|
*
|
||||||
|
* @return {Promise<any>} Returns a promise
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
cancel(): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disconnect from ftp server.
|
||||||
|
*
|
||||||
|
* @return {Promise<any>} Returns a promise
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
disconnect(): Promise<any> { return; }
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
|
|||||||
import { Cordova, Plugin, CordovaFunctionOverride, IonicNativePlugin } from '@ionic-native/core';
|
import { Cordova, Plugin, CordovaFunctionOverride, IonicNativePlugin } from '@ionic-native/core';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
declare var window: any;
|
declare const window: any;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Geofence
|
* @name Geofence
|
||||||
@@ -72,15 +72,15 @@ declare var window: any;
|
|||||||
* ### Troubleshooting ###
|
* ### Troubleshooting ###
|
||||||
* #### I get compile errors when I run `ionic build ios` or `ionic run ios`. ####
|
* #### I get compile errors when I run `ionic build ios` or `ionic run ios`. ####
|
||||||
* This could be caused by the Cordova project directory in `/platforms/ios` not being named correctly.
|
* This could be caused by the Cordova project directory in `/platforms/ios` not being named correctly.
|
||||||
* Try running `ionic platform rm <platform>` then run `ionic platform add <platform>` to recreate the
|
* Try running `ionic cordova platform rm <platform>` then run `ionic cordova platform add <platform>` to recreate the
|
||||||
* platform directories.
|
* platform directories.
|
||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
pluginName: 'Geofence',
|
pluginName: 'Geofence',
|
||||||
plugin: 'cordova-plugin-geofence',
|
plugin: 'cordova-plugin-geofence',
|
||||||
pluginRef: 'geofence',
|
pluginRef: 'geofence',
|
||||||
repo: 'https://github.com/cowbell/cordova-plugin-geofence/',
|
repo: 'https://github.com/cowbell/cordova-plugin-geofence',
|
||||||
platforms: ['Android', 'iOS', 'Windows Phone 8', 'Windows Phone']
|
platforms: ['Android', 'iOS', 'Windows', 'Windows Phone 8']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Geofence extends IonicNativePlugin {
|
export class Geofence extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
|
|||||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
declare var navigator: any;
|
declare const navigator: any;
|
||||||
|
|
||||||
export interface Coordinates {
|
export interface Coordinates {
|
||||||
|
|
||||||
@@ -153,7 +153,7 @@ export interface GeolocationOptions {
|
|||||||
plugin: 'cordova-plugin-geolocation',
|
plugin: 'cordova-plugin-geolocation',
|
||||||
pluginRef: 'navigator.geolocation',
|
pluginRef: 'navigator.geolocation',
|
||||||
repo: 'https://github.com/apache/cordova-plugin-geolocation',
|
repo: 'https://github.com/apache/cordova-plugin-geolocation',
|
||||||
platforms: ['Android', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone']
|
platforms: ['Amazon Fire OS', 'Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Geolocation extends IonicNativePlugin {
|
export class Geolocation extends IonicNativePlugin {
|
||||||
@@ -174,7 +174,7 @@ export class Geolocation extends IonicNativePlugin {
|
|||||||
* Observable changes.
|
* Observable changes.
|
||||||
*
|
*
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* var subscription = this.geolocation.watchPosition()
|
* const subscription = this.geolocation.watchPosition()
|
||||||
* .filter((p) => p.coords !== undefined) //Filter Out Errors
|
* .filter((p) => p.coords !== undefined) //Filter Out Errors
|
||||||
* .subscribe(position => {
|
* .subscribe(position => {
|
||||||
* console.log(position.coords.longitude + ' ' + position.coords.latitude);
|
* console.log(position.coords.longitude + ' ' + position.coords.latitude);
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
plugin: 'cordova-plugin-globalization',
|
plugin: 'cordova-plugin-globalization',
|
||||||
pluginRef: 'navigator.globalization',
|
pluginRef: 'navigator.globalization',
|
||||||
repo: 'https://github.com/apache/cordova-plugin-globalization',
|
repo: 'https://github.com/apache/cordova-plugin-globalization',
|
||||||
platforms: ['Amazon Fire OS', 'Android', 'BlackBerry 10', 'Firefox OS', 'iOS', 'Windows Phone 8', 'Widnows', 'Browser']
|
platforms: ['Amazon Fire OS', 'Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Globalization extends IonicNativePlugin {
|
export class Globalization extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
declare var window;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Google Analytics
|
* @name Google Analytics
|
||||||
* @description
|
* @description
|
||||||
@@ -36,7 +34,7 @@ declare var window;
|
|||||||
plugin: 'cordova-plugin-google-analytics',
|
plugin: 'cordova-plugin-google-analytics',
|
||||||
pluginRef: 'ga',
|
pluginRef: 'ga',
|
||||||
repo: 'https://github.com/danwilson/google-analytics-plugin',
|
repo: 'https://github.com/danwilson/google-analytics-plugin',
|
||||||
platforms: ['Android', 'iOS', 'Browser']
|
platforms: ['Android', 'Browser', 'iOS', 'Windows Phone 8']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class GoogleAnalytics extends IonicNativePlugin {
|
export class GoogleAnalytics extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Cordova, CordovaInstance, CordovaCheck, Plugin, InstanceProperty, Insta
|
|||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Observable';
|
||||||
import 'rxjs/add/observable/fromEvent';
|
import 'rxjs/add/observable/fromEvent';
|
||||||
|
|
||||||
declare var plugin: any;
|
declare const plugin: any;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @hidden
|
* @hidden
|
||||||
@@ -853,14 +853,14 @@ export class Marker {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the marker position.
|
* Set the marker position.
|
||||||
* @param latLng {GoogleMapLatLng}
|
* @param latLng {LatLng}
|
||||||
*/
|
*/
|
||||||
@CordovaInstance({ sync: true })
|
@CordovaInstance({ sync: true })
|
||||||
setPosition(latLng: LatLng): void { return; }
|
setPosition(latLng: LatLng): void { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the marker position.
|
* Return the marker position.
|
||||||
* @return {Promise<GoogleMapLatLng>}
|
* @return {Promise<LatLng>}
|
||||||
*/
|
*/
|
||||||
@CordovaInstance()
|
@CordovaInstance()
|
||||||
getPosition(): Promise<LatLng> { return; }
|
getPosition(): Promise<LatLng> { return; }
|
||||||
@@ -1473,7 +1473,7 @@ export class GroundOverlay {
|
|||||||
return Promise.reject({ error: 'plugin_not_installed' });
|
return Promise.reject({ error: 'plugin_not_installed' });
|
||||||
}
|
}
|
||||||
return new Promise<any>(
|
return new Promise<any>(
|
||||||
resolve => this._objectInstance.addListenerOnce(eventName, resolve)
|
(resolve: Function) => this._objectInstance.addListenerOnce(eventName, resolve)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1766,7 +1766,7 @@ export class Geocoder {
|
|||||||
*/
|
*/
|
||||||
@CordovaCheck()
|
@CordovaCheck()
|
||||||
geocode(request: GeocoderRequest): Promise<GeocoderResult[] | any> {
|
geocode(request: GeocoderRequest): Promise<GeocoderResult[] | any> {
|
||||||
return new Promise<GeocoderResult[]>(resolve => {
|
return new Promise<GeocoderResult[]>((resolve: Function) => {
|
||||||
plugin.google.maps.Geocoder.geocode(request, resolve);
|
plugin.google.maps.Geocoder.geocode(request, resolve);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
plugin: 'cordova-plugin-googleplus',
|
plugin: 'cordova-plugin-googleplus',
|
||||||
pluginRef: 'window.plugins.googleplus',
|
pluginRef: 'window.plugins.googleplus',
|
||||||
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-googleplus',
|
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-googleplus',
|
||||||
platforms: ['Web', 'Android', 'iOS'],
|
install: 'ionic cordova plugin add cordova-plugin-googleplus --variable REVERSED_CLIENT_ID=myreversedclientid',
|
||||||
install: 'ionic plugin add cordova-plugin-googleplus --variable REVERSED_CLIENT_ID=myreversedclientid',
|
installVariables: ['REVERSED_CLIENT_ID'],
|
||||||
installVariables: ['REVERSED_CLIENT_ID']
|
platforms: ['Android', 'iOS']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class GooglePlus extends IonicNativePlugin {
|
export class GooglePlus extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Observable';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
declare var navigator: any;
|
declare const navigator: any;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @hidden
|
* @hidden
|
||||||
|
|||||||
@@ -49,10 +49,10 @@ export interface HttpdOptions {
|
|||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
pluginName: 'Httpd',
|
pluginName: 'Httpd',
|
||||||
plugin: 'https://github.com/floatinghotpot/cordova-httpd.git',
|
plugin: 'cordova-plugin-httpd',
|
||||||
pluginRef: 'cordova.plugins.CorHttpd',
|
pluginRef: 'cordova.plugins.CorHttpd',
|
||||||
repo: 'https://github.com/floatinghotpot/cordova-httpd',
|
repo: 'https://github.com/floatinghotpot/cordova-httpd',
|
||||||
platforms: ['iOS', 'Android']
|
platforms: ['Android', 'iOS', 'macOS']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Httpd extends IonicNativePlugin {
|
export class Httpd extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
|
|||||||
import { Cordova, Plugin, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
|
import { Cordova, Plugin, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
declare var cordova: any;
|
declare const cordova: any;
|
||||||
|
|
||||||
export interface Beacon {
|
export interface Beacon {
|
||||||
/**
|
/**
|
||||||
@@ -16,7 +16,7 @@ export interface Beacon {
|
|||||||
major: number;
|
major: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The beacon's major identifier number.
|
* The beacon's minor identifier number.
|
||||||
*/
|
*/
|
||||||
minor: number;
|
minor: number;
|
||||||
|
|
||||||
@@ -636,7 +636,7 @@ export class IBeacon extends IonicNativePlugin {
|
|||||||
* native layer acknowledged the dispatch of the advertising request.
|
* native layer acknowledged the dispatch of the advertising request.
|
||||||
*/
|
*/
|
||||||
@Cordova({ otherPromise: true })
|
@Cordova({ otherPromise: true })
|
||||||
startAdvertising(region: Region, measuredPower: number): Promise<void> { return; }
|
startAdvertising(region: Region, measuredPower?: number): Promise<void> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stop advertising as a beacon.
|
* Stop advertising as a beacon.
|
||||||
|
|||||||
@@ -57,9 +57,11 @@ export interface ImagePickerOptions {
|
|||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
pluginName: 'ImagePicker',
|
pluginName: 'ImagePicker',
|
||||||
plugin: 'https://github.com/Telerik-Verified-Plugins/ImagePicker',
|
plugin: 'https://github.com/Telerik-Verified-Plugins/ImagePicker.git',
|
||||||
pluginRef: 'window.imagePicker',
|
pluginRef: 'window.imagePicker',
|
||||||
repo: 'https://github.com/Telerik-Verified-Plugins/ImagePicker',
|
repo: 'https://github.com/Telerik-Verified-Plugins/ImagePicker',
|
||||||
|
install: 'ionic cordova plugin add https://github.com/Telerik-Verified-Plugins/ImagePicker.git --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="your usage message"',
|
||||||
|
installVariables: ['PHOTO_LIBRARY_USAGE_DESCRIPTION'],
|
||||||
platforms: ['Android', 'iOS']
|
platforms: ['Android', 'iOS']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export interface ImageResizerOptions {
|
|||||||
* Cordova Plugin For Image Resize
|
* Cordova Plugin For Image Resize
|
||||||
*
|
*
|
||||||
* Requires plugin `info.protonet.imageresizer` - use the Ionic CLI and type in the following command:
|
* Requires plugin `info.protonet.imageresizer` - use the Ionic CLI and type in the following command:
|
||||||
* `ionic plugin add https://github.com/protonet/cordova-plugin-image-resizer.git`
|
* `ionic cordova plugin add https://github.com/protonet/cordova-plugin-image-resizer.git`
|
||||||
*
|
*
|
||||||
* For more info, please see the https://github.com/protonet/cordova-plugin-image-resizer
|
* For more info, please see the https://github.com/protonet/cordova-plugin-image-resizer
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { Injectable } from '@angular/core';
|
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 { Observable } from 'rxjs/Observable';
|
||||||
import 'rxjs/add/observable/fromEvent';
|
import { Observer } from 'rxjs/Observer';
|
||||||
|
|
||||||
declare var cordova: any;
|
declare const cordova: Cordova & { InAppBrowser: any; };
|
||||||
|
|
||||||
export interface InAppBrowserOptions {
|
export interface InAppBrowserOptions {
|
||||||
/** Set to yes or no to turn the InAppBrowser's location bar on or off. */
|
/** Set to yes or no to turn the InAppBrowser's location bar on or off. */
|
||||||
@@ -48,6 +48,11 @@ export interface InAppBrowserOptions {
|
|||||||
/** (Windows only) Set to yes to create the browser control without a border around it.
|
/** (Windows only) Set to yes to create the browser control without a border around it.
|
||||||
* Please note that if location=no is also specified, there will be no control presented to user to close IAB window. */
|
* Please note that if location=no is also specified, there will be no control presented to user to close IAB window. */
|
||||||
fullscreen?: 'yes';
|
fullscreen?: 'yes';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hidden
|
||||||
|
*/
|
||||||
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
export interface InAppBrowserEvent extends Event {
|
export interface InAppBrowserEvent extends Event {
|
||||||
/** the eventname, either loadstart, loadstop, loaderror, or exit. */
|
/** the eventname, either loadstart, loadstop, loaderror, or exit. */
|
||||||
@@ -80,12 +85,18 @@ export class InAppBrowserObject {
|
|||||||
*/
|
*/
|
||||||
constructor(url: string, target?: string, options?: string | InAppBrowserOptions) {
|
constructor(url: string, target?: string, options?: string | InAppBrowserOptions) {
|
||||||
try {
|
try {
|
||||||
if (options && typeof options !== 'string')
|
|
||||||
options = Object.keys(options).map(key => `${key}=${options[key]}`).join(',');
|
if (options && typeof options !== 'string') {
|
||||||
|
options = Object.keys(options).map((key: string) => `${key}=${(<InAppBrowserOptions>options)[key]}`).join(',');
|
||||||
|
}
|
||||||
|
|
||||||
this._objectInstance = cordova.InAppBrowser.open(url, target, options);
|
this._objectInstance = cordova.InAppBrowser.open(url, target, options);
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
window.open(url);
|
|
||||||
|
window.open(url, target);
|
||||||
console.warn('Native: InAppBrowser is not installed or you are running on a browser. Falling back to window.open.');
|
console.warn('Native: InAppBrowser is not installed or you are running on a browser. Falling back to window.open.');
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,8 +141,12 @@ export class InAppBrowserObject {
|
|||||||
* @param event {string} Name of the event
|
* @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.
|
* @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> {
|
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));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,7 +181,7 @@ export class InAppBrowserObject {
|
|||||||
plugin: 'cordova-plugin-inappbrowser',
|
plugin: 'cordova-plugin-inappbrowser',
|
||||||
pluginRef: 'cordova.InAppBrowser',
|
pluginRef: 'cordova.InAppBrowser',
|
||||||
repo: 'https://github.com/apache/cordova-plugin-inappbrowser',
|
repo: 'https://github.com/apache/cordova-plugin-inappbrowser',
|
||||||
platforms: ['Amazon', 'Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'OS X', 'Ubuntu', 'Windows', 'Windows Phone']
|
platforms: ['AmazonFire OS', 'Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'macOS', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class InAppBrowser extends IonicNativePlugin {
|
export class InAppBrowser extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
pluginName: 'InAppPurchase',
|
pluginName: 'InAppPurchase',
|
||||||
plugin: 'cordova-plugin-inapppurchase',
|
plugin: 'cordova-plugin-inapppurchase',
|
||||||
pluginRef: 'inAppPurchase',
|
pluginRef: 'inAppPurchase',
|
||||||
platforms: ['Android', 'iOS'],
|
repo: 'https://github.com/AlexDisler/cordova-plugin-inapppurchase',
|
||||||
repo: 'https://github.com/AlexDisler/cordova-plugin-inapppurchase'
|
platforms: ['Android', 'iOS']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class InAppPurchase extends IonicNativePlugin {
|
export class InAppPurchase extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -31,10 +31,10 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
pluginName: 'Insomnia',
|
pluginName: 'Insomnia',
|
||||||
plugin: 'https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git',
|
plugin: 'cordova-plugin-insomnia',
|
||||||
pluginRef: 'plugins.insomnia',
|
pluginRef: 'plugins.insomnia',
|
||||||
repo: 'https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin',
|
repo: 'https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin',
|
||||||
platforms: ['Android', 'iOS', 'Windows Phone 8']
|
platforms: ['Android', 'Browser', 'Firefox OS', 'iOS', 'Windows', 'Windows Phone 8']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Insomnia extends IonicNativePlugin {
|
export class Insomnia extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
declare var window: any;
|
declare const window: any;
|
||||||
|
|
||||||
export interface IntelSecurityDataOptions {
|
export interface IntelSecurityDataOptions {
|
||||||
/** Non-empty string. **/
|
/** Non-empty string. **/
|
||||||
@@ -53,7 +53,7 @@ export interface IntelSecurityDataOptions {
|
|||||||
* .catch((error: any) => console.log(error));
|
* .catch((error: any) => console.log(error));
|
||||||
*
|
*
|
||||||
* this.intelSecurity.storage.read({id: storageID })
|
* this.intelSecurity.storage.read({id: storageID })
|
||||||
* .then((instanceID: number) => this.intelSec.data.getData(instanceID))
|
* .then((instanceID: number) => this.intelSecurity.data.getData(instanceID))
|
||||||
* .then((data: string) => console.log(data)) // Resolves to 'Sample Data'
|
* .then((data: string) => console.log(data)) // Resolves to 'Sample Data'
|
||||||
* .catch((error: any) => console.log(error));
|
* .catch((error: any) => console.log(error));
|
||||||
*
|
*
|
||||||
@@ -72,7 +72,7 @@ export interface IntelSecurityDataOptions {
|
|||||||
plugin: 'com-intel-security-cordova-plugin',
|
plugin: 'com-intel-security-cordova-plugin',
|
||||||
pluginRef: 'intel.security',
|
pluginRef: 'intel.security',
|
||||||
repo: 'https://github.com/AppSecurityApi/com-intel-security-cordova-plugin',
|
repo: 'https://github.com/AppSecurityApi/com-intel-security-cordova-plugin',
|
||||||
platforms: ['Android', 'iOS', 'Windows']
|
platforms: ['Android', 'iOS', 'Windows', 'Windows Phone 8']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class IntelSecurity extends IonicNativePlugin {
|
export class IntelSecurity extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
|
|||||||
import { Plugin, Cordova, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
|
import { Plugin, Cordova, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
declare var cordova: any;
|
declare const cordova: any;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Jins Meme
|
* @name Jins Meme
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import { Observable } from 'rxjs/Observable';
|
|||||||
pluginName: 'Keyboard',
|
pluginName: 'Keyboard',
|
||||||
plugin: 'ionic-plugin-keyboard',
|
plugin: 'ionic-plugin-keyboard',
|
||||||
pluginRef: 'cordova.plugins.Keyboard',
|
pluginRef: 'cordova.plugins.Keyboard',
|
||||||
repo: 'https://github.com/driftyco/ionic-plugin-keyboard',
|
repo: 'https://github.com/ionic-team/ionic-plugin-keyboard',
|
||||||
platforms: ['Android', 'BlackBerry 10', 'iOS', 'Windows']
|
platforms: ['Android', 'BlackBerry 10', 'iOS', 'Windows']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@@ -57,7 +57,7 @@ export class Keyboard extends IonicNativePlugin {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Prevents the native UIScrollView from moving when an input is focused.
|
* Prevents the native UIScrollView from moving when an input is focused.
|
||||||
* @param disable
|
* @param disable {boolean}
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
sync: true,
|
sync: true,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
* @description
|
* @description
|
||||||
* Get and set data in the iOS Keychain
|
* Get and set data in the iOS Keychain
|
||||||
*
|
*
|
||||||
* Requires Cordova plugin: `cordova-plugin-ios-keychain`. For more info, please see the [Keychain plugin docs](https://github.com/driftyco/cordova-plugin-ios-keychain).
|
* Requires Cordova plugin: `cordova-plugin-ios-keychain`. For more info, please see the [Keychain plugin docs](https://github.com/ionic-team/cordova-plugin-ios-keychain).
|
||||||
*
|
*
|
||||||
* @usage
|
* @usage
|
||||||
* ```typescript
|
* ```typescript
|
||||||
@@ -29,7 +29,7 @@ import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
pluginName: 'Keychain',
|
pluginName: 'Keychain',
|
||||||
plugin: 'cordova-plugin-ios-keychain',
|
plugin: 'cordova-plugin-ios-keychain',
|
||||||
pluginRef: 'window.Keychain',
|
pluginRef: 'window.Keychain',
|
||||||
repo: 'https://github.com/driftyco/cordova-plugin-ios-keychain/',
|
repo: 'https://github.com/ionic-team/cordova-plugin-ios-keychain',
|
||||||
platforms: ['iOS']
|
platforms: ['iOS']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ export interface LaunchNavigatorOptions {
|
|||||||
plugin: 'uk.co.workingedge.phonegap.plugin.launchnavigator',
|
plugin: 'uk.co.workingedge.phonegap.plugin.launchnavigator',
|
||||||
pluginRef: 'launchnavigator',
|
pluginRef: 'launchnavigator',
|
||||||
repo: 'https://github.com/dpa99c/phonegap-launch-navigator',
|
repo: 'https://github.com/dpa99c/phonegap-launch-navigator',
|
||||||
platforms: ['Android', 'iOS']
|
platforms: ['Android', 'iOS', 'Windows', 'Windows Phone 8']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class LaunchNavigator extends IonicNativePlugin {
|
export class LaunchNavigator extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -52,8 +52,9 @@ export type LinkedInLoginScopes = 'r_basicprofile' | 'r_emailaddress' | 'rw_comp
|
|||||||
pluginName: 'LinkedIn',
|
pluginName: 'LinkedIn',
|
||||||
plugin: 'cordova-plugin-linkedin',
|
plugin: 'cordova-plugin-linkedin',
|
||||||
pluginRef: 'cordova.plugins.LinkedIn',
|
pluginRef: 'cordova.plugins.LinkedIn',
|
||||||
repo: 'https://github.com/zyramedia/cordova-plugin-linkedin',
|
repo: 'https://github.com/zyra/cordova-plugin-linkedin',
|
||||||
install: 'ionic plugin add cordova-plugin-linkedin --variable APP_ID=YOUR_APP_ID',
|
install: 'ionic cordova plugin add cordova-plugin-linkedin --variable APP_ID=YOUR_APP_ID',
|
||||||
|
installVariables: ['APP_ID'],
|
||||||
platforms: ['Android', 'iOS']
|
platforms: ['Android', 'iOS']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@@ -100,10 +101,17 @@ export class LinkedIn extends IonicNativePlugin {
|
|||||||
openProfile(memberId: string): Promise<any> { return; }
|
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
|
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates whether there is an active session
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
hasActiveSession(): Promise<boolean> { return; }
|
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; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,6 +89,11 @@ export interface ILocalNotification {
|
|||||||
* Default: FFFFFF
|
* Default: FFFFFF
|
||||||
*/
|
*/
|
||||||
led?: string;
|
led?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Notification priority.
|
||||||
|
*/
|
||||||
|
priority?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
|
|||||||
import { Cordova, CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
import { Cordova, CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
declare var navigator: any;
|
declare const navigator: any;
|
||||||
|
|
||||||
export interface MediaFile {
|
export interface MediaFile {
|
||||||
/**
|
/**
|
||||||
@@ -33,7 +33,7 @@ export interface MediaFile {
|
|||||||
* @param {Function} successCallback
|
* @param {Function} successCallback
|
||||||
* @param {Function} errorCallback
|
* @param {Function} errorCallback
|
||||||
*/
|
*/
|
||||||
getFormatData(successCallback: (data: MediaFileData) => any, errorCallback?: (err: any) => any);
|
getFormatData(successCallback: (data: MediaFileData) => any, errorCallback?: (err: any) => any): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MediaFileData {
|
export interface MediaFileData {
|
||||||
@@ -146,7 +146,8 @@ export interface ConfigurationData {
|
|||||||
pluginName: 'MediaCapture',
|
pluginName: 'MediaCapture',
|
||||||
plugin: 'cordova-plugin-media-capture',
|
plugin: 'cordova-plugin-media-capture',
|
||||||
pluginRef: 'navigator.device.capture',
|
pluginRef: 'navigator.device.capture',
|
||||||
repo: 'https://github.com/apache/cordova-plugin-media-capture'
|
repo: 'https://github.com/apache/cordova-plugin-media-capture',
|
||||||
|
platforms: ['Android', 'BlackBerry 10', 'Browser', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class MediaCapture extends IonicNativePlugin {
|
export class MediaCapture extends IonicNativePlugin {
|
||||||
|
|||||||
@@ -1,19 +1,14 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { CordovaInstance, Plugin, CordovaCheck, IonicNativePlugin } from '@ionic-native/core';
|
import { CordovaInstance, Plugin, checkAvailability, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
declare var Media: any;
|
|
||||||
|
|
||||||
|
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
|
* @hidden
|
||||||
*/
|
*/
|
||||||
export class MediaObject {
|
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) {}
|
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.
|
* 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
|
* @returns {number} Returns a promise with the duration of the current recording
|
||||||
*/
|
*/
|
||||||
@CordovaInstance({
|
@CordovaInstance({ sync: true })
|
||||||
sync: true
|
|
||||||
})
|
|
||||||
getDuration(): number { return; }
|
getDuration(): number { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts or resumes playing an audio file.
|
* Starts or resumes playing an audio file.
|
||||||
*/
|
*/
|
||||||
@CordovaInstance({
|
@CordovaInstance({ sync: true })
|
||||||
sync: true
|
|
||||||
})
|
|
||||||
play(iosOptions?: {
|
play(iosOptions?: {
|
||||||
numberOfLoops?: number,
|
numberOfLoops?: number,
|
||||||
playAudioWhenScreenIsLocked?: boolean
|
playAudioWhenScreenIsLocked?: boolean
|
||||||
@@ -53,75 +44,57 @@ export class MediaObject {
|
|||||||
/**
|
/**
|
||||||
* Pauses playing an audio file.
|
* Pauses playing an audio file.
|
||||||
*/
|
*/
|
||||||
@CordovaInstance({
|
@CordovaInstance({ sync: true })
|
||||||
sync: true
|
|
||||||
})
|
|
||||||
pause(): void { }
|
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.
|
* 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({
|
@CordovaInstance({ sync: true })
|
||||||
sync: true
|
|
||||||
})
|
|
||||||
release(): void { }
|
release(): void { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the current position within an audio file.
|
* Sets the current position within an audio file.
|
||||||
* @param {number} milliseconds The time position you want to set for the current audio file
|
* @param {number} milliseconds The time position you want to set for the current audio file
|
||||||
*/
|
*/
|
||||||
@CordovaInstance({
|
@CordovaInstance({ sync: true })
|
||||||
sync: true
|
|
||||||
})
|
|
||||||
seekTo(milliseconds: number): void { }
|
seekTo(milliseconds: number): void { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the volume for an audio file.
|
* 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.
|
* @param volume {number} The volume to set for playback. The value must be within the range of 0.0 to 1.0.
|
||||||
*/
|
*/
|
||||||
@CordovaInstance({
|
@CordovaInstance({ sync: true })
|
||||||
sync: true
|
|
||||||
})
|
|
||||||
setVolume(volume: number): void { }
|
setVolume(volume: number): void { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts recording an audio file.
|
* Starts recording an audio file.
|
||||||
*/
|
*/
|
||||||
@CordovaInstance({
|
@CordovaInstance({ sync: true })
|
||||||
sync: true
|
|
||||||
})
|
|
||||||
startRecord(): void { }
|
startRecord(): void { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stops recording
|
* Stops recording
|
||||||
*/
|
*/
|
||||||
@CordovaInstance({
|
@CordovaInstance({ sync: true })
|
||||||
sync: true
|
|
||||||
})
|
|
||||||
stopRecord(): void { }
|
stopRecord(): void { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pauses recording
|
* Pauses recording
|
||||||
*/
|
*/
|
||||||
@CordovaInstance({
|
@CordovaInstance({ sync: true })
|
||||||
sync: true
|
|
||||||
})
|
|
||||||
pauseRecord(): void { }
|
pauseRecord(): void { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resumes recording
|
* Resumes recording
|
||||||
*/
|
*/
|
||||||
@CordovaInstance({
|
@CordovaInstance({ sync: true })
|
||||||
sync: true
|
|
||||||
})
|
|
||||||
resumeRecord(): void { }
|
resumeRecord(): void { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stops playing an audio file.
|
* Stops playing an audio file.
|
||||||
*/
|
*/
|
||||||
@CordovaInstance({
|
@CordovaInstance({ sync: true })
|
||||||
sync: true
|
|
||||||
})
|
|
||||||
stop(): void { }
|
stop(): void { }
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -147,6 +120,8 @@ export type MediaErrorCallback = (error: MediaError) => void;
|
|||||||
/**
|
/**
|
||||||
* @name Media
|
* @name Media
|
||||||
* @description
|
* @description
|
||||||
|
* This plugin provides the ability to record and play back audio files on a device.
|
||||||
|
*
|
||||||
* Some hints if you are using iOS and recording doesn't work:
|
* Some hints if you are using iOS and recording doesn't work:
|
||||||
* 1.) Try to use a absolute file path but remove beginning "file://".
|
* 1.) Try to use a absolute file path but remove beginning "file://".
|
||||||
* Then it looks like: `/var/mobile/Containers/Data/Application/AF438B8B-7724-4FBB-8E69-083463224FC4/tmp/my_file.m4a`
|
* Then it looks like: `/var/mobile/Containers/Data/Application/AF438B8B-7724-4FBB-8E69-083463224FC4/tmp/my_file.m4a`
|
||||||
@@ -169,8 +144,8 @@ export type MediaErrorCallback = (error: MediaError) => void;
|
|||||||
* window.setTimeout(() => file.stopRecord(), 10000);
|
* window.setTimeout(() => file.stopRecord(), 10000);
|
||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* You can find the reasons here: https://github.com/driftyco/ionic-native/issues/1452#issuecomment-299605906
|
* You can find the reasons here: https://github.com/ionic-team/ionic-native/issues/1452#issuecomment-299605906
|
||||||
*
|
*
|
||||||
* @usage
|
* @usage
|
||||||
* ```typescript
|
* ```typescript
|
||||||
@@ -239,7 +214,8 @@ export type MediaErrorCallback = (error: MediaError) => void;
|
|||||||
pluginName: 'MediaPlugin',
|
pluginName: 'MediaPlugin',
|
||||||
repo: 'https://github.com/apache/cordova-plugin-media',
|
repo: 'https://github.com/apache/cordova-plugin-media',
|
||||||
plugin: 'cordova-plugin-media',
|
plugin: 'cordova-plugin-media',
|
||||||
pluginRef: 'Media'
|
pluginRef: 'Media',
|
||||||
|
platforms: ['Android', 'BlackBerry 10', 'Browser', 'iOS', 'Tizen', 'Ubuntu', 'Windows', 'Windows Phone']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class MediaPlugin extends IonicNativePlugin {
|
export class MediaPlugin extends IonicNativePlugin {
|
||||||
@@ -292,15 +268,19 @@ export class MediaPlugin extends IonicNativePlugin {
|
|||||||
* @param [onError] {MediaErrorCallback} A callback function is be invoked if an error occurs.
|
* @param [onError] {MediaErrorCallback} A callback function is be invoked if an error occurs.
|
||||||
* @return {MediaObject}
|
* @return {MediaObject}
|
||||||
*/
|
*/
|
||||||
@CordovaCheck()
|
|
||||||
create(src: string,
|
create(src: string,
|
||||||
onStatusUpdate?: MediaStatusUpdateCallback,
|
onStatusUpdate?: MediaStatusUpdateCallback,
|
||||||
onSuccess?: Function,
|
onSuccess?: Function,
|
||||||
onError?: MediaErrorCallback): MediaObject {
|
onError?: MediaErrorCallback): MediaObject {
|
||||||
|
|
||||||
|
let instance: any;
|
||||||
|
|
||||||
|
if (checkAvailability(MediaPlugin.getPluginRef(), null, MediaPlugin.getPluginName()) === true) {
|
||||||
// Creates a new media object
|
// Creates a new media object
|
||||||
const instance = new Media(src, onSuccess, onError, onStatusUpdate);
|
instance = new Media(src, onSuccess, onError, onStatusUpdate);
|
||||||
return new MediaObject(instance);
|
}
|
||||||
|
|
||||||
|
return new MediaObject(instance);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user