mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-02-16 00:00:02 +08:00
Compare commits
56 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9dee2fbc0c | ||
|
|
60b9c69763 | ||
|
|
b98fa28b4b | ||
|
|
603aa9f6d2 | ||
|
|
f4fa8c31f0 | ||
|
|
8e787fdd5f | ||
|
|
c5ec7c33b5 | ||
|
|
c6dbf343fb | ||
|
|
fa311e6a7c | ||
|
|
04347c3df8 | ||
|
|
8adb36e2a0 | ||
|
|
c700c31127 | ||
|
|
5981622f3a | ||
|
|
77d6308bca | ||
|
|
92e0bb55c3 | ||
|
|
452aa5d8c9 | ||
|
|
2ddb8be775 | ||
|
|
ebf07161b6 | ||
|
|
6ddd2aa184 | ||
|
|
9974a1fbd8 | ||
|
|
67edb835f2 | ||
|
|
5b6cb6e19f | ||
|
|
9a5a62bc3a | ||
|
|
d192dee1ee | ||
|
|
0d6997cbdd | ||
|
|
49325e8b93 | ||
|
|
de07df6f20 | ||
|
|
ca60c5b912 | ||
|
|
54d1a9891b | ||
|
|
2c57bc965c | ||
|
|
d62779a2a6 | ||
|
|
009a20608e | ||
|
|
ca14bf6a75 | ||
|
|
49fe24dee2 | ||
|
|
d9d89341d2 | ||
|
|
bbf75bcbd7 | ||
|
|
9441928884 | ||
|
|
8eb656cce8 | ||
|
|
bf0486cb8b | ||
|
|
e681761f56 | ||
|
|
84ec3fa8d2 | ||
|
|
c618ceb693 | ||
|
|
46a9b6d50d | ||
|
|
44fe04bbbd | ||
|
|
3385c1b6dc | ||
|
|
a1b0f885a7 | ||
|
|
56e8eaeb5d | ||
|
|
ba77fd70c3 | ||
|
|
1841220359 | ||
|
|
c44fb75adc | ||
|
|
ad6badef1f | ||
|
|
7bcf1bfc74 | ||
|
|
0c36988544 | ||
|
|
71e49da8ad | ||
|
|
c28df732d5 | ||
|
|
d5dfdf83f3 |
54
CHANGELOG.md
54
CHANGELOG.md
@@ -1,3 +1,57 @@
|
||||
<a name="2.2.15"></a>
|
||||
## [2.2.15](https://github.com/driftyco/ionic-native/compare/v2.2.14...v2.2.15) (2017-01-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **apprate:** captialize URL in storeAppURL property ([b98fa28](https://github.com/driftyco/ionic-native/commit/b98fa28))
|
||||
* **ble:** stopScan takes no args when used as clear function ([#944](https://github.com/driftyco/ionic-native/issues/944)) ([6ddd2aa](https://github.com/driftyco/ionic-native/commit/6ddd2aa))
|
||||
* **onesignal:** OSNotification.app_id is optional ([#946](https://github.com/driftyco/ionic-native/issues/946)) ([ebf0716](https://github.com/driftyco/ionic-native/commit/ebf0716))
|
||||
|
||||
|
||||
|
||||
<a name="2.2.14"></a>
|
||||
## [2.2.14](https://github.com/driftyco/ionic-native/compare/v2.2.13...v2.2.14) (2017-01-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **google-analytics:** fix startTrackerWithId when interval is not provided ([49fe24d](https://github.com/driftyco/ionic-native/commit/49fe24d))
|
||||
* **google-plus:** fixes login without options ([ca14bf6](https://github.com/driftyco/ionic-native/commit/ca14bf6)), closes [#932](https://github.com/driftyco/ionic-native/issues/932)
|
||||
* **inappbrowser:** fix insertCSS method name ([de07df6](https://github.com/driftyco/ionic-native/commit/de07df6)), closes [#921](https://github.com/driftyco/ionic-native/issues/921)
|
||||
* **mixpanel:** fix issue when not passing eventProperties ([#927](https://github.com/driftyco/ionic-native/issues/927)) ([bbf75bc](https://github.com/driftyco/ionic-native/commit/bbf75bc))
|
||||
* **nfc:** add missing param for addMimeTypeListener ([#937](https://github.com/driftyco/ionic-native/issues/937)) ([ca60c5b](https://github.com/driftyco/ionic-native/commit/ca60c5b))
|
||||
* **push:** fix typing for additionalData ([0d6997c](https://github.com/driftyco/ionic-native/commit/0d6997c)), closes [#868](https://github.com/driftyco/ionic-native/issues/868)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **background-geolocation:** add altitudeAccuracy into response typings ([#922](https://github.com/driftyco/ionic-native/issues/922)) ([8eb656c](https://github.com/driftyco/ionic-native/commit/8eb656c))
|
||||
* **market:** add search method, return promises ([d62779a](https://github.com/driftyco/ionic-native/commit/d62779a))
|
||||
|
||||
|
||||
|
||||
<a name="2.2.13"></a>
|
||||
## [2.2.13](https://github.com/driftyco/ionic-native/compare/v2.2.12...v2.2.13) (2016-12-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **admob:** add adId prop to AdMobOptions ([d5dfdf8](https://github.com/driftyco/ionic-native/commit/d5dfdf8))
|
||||
* **background-mode:** isEnabled and isActive return booleans ([ba77fd7](https://github.com/driftyco/ionic-native/commit/ba77fd7)), closes [#908](https://github.com/driftyco/ionic-native/issues/908)
|
||||
* **diagnostic:** add missing types ([1841220](https://github.com/driftyco/ionic-native/commit/1841220)), closes [#905](https://github.com/driftyco/ionic-native/issues/905)
|
||||
* **diagnostic:** add permissionStatus types ([#890](https://github.com/driftyco/ionic-native/issues/890)) ([3385c1b](https://github.com/driftyco/ionic-native/commit/3385c1b))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **android-fingerprint-auth:** update to v1.2.1 ([#910](https://github.com/driftyco/ionic-native/issues/910)) ([a1b0f88](https://github.com/driftyco/ionic-native/commit/a1b0f88))
|
||||
* **nfc:** add new functions ([#853](https://github.com/driftyco/ionic-native/issues/853)) ([c44fb75](https://github.com/driftyco/ionic-native/commit/c44fb75))
|
||||
* **onesignal:** improve typings ([#888](https://github.com/driftyco/ionic-native/issues/888)) ([56e8eae](https://github.com/driftyco/ionic-native/commit/56e8eae))
|
||||
* **sim:** add new methods ([#894](https://github.com/driftyco/ionic-native/issues/894)) ([0c36988](https://github.com/driftyco/ionic-native/commit/0c36988))
|
||||
|
||||
|
||||
|
||||
<a name="2.2.12"></a>
|
||||
## [2.2.12](https://github.com/driftyco/ionic-native/compare/v2.2.11...v2.2.12) (2016-12-16)
|
||||
|
||||
|
||||
33
package.json
33
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ionic-native",
|
||||
"version": "2.2.12",
|
||||
"version": "2.2.15",
|
||||
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
|
||||
"main": "dist/es5/index.js",
|
||||
"module": "dist/esm/index.js",
|
||||
@@ -9,40 +9,40 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"rxjs": "^5.0.0-beta.6"
|
||||
"rxjs": "5.0.0-beta.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browserify": "^13.0.1",
|
||||
"browserify": "^13.3.0",
|
||||
"canonical-path": "0.0.2",
|
||||
"conventional-changelog-cli": "^1.2.0",
|
||||
"conventional-github-releaser": "^1.1.3",
|
||||
"cpr": "^1.0.0",
|
||||
"cz-conventional-changelog": "^1.1.6",
|
||||
"cpr": "^2.0.2",
|
||||
"cz-conventional-changelog": "^1.2.0",
|
||||
"decamelize": "^1.2.0",
|
||||
"dgeni": "^0.4.2",
|
||||
"dgeni-packages": "^0.10.18",
|
||||
"es6-shim": "~0.35.1",
|
||||
"glob": "^6.0.4",
|
||||
"es6-shim": "~0.35.2",
|
||||
"glob": "^7.1.1",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-rename": "^1.2.2",
|
||||
"gulp-replace": "^0.5.4",
|
||||
"gulp-tslint": "^6.1.2",
|
||||
"gulp-uglify": "^1.5.4",
|
||||
"jasmine-core": "~2.5.0",
|
||||
"karma": "~1.2.0",
|
||||
"gulp-uglify": "^2.0.0",
|
||||
"jasmine-core": "~2.5.2",
|
||||
"karma": "~1.3.0",
|
||||
"karma-browserify": "~5.1.0",
|
||||
"karma-jasmine": "~1.0.2",
|
||||
"karma-jasmine": "~1.1.0",
|
||||
"karma-phantomjs-launcher": "~1.0.2",
|
||||
"lodash": "3.10.1",
|
||||
"lodash": "4.17.4",
|
||||
"minimist": "^1.1.3",
|
||||
"mkdirp": "^0.5.1",
|
||||
"node-html-encoder": "0.0.2",
|
||||
"q": "1.4.1",
|
||||
"semver": "^5.0.1",
|
||||
"tsify": "~1.0.4",
|
||||
"semver": "^5.3.0",
|
||||
"tsify": "~3.0.0",
|
||||
"tslint": "^3.15.1",
|
||||
"tslint-ionic-rules": "0.0.5",
|
||||
"typescript": "^2.0.1",
|
||||
"tslint-ionic-rules": "0.0.7",
|
||||
"typescript": "~2.0.10",
|
||||
"watchify": "~3.7.0"
|
||||
},
|
||||
"scripts": {
|
||||
@@ -50,7 +50,6 @@
|
||||
"test:watch": "npm test -- --watch",
|
||||
"start": "npm run test:watch",
|
||||
"lint": "gulp lint",
|
||||
"watch": "tsc -w",
|
||||
"build": "npm run lint && npm run build:js && npm run build:esm && npm run build:bundle && npm run build:minify",
|
||||
"build:js": "tsc -p tsconfig-es5.json",
|
||||
"build:esm": "tsc -p tsconfig-esm.json",
|
||||
|
||||
@@ -76,7 +76,7 @@ module.exports = function(currentVersion) {
|
||||
|
||||
versions = [];
|
||||
// new version, add it to the versions list
|
||||
if (currentVersion != 'nightly' && !_.contains(versions, currentVersion)) {
|
||||
if (currentVersion != 'nightly' && !_.includes(versions, currentVersion)) {
|
||||
versions.unshift(currentVersion);
|
||||
}
|
||||
//First semver valid version is latest
|
||||
|
||||
@@ -30,7 +30,7 @@ function run {
|
||||
git pull origin master
|
||||
fi
|
||||
|
||||
git rm -rf content/docs/v2/native/*/
|
||||
git rm -rf content/docs/v2/native/*/ || true
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,9 @@ module.exports = function jekyll(renderDocsProcessor) {
|
||||
doc.outputPath = doc.outputPath.toLowerCase().replace(' ', '-');
|
||||
docs[i].URL = doc.outputPath.replace('docs/v2//', 'docs/v2/')
|
||||
.replace('/index.md', '')
|
||||
.replace('content/','');
|
||||
.replace('content/', '');
|
||||
|
||||
docs[i].demo = !!docs[i].demo;
|
||||
});
|
||||
|
||||
docs.push({
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
module.exports = [
|
||||
{'name': 'advanced'},
|
||||
{'name': 'demo'},
|
||||
{'name': 'beta', transforms: function(doc, tag, value) {
|
||||
// make the value true or undefined instead of '' or undefined
|
||||
return typeof value !== 'undefined';
|
||||
}},
|
||||
{'name': 'usage'},
|
||||
{'name': 'classes'}, // related classes
|
||||
{'name': 'interfaces'} // related interfaces
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
<@ for doc in docs @><@ if doc.URL and doc.private != true @>
|
||||
<@ for doc in docs @><@ if doc.URL and doc.private != true and doc.beta != true @>
|
||||
<li class="capitalize {% if page.id == '<$ doc.name|lower|replace(' ','-') $>' %}active{% endif %}">
|
||||
<a href="/<$ doc.URL $>"><$ doc.name $></a>
|
||||
</li><@ endif @><@ endfor @>
|
||||
|
||||
<@ for doc in docs @><@ if doc.URL and doc.private != true and doc.beta == true @>
|
||||
<li class="capitalize {% if page.id == '<$ doc.name|lower|replace(' ','-') $>' %}active{% endif %}">
|
||||
<a href="/<$ doc.URL $>"><$ doc.name $> <span class="beta">β</span></a>
|
||||
</li><@ endif @><@ endfor @>
|
||||
|
||||
@@ -5,6 +5,11 @@ export type AdMobAdSize = 'SMART_BANNER' | 'BANNER' | 'MEDIUM_RECTANGLE' | 'FULL
|
||||
|
||||
export interface AdMobOptions {
|
||||
|
||||
/**
|
||||
* Banner ad ID
|
||||
*/
|
||||
adId?: string;
|
||||
|
||||
/**
|
||||
* Banner Ad Size, defaults to `SMART_BANNER`. IT can be: `SMART_BANNER`, `BANNER`, `MEDIUM_RECTANGLE`, `FULL_BANNER`, `LEADERBOARD`, `SKYSCRAPER`, or `CUSTOM`
|
||||
*/
|
||||
|
||||
@@ -3,14 +3,26 @@ import { Cordova, Plugin } from './plugin';
|
||||
export interface AndroidFingerprintAuthOptions {
|
||||
|
||||
/**
|
||||
* Required
|
||||
* Used as the alias for your key in the Android Key Store.
|
||||
*/
|
||||
clientId: string;
|
||||
|
||||
/**
|
||||
* Used to encrypt the token returned upon successful fingerprint authentication.
|
||||
* Used to create credential string for encrypted token and as alias to retrieve the cipher.
|
||||
*/
|
||||
clientSecret: string;
|
||||
username?: string;
|
||||
|
||||
/**
|
||||
* Used to create credential string for encrypted token
|
||||
*/
|
||||
password?: string;
|
||||
|
||||
/**
|
||||
* Required for decrypt()
|
||||
* Encrypted user credentials to decrypt upon successful authentication.
|
||||
*/
|
||||
token?: string;
|
||||
|
||||
/**
|
||||
* Set to true to remove the "USE BACKUP" button
|
||||
@@ -22,6 +34,33 @@ export interface AndroidFingerprintAuthOptions {
|
||||
*/
|
||||
locale?: string;
|
||||
|
||||
/**
|
||||
* The device max is 5 attempts. Set this parameter if you want to allow fewer than 5 attempts.
|
||||
*/
|
||||
maxAttempts?: number;
|
||||
|
||||
/**
|
||||
* Require the user to authenticate with a fingerprint to authorize every use of the key.
|
||||
* New fingerprint enrollment will invalidate key and require backup authenticate to
|
||||
* re-enable the fingerprint authentication dialog.
|
||||
*/
|
||||
userAuthRequired?: boolean;
|
||||
|
||||
/**
|
||||
* Set the title of the fingerprint authentication dialog.
|
||||
*/
|
||||
dialogTitle?: string;
|
||||
|
||||
/**
|
||||
* Set the message of the fingerprint authentication dialog.
|
||||
*/
|
||||
dialogMessage?: string;
|
||||
|
||||
/**
|
||||
* Set the hint displayed by the fingerprint icon on the fingerprint authentication dialog.
|
||||
*/
|
||||
dialogHint?: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,15 +76,20 @@ export interface AndroidFingerprintAuthOptions {
|
||||
* if(result.isAvailable){
|
||||
* // it is available
|
||||
*
|
||||
* AndroidFingerprintAuth.show({ clientId: "myAppName", clientSecret: "so_encrypted_much_secure_very_secret" })
|
||||
* AndroidFingerprintAuth.encrypt({ clientId: "myAppName", username: "myUsername", password: "myPassword" })
|
||||
* .then(result => {
|
||||
* if(result.withFingerprint) {
|
||||
* console.log('Successfully authenticated with fingerprint!');
|
||||
* } else if(result.withPassword) {
|
||||
* if (result.withFingerprint) {
|
||||
* console.log("Successfully encrypted credentials.");
|
||||
* console.log("Encrypted credentials: " + result.token);
|
||||
* } else if (result.withBackup) {
|
||||
* console.log('Successfully authenticated with backup password!');
|
||||
* } else console.log('Didn\'t authenticate!');
|
||||
* })
|
||||
* .catch(error => console.error(error));
|
||||
* .catch(error => {
|
||||
* if (error === "Cancelled") {
|
||||
* console.log("Fingerprint authentication cancelled");
|
||||
* } else console.error(error)
|
||||
* });
|
||||
*
|
||||
* } else {
|
||||
* // fingerprint auth isn't available
|
||||
@@ -70,15 +114,41 @@ export class AndroidFingerprintAuth {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static show(options: AndroidFingerprintAuthOptions): Promise<{
|
||||
static encrypt(options: AndroidFingerprintAuthOptions): Promise<{
|
||||
/**
|
||||
* Base64 encoded string
|
||||
* Biometric authentication
|
||||
*/
|
||||
withFingerprint: string;
|
||||
withFingerprint: boolean;
|
||||
/**
|
||||
*
|
||||
* Authentication using backup credential activity
|
||||
*/
|
||||
withPassword: boolean;
|
||||
withBackup: boolean;
|
||||
/**
|
||||
* base64encoded string representation of user credentials
|
||||
*/
|
||||
token: string;
|
||||
}> {return; }
|
||||
|
||||
/**
|
||||
* Opens a native dialog fragment to use the device hardware fingerprint scanner to authenticate against fingerprints registered for the device.
|
||||
* @param options {AndroidFingerprintAuthOptions} Options
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static decrypt(options: AndroidFingerprintAuthOptions): Promise<{
|
||||
/**
|
||||
* Biometric authentication
|
||||
*/
|
||||
withFingerprint: boolean;
|
||||
/**
|
||||
* Authentication using backup credential activity
|
||||
*/
|
||||
withBackup: boolean;
|
||||
/**
|
||||
* FingerprintAuth.CipherMode.DECRYPT
|
||||
* Decrypted password
|
||||
*/
|
||||
password: string;
|
||||
}> {return; }
|
||||
|
||||
/**
|
||||
@@ -86,6 +156,12 @@ export class AndroidFingerprintAuth {
|
||||
* @returns {Promise<any>} Returns a Promise that resolves if fingerprint auth is available on the device
|
||||
*/
|
||||
@Cordova()
|
||||
static isAvailable(): Promise<{isAvailable: boolean}> {return; }
|
||||
static isAvailable(): Promise<{isAvailable: boolean}> { return; }
|
||||
|
||||
/**
|
||||
* Delete the cipher used for encryption and decryption by username
|
||||
* @returns {Promise<any>} Returns a Promise that resolves if the cipher was successfully deleted
|
||||
*/
|
||||
@Cordova()
|
||||
static delete(options: {clientId: string; username: string; }): Promise<{deleted: boolean}> { return; }
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import { Cordova, Plugin } from './plugin';
|
||||
*
|
||||
* if (Device.platform === 'iOS') {
|
||||
* app = 'twitter://';
|
||||
* } else if (device.platform === 'Android') {
|
||||
* } else if (Device.platform === 'Android') {
|
||||
* app = 'com.twitter.android';
|
||||
* }
|
||||
*
|
||||
|
||||
@@ -47,7 +47,7 @@ export interface AppRatePreferences {
|
||||
/**
|
||||
* App Store URLS
|
||||
*/
|
||||
storeAppUrl?: AppRateStoreAppUrls;
|
||||
storeAppURL?: AppRateStoreAppUrls;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,11 @@ export interface BackgroundGeolocationResponse {
|
||||
*/
|
||||
altitude: number;
|
||||
|
||||
/**
|
||||
* accuracy of the altitude if available.
|
||||
*/
|
||||
altitudeAccuracy: number;
|
||||
|
||||
/**
|
||||
* bearing, in degrees.
|
||||
*/
|
||||
|
||||
@@ -76,17 +76,21 @@ export class BackgroundMode {
|
||||
|
||||
/**
|
||||
* Checks if background mode is enabled or not.
|
||||
* @returns {Promise<boolean>} returns a promise that resolves with boolean that indicates if the background mode is enabled.
|
||||
* @returns {boolean} returns a boolean that indicates if the background mode is enabled.
|
||||
*/
|
||||
@Cordova()
|
||||
static isEnabled(): Promise<boolean> { return; }
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static isEnabled(): boolean { return; }
|
||||
|
||||
/**
|
||||
* Can be used to get the information if the background mode is active.
|
||||
* @returns {Promise<boolean>} returns a promise that resolves with boolean that indicates if the background mode is active.
|
||||
* @returns {boolean} returns a boolean that indicates if the background mode is active.
|
||||
*/
|
||||
@Cordova()
|
||||
static isActive(): Promise<boolean> { return; }
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static isActive(): boolean { return; }
|
||||
|
||||
/**
|
||||
* Override the default title, ticker and text.
|
||||
|
||||
@@ -205,7 +205,7 @@ export class BLE {
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopScan',
|
||||
clearWithArgs: true
|
||||
clearWithArgs: false
|
||||
})
|
||||
static startScan(services: string[]): Observable<any> { return; }
|
||||
|
||||
@@ -218,7 +218,7 @@ export class BLE {
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopScan',
|
||||
clearWithArgs: true
|
||||
clearWithArgs: false
|
||||
})
|
||||
static startScanWithOptions(services: string[], options: {reportDuplicates?: boolean} | any): Observable<any> { return; }
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ export interface CameraPreviewSize {
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name CameraPreview
|
||||
* @description
|
||||
* Showing camera preview in HTML
|
||||
|
||||
@@ -66,12 +66,12 @@ export class Diagnostic {
|
||||
|
||||
@CordovaProperty
|
||||
static permissionStatus: {
|
||||
GRANTED;
|
||||
DENIED;
|
||||
NOT_REQUESTED;
|
||||
DENIED_ALWAYS;
|
||||
RESTRICTED;
|
||||
GRANTED_WHEN_IN_USE;
|
||||
GRANTED: string;
|
||||
DENIED: string;
|
||||
NOT_REQUESTED: string;
|
||||
DENIED_ALWAYS: string;
|
||||
RESTRICTED: string;
|
||||
GRANTED_WHEN_IN_USE: string;
|
||||
};
|
||||
|
||||
static locationAuthorizationMode = {
|
||||
|
||||
@@ -24,6 +24,7 @@ export interface EmailComposerOptions {
|
||||
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name Email Composer
|
||||
* @description
|
||||
*
|
||||
|
||||
@@ -14,7 +14,8 @@ import { Cordova, Plugin } from './plugin';
|
||||
pluginName: 'Globalization',
|
||||
plugin: 'cordova-plugin-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']
|
||||
})
|
||||
export class Globalization {
|
||||
|
||||
|
||||
@@ -7,6 +7,9 @@ import { Cordova, Plugin } from './plugin';
|
||||
* ```typescript
|
||||
* import { GooglePlus } from 'ionic-native';
|
||||
*
|
||||
* GooglePlus.login()
|
||||
* .then(res => console.log(res))
|
||||
* .catch(err => console.error(err));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@@ -25,7 +28,10 @@ export class GooglePlus {
|
||||
* @param options
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
static login(options?: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,6 +10,20 @@ declare var window;
|
||||
* - A Cordova 3.0+ project for iOS and/or Android
|
||||
* - A Mobile App property through the Google Analytics Admin Console
|
||||
* - (Android) Google Play Services SDK installed via [Android SDK Manager](https://developer.android.com/sdk/installing/adding-packages.html)
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { GoogleAnalytics } from 'ionic-native';
|
||||
*
|
||||
* GoogleAnalytics.startTrackerWithId('YOUR_TRACKER_ID')
|
||||
* .then(() => {
|
||||
* console.log('Google analytics is ready now');
|
||||
* // Tracker is ready
|
||||
* // You can now track pages or set additional information such as AppVersion or UserId
|
||||
* })
|
||||
* .catch(e => console.log('Error starting GoogleAnalytics', e));
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'GoogleAnalytics',
|
||||
@@ -27,7 +41,10 @@ export class GoogleAnalytics {
|
||||
* @param {number} interval Optional dispatch period in seconds. Defaults to 30.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
static startTrackerWithId(id: string, interval?: number): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
|
||||
@@ -103,6 +103,7 @@ export interface HotspotDevice {
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name Hotspot
|
||||
* @description
|
||||
* @usage
|
||||
|
||||
@@ -237,7 +237,7 @@ export interface IBeaconDelegate {
|
||||
* // Request permission to use location on iOS
|
||||
* IBeacon.requestAlwaysAuthorization();
|
||||
* // create a new delegate and register it with the native layer
|
||||
* let delegate = IBeacon.IBeaconDelegate();
|
||||
* let delegate = IBeacon.Delegate();
|
||||
*
|
||||
* // Subscribe to some of the delegate's event handlers
|
||||
* delegate.didRangeBeaconsInRegion()
|
||||
|
||||
@@ -81,7 +81,7 @@ export class InAppBrowser {
|
||||
|
||||
/**
|
||||
* Injects JavaScript code into the InAppBrowser window.
|
||||
* @param script Details of the script to run, specifying either a file or code key.
|
||||
* @param script {Object} Details of the script to run, specifying either a file or code key.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@CordovaInstance()
|
||||
@@ -89,11 +89,11 @@ export class InAppBrowser {
|
||||
|
||||
/**
|
||||
* Injects CSS into the InAppBrowser window.
|
||||
* @param {Object} Details of the script to run, specifying either a file or code key.
|
||||
* @param css {Object} Details of the script to run, specifying either a file or code key.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@CordovaInstance()
|
||||
insertCss(css: {file?: string, code?: string}): Promise<any> {return; }
|
||||
insertCSS(css: {file?: string, code?: string}): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* A method that allows you to listen to events happening in the browser.
|
||||
|
||||
@@ -19,12 +19,30 @@ import { Plugin, Cordova } from './plugin';
|
||||
repo: 'https://github.com/xmartlabs/cordova-plugin-market'
|
||||
})
|
||||
export class Market {
|
||||
|
||||
/**
|
||||
* Opens an app in Google Play / App Store
|
||||
* @param appId {string} Package name
|
||||
* @param callbacks {Object} Optional callbacks in the format {success?: Function, failure?: Function}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static open(appId: string, callbacks?: {success?: Function, failure?: Function}): void { }
|
||||
@Cordova({
|
||||
callbackStyle: 'object',
|
||||
successName: 'success',
|
||||
errorName: 'failure'
|
||||
})
|
||||
static open(appId: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Search apps by keyword
|
||||
* @param keyword {string} Keyword
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackStyle: 'object',
|
||||
successName: 'success',
|
||||
errorName: 'failure',
|
||||
platforms: ['Android']
|
||||
})
|
||||
static search(keyword: string): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,11 @@ export interface MediaError {
|
||||
*
|
||||
*
|
||||
* // Create a MediaPlugin instance. Expects path to file or url as argument
|
||||
* var file = new MediaPlugin('path/to/file.mp3');
|
||||
* // We can optionally pass a second argument to track the status of the media
|
||||
*
|
||||
* const onStatusUpdate = (status) => console.log(status);
|
||||
*
|
||||
* const file = new MediaPlugin('path/to/file.mp3', onStatusUpdate);
|
||||
*
|
||||
* // Catch the Success & Error Output
|
||||
* // Platform Quirks
|
||||
|
||||
@@ -85,7 +85,10 @@ export class Mixpanel {
|
||||
* @param eventProperties {any} optional
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
static track(eventName: string, eventProperties?: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,7 +40,7 @@ declare var navigator: any;
|
||||
*
|
||||
* ```
|
||||
* @advanced
|
||||
* The `connection` property will return one of the following connection types: `unknown`, `ethernet`, `wifi`, `2g`, `3g`, `4g`, `cellular`, `none`
|
||||
* The `type` property will return one of the following connection types: `unknown`, `ethernet`, `wifi`, `2g`, `3g`, `4g`, `cellular`, `none`
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Network',
|
||||
|
||||
@@ -47,6 +47,21 @@ export class NFC {
|
||||
|
||||
/**
|
||||
* Registers an event listener for tags matching any tag type.
|
||||
* @param onSuccess
|
||||
* @param onFailure
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
successIndex: 0,
|
||||
errorIndex: 3,
|
||||
clearFunction: 'removeTagDiscoveredListener',
|
||||
clearWithArgs: true
|
||||
})
|
||||
static addTagDiscoveredListener(onSuccess?: Function, onFailure?: Function): Observable<any> {return; }
|
||||
|
||||
/**
|
||||
* Registers an event listener for NDEF tags matching a specified MIME type.
|
||||
* @param mimeType
|
||||
* @param onSuccess
|
||||
* @param onFailure
|
||||
@@ -56,25 +71,10 @@ export class NFC {
|
||||
observable: true,
|
||||
successIndex: 1,
|
||||
errorIndex: 4,
|
||||
clearFunction: 'removeTagDiscoveredListener',
|
||||
clearWithArgs: true
|
||||
})
|
||||
static addTagDiscoveredListener(mimeType: string, onSuccess?: Function, onFailure?: Function): Observable<any> {return; }
|
||||
|
||||
/**
|
||||
* Registers an event listener for NDEF tags matching a specified MIME type.
|
||||
* @param onSuccess
|
||||
* @param onFailure
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
successIndex: 0,
|
||||
errorIndex: 3,
|
||||
clearFunction: 'removeMimeTypeListener',
|
||||
clearWithArgs: true
|
||||
})
|
||||
static addMimeTypeListener(onSuccess?: Function, onFailure?: Function): Observable<any> {return; }
|
||||
static addMimeTypeListener(mimeType: string, onSuccess?: Function, onFailure?: Function): Observable<any> {return; }
|
||||
|
||||
/**
|
||||
* Registers an event listener for formatable NDEF tags.
|
||||
@@ -152,6 +152,27 @@ export class NFC {
|
||||
*/
|
||||
@Cordova()
|
||||
static enabled(): Promise<any> {return; }
|
||||
/**
|
||||
* Convert bytes to string
|
||||
* @param bytes {number[]}
|
||||
* @returns {string}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static bytesToString(bytes: number[]): string {return; }
|
||||
/**
|
||||
* Convert string to bytes
|
||||
* @param str {string}
|
||||
* @returns {string}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static stringToBytes(str: string): number[] {return; };
|
||||
/**
|
||||
* Convert bytes to hex string
|
||||
* @param bytes {number[]}
|
||||
* @returns {string}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static bytesToHexString(bytes: number[]): string {return; };
|
||||
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,32 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface OneSignalNotification {
|
||||
app_id: string;
|
||||
export interface OSNotification {
|
||||
/**
|
||||
* Was app in focus.
|
||||
*/
|
||||
isAppInFocus: boolean;
|
||||
/**
|
||||
* Was notification shown to the user. Will be false for silent notifications.
|
||||
*/
|
||||
shown: boolean;
|
||||
/**
|
||||
* **ANDROID** - Android Notification assigned to the notification. Can be used to cancel or replace the notification.
|
||||
*/
|
||||
androidNotificationId?: number;
|
||||
/**
|
||||
* Payload received from OneSignal.
|
||||
*/
|
||||
payload: OSNotificationPayload;
|
||||
/**
|
||||
* How the notification was displayed to the user. Can be set to `Notification`, `InAppAlert`, or `None` if it was not displayed.
|
||||
*/
|
||||
displayType: OSDisplayType;
|
||||
/**
|
||||
* **ANDROID** - Notification is a summary notification for a group this will contain all notification payloads it was created from.
|
||||
*/
|
||||
groupedNotifications?: OSNotificationPayload[];
|
||||
app_id?: string;
|
||||
contents: any;
|
||||
headings?: any;
|
||||
isIos?: boolean;
|
||||
@@ -64,6 +88,177 @@ export interface OneSignalNotification {
|
||||
ios_category?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* **ANDROID** - Privacy setting for how the notification should be shown on the lockscreen of Android 5+ devices.
|
||||
*/
|
||||
export enum OSLockScreenVisibility {
|
||||
/**
|
||||
* Fully visible (default)
|
||||
*/
|
||||
Public = 1,
|
||||
/**
|
||||
* Contents are hidden
|
||||
*/
|
||||
Private = 0,
|
||||
/**
|
||||
* Not shown
|
||||
*/
|
||||
Secret = -1
|
||||
}
|
||||
|
||||
/**
|
||||
* How the notification was displayed to the user. Part of OSNotification. See inFocusDisplaying for more information on how this is used.
|
||||
*/
|
||||
export enum OSDisplayType {
|
||||
/**
|
||||
* notification is silent, or inFocusDisplaying is disabled.
|
||||
*/
|
||||
None = 0,
|
||||
/**
|
||||
* (**DEFAULT**) - native alert dialog display.
|
||||
*/
|
||||
InAppAlert = 1,
|
||||
/**
|
||||
* native notification display.
|
||||
*/
|
||||
Notification = 2
|
||||
}
|
||||
|
||||
/**
|
||||
* Contents and settings of the notification the user received.
|
||||
*/
|
||||
export interface OSNotificationPayload {
|
||||
/**
|
||||
* OneSignal notification UUID.
|
||||
*/
|
||||
notificationID: string;
|
||||
/**
|
||||
* Title of the notification.
|
||||
*/
|
||||
title: string;
|
||||
/**
|
||||
* Body of the notification.
|
||||
*/
|
||||
body: string;
|
||||
/**
|
||||
* Custom additional data that was sent with the notification. Set on the dashboard under Options > Additional Data
|
||||
* or with the 'data' field on the REST API.
|
||||
*/
|
||||
additionalData?: any;
|
||||
/**
|
||||
* **ANDROID** - Small icon resource name set on the notification.
|
||||
*/
|
||||
smallIcon?: string;
|
||||
/**
|
||||
* **ANDROID** - Large icon set on the notification.
|
||||
*/
|
||||
largeIcon?: string;
|
||||
/**
|
||||
* **ANDROID** - Big picture image set on the notification.
|
||||
*/
|
||||
bigPicture?: string;
|
||||
/**
|
||||
* **ANDROID** - Accent color shown around small notification icon on Android 5+ devices. ARGB format.
|
||||
*/
|
||||
smallIconAccentColor?: string;
|
||||
/**
|
||||
* URL to open when opening the notification.
|
||||
*/
|
||||
launchUrl?: string;
|
||||
/**
|
||||
* Sound resource to play when the notification is shown.
|
||||
*/
|
||||
sound: string;
|
||||
/**
|
||||
* **ANDROID** - Devices that have a notification LED will blink in this color. ARGB format.
|
||||
*/
|
||||
ledColor?: string;
|
||||
lockScreenVisibility?: OSLockScreenVisibility;
|
||||
/**
|
||||
* **ANDROID** - Notifications with this same key will be grouped together as a single summary notification.
|
||||
*/
|
||||
groupKey?: string;
|
||||
/**
|
||||
* **ANDROID** - Summary text displayed in the summary notification.
|
||||
*/
|
||||
groupMessage?: string;
|
||||
/**
|
||||
* List of action buttons on the notification.
|
||||
*/
|
||||
actionButtons: OSActionButton[];
|
||||
/**
|
||||
* **ANDROID** - The Google project number the notification was sent under.
|
||||
*/
|
||||
fromProjectNumber?: string;
|
||||
/**
|
||||
* **ANDROID** - If a background image was set this object will be available.
|
||||
*/
|
||||
backgroundImageLayout?: OSBackgroundImageLayout;
|
||||
priority?: number;
|
||||
/**
|
||||
* List of action buttons on the notification.
|
||||
*/
|
||||
rawPayload: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of action buttons on the notification.
|
||||
*/
|
||||
export interface OSActionButton {
|
||||
/**
|
||||
* Id assigned to the button.
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Text show on the button to the user.
|
||||
*/
|
||||
text: string;
|
||||
/**
|
||||
* **ANDROID** - Icon shown on the button.
|
||||
*/
|
||||
icon: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* **ANDROID** - If a background image was set, this object will be available.
|
||||
*/
|
||||
export interface OSBackgroundImageLayout {
|
||||
/**
|
||||
* Image URL or name used as the background image.
|
||||
*/
|
||||
image: string;
|
||||
/**
|
||||
* Text color of the title on the notification. ARGB Format.
|
||||
*/
|
||||
titleTextColor: string;
|
||||
/**
|
||||
* Text color of the body on the notification. ARGB Format.
|
||||
*/
|
||||
bodyTextColor: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The information returned from a notification the user received.
|
||||
*/
|
||||
export interface OSNotificationOpenedResult {
|
||||
action: {
|
||||
/**
|
||||
* Was the notification opened normally (`Opened`) or was a button pressed on the notification (`ActionTaken`).
|
||||
*/
|
||||
type: OSActionType;
|
||||
/**
|
||||
* If `type` == `ActionTaken` then this will contain the id of the button pressed.
|
||||
*/
|
||||
actionID?: string;
|
||||
};
|
||||
notification: OSNotification;
|
||||
}
|
||||
|
||||
export enum OSActionType {
|
||||
Opened = 0,
|
||||
ActionTake = 1
|
||||
}
|
||||
|
||||
/**
|
||||
* @name OneSignal
|
||||
* @description
|
||||
@@ -91,13 +286,21 @@ export interface OneSignalNotification {
|
||||
* OneSignal.endInit();
|
||||
* ```
|
||||
* @interfaces
|
||||
* OneSignalNotification
|
||||
* OSNotification
|
||||
* OSLockScreenVisibility
|
||||
* OSDisplayType
|
||||
* OSNotificationPayload
|
||||
* OSActionButton
|
||||
* OSBackgroundImageLayout
|
||||
* OSNotificationOpenedResult
|
||||
* OSActionType
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'OneSignal',
|
||||
plugin: 'onesignal-cordova-plugin',
|
||||
pluginRef: 'plugins.OneSignal',
|
||||
repo: 'https://github.com/OneSignal/OneSignal-Cordova-SDK'
|
||||
repo: 'https://github.com/OneSignal/OneSignal-Cordova-SDK',
|
||||
platforms: ['Android', 'iOS', 'Windows', 'FireOS']
|
||||
})
|
||||
export class OneSignal {
|
||||
|
||||
@@ -111,45 +314,57 @@ export class OneSignal {
|
||||
};
|
||||
|
||||
/**
|
||||
* Start the initialization process. Once you are done configuring OneSignal, call the endInit function.
|
||||
* Start the initialization process. Once you are done configuring OneSignal, call the `endInit` function.
|
||||
*
|
||||
* @param {string} appId Your AppId from your OneSignal app
|
||||
* @param {string} googleProjectNumber The Google Project Number (which you can get from the Google Developer Portal) and the autoRegister option.
|
||||
* @param {string} appId Your OneSignal app id
|
||||
* @param {string} googleProjectNumber **ANDROID** - your Google project number; only required for Android GCM/FCM pushes.
|
||||
* @returns {any}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static startInit(appId: string, googleProjectNumber: string): any { return; }
|
||||
static startInit(appId: string, googleProjectNumber?: string): any { return; }
|
||||
|
||||
/**
|
||||
* Callback to run when a notification is received
|
||||
* @return {Observable<any>}
|
||||
* Callback to run when a notification is received, whether it was displayed or not.
|
||||
*
|
||||
* @return {Observable<OneSignalReceivedNotification>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static handleNotificationReceived(): Observable<any> { return; }
|
||||
static handleNotificationReceived(): Observable<OSNotification> { return; }
|
||||
|
||||
/**
|
||||
* Callback to run when a notification is opened
|
||||
* @return {Observable<any>}
|
||||
* Callback to run when a notification is tapped on from the notification shade (**ANDROID**) or notification
|
||||
* center (**iOS**), or when closing an Alert notification shown in the app (if InAppAlert is enabled in
|
||||
* inFocusDisplaying).
|
||||
*
|
||||
* @return {Observable<OneSignalOpenedNotification>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static handleNotificationOpened(): Observable<any> { return; }
|
||||
static handleNotificationOpened(): Observable<OSNotificationOpenedResult> { return; }
|
||||
|
||||
/**
|
||||
* **iOS** - Settings for iOS apps
|
||||
*
|
||||
* @param settings
|
||||
* kOSSettingsKeyAutoPrompt: boolean = true
|
||||
* Auto prompt user for notification permissions.
|
||||
*
|
||||
* kOSSettingsKeyInAppLaunchURL: boolean = false
|
||||
* Launch notifications with a launch URL as an in app webview.
|
||||
* @returns {any}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static iOSSettings(settings: {
|
||||
kOSSettingsKeyInAppLaunchURL: boolean;
|
||||
kOSSettingsKeyAutoPrompt: boolean;
|
||||
kOSSettingsKeyInAppLaunchURL: boolean;
|
||||
}): any { return; }
|
||||
|
||||
/**
|
||||
* Must be called after `startInit` to complete initialization of OneSignal.
|
||||
*
|
||||
* @returns {any}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
@@ -167,11 +382,14 @@ export class OneSignal {
|
||||
* Lets you retrieve the OneSignal user id and device token.
|
||||
* Your handler is called after the device is successfully registered with OneSignal.
|
||||
*
|
||||
* @returns {Promise<any>} Returns a Promise that reolves if the device was successfully registered.
|
||||
* It returns a JSON with `userId`and `pushToken`.
|
||||
* @returns {Promise<Object>} Returns a Promise that resolves if the device was successfully registered.
|
||||
*
|
||||
* userId {string} OneSignal userId is a UUID formatted string. (unique per device per app)
|
||||
*
|
||||
* pushToken {string} A push token is a Google/Apple assigned identifier(unique per device per app).
|
||||
*/
|
||||
@Cordova()
|
||||
static getIds(): Promise<any> { return; }
|
||||
static getIds(): Promise<{userId: string; pushToken: string}> { return; }
|
||||
|
||||
|
||||
/**
|
||||
@@ -211,7 +429,7 @@ export class OneSignal {
|
||||
|
||||
/**
|
||||
* Call this when you would like to prompt an iOS user to accept push notifications with the default system prompt.
|
||||
* Only use if you passed false to autoRegister when calling init.
|
||||
* Only works if you set `kOSSettingsAutoPrompt` to `false` in `iOSSettings`
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static registerForPushNotifications(): void { }
|
||||
@@ -244,10 +462,11 @@ export class OneSignal {
|
||||
*
|
||||
* Setting to control how OneSignal notifications will be shown when one is received while your app is in focus. By default this is set to inAppAlert, which can be helpful during development.
|
||||
*
|
||||
* @param {number} displayOption Options are 0 = None, 1 = InAppAlert, and 2 = Notification.
|
||||
* @param {DisplayType} displayOption
|
||||
* @returns {any}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static inFocusDisplaying(displayOption: number): void { }
|
||||
static inFocusDisplaying(displayOption: OSDisplayType): any { return; }
|
||||
|
||||
/**
|
||||
* You can call this method with false to opt users out of receiving all notifications through OneSignal.
|
||||
@@ -264,7 +483,7 @@ export class OneSignal {
|
||||
* @returns {Promise<any>} Returns a Promise that resolves if the notification was send successfully.
|
||||
*/
|
||||
@Cordova()
|
||||
static postNotification(notificationObj: OneSignalNotification): Promise<any> { return; }
|
||||
static postNotification(notificationObj: OSNotification): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Prompts the user for location permission to allow geotagging based on the "Location radius" filter on the OneSignal dashboard.
|
||||
|
||||
@@ -108,7 +108,7 @@ function callCordovaPlugin(pluginObj: any, methodName: string, args: any[], opts
|
||||
|
||||
let pluginInstance = getPlugin(pluginObj.pluginRef);
|
||||
|
||||
if (!pluginInstance) {
|
||||
if (!pluginInstance || !pluginInstance.hasOwnProperty(methodName)) {
|
||||
// Do this check in here in the case that the Web API for this plugin is available (for example, Geolocation).
|
||||
if (!window.cordova) {
|
||||
cordovaWarn(pluginObj.pluginName, methodName);
|
||||
@@ -123,8 +123,7 @@ function callCordovaPlugin(pluginObj: any, methodName: string, args: any[], opts
|
||||
};
|
||||
}
|
||||
|
||||
// TODO: Illegal invocation needs window context
|
||||
return get(window, pluginObj.pluginRef)[methodName].apply(pluginInstance, args);
|
||||
return pluginInstance[methodName].apply(pluginInstance, args);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -36,7 +36,7 @@ export interface NotificationEventResponse {
|
||||
/**
|
||||
* An optional collection of data sent by the 3rd party push service that does not fit in the above properties.
|
||||
*/
|
||||
additionalData: NotificationEventAdditionalData;
|
||||
additionalData: NotificationEventAdditionalData | any;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,6 +17,15 @@ import { Cordova, Plugin } from './plugin';
|
||||
* (info) => console.log('Sim info: ', info),
|
||||
* (err) => console.log('Unable to get sim info: ', err)
|
||||
* );
|
||||
*
|
||||
* Sim.hasReadPermission().then(
|
||||
* (info) => console.log('Has permission: ', info)
|
||||
* );
|
||||
*
|
||||
* Sim.requestReadPermission().then(
|
||||
* () => console.log('Permission granted'),
|
||||
* () => console.log('Permission denied')
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
@@ -34,4 +43,21 @@ export class Sim {
|
||||
@Cordova()
|
||||
static getSimInfo(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Check permission
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static hasReadPermission(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Request permission
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
})
|
||||
static requestReadPermission(): Promise<any> { return; }
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ declare var sqlitePlugin;
|
||||
* })
|
||||
* .then((db: SQLite) => {
|
||||
*
|
||||
* db.executeSql('create table danceMoves(name VARCHAR(32))').then(() => {}).catch(() => {});
|
||||
* db.executeSql('create table danceMoves(name VARCHAR(32))', {}).then(() => {}).catch(() => {});
|
||||
*
|
||||
* })
|
||||
* .catch(error => console.error('Error opening database', error);
|
||||
|
||||
@@ -41,7 +41,7 @@ export interface VideoOptions {
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'VideoPlayer',
|
||||
plugin: 'cordova-plugin-videoplayer',
|
||||
plugin: 'https://github.com/moust/cordova-plugin-videoplayer',
|
||||
pluginRef: 'VideoPlayer',
|
||||
repo: 'https://github.com/moust/cordova-plugin-videoplayer',
|
||||
platforms: ['Android']
|
||||
|
||||
Reference in New Issue
Block a user