From e88709ac89f9f266c2374f5cfa27e1042360e765 Mon Sep 17 00:00:00 2001 From: Nicolas Naso Date: Tue, 22 Jan 2019 09:20:25 -0300 Subject: [PATCH 01/10] feat(firebase-crashlytics): add new plugin --- .../plugins/firebase-crashlytics/index.ts | 195 ++++++++++++++++++ 1 file changed, 195 insertions(+) create mode 100644 src/@ionic-native/plugins/firebase-crashlytics/index.ts diff --git a/src/@ionic-native/plugins/firebase-crashlytics/index.ts b/src/@ionic-native/plugins/firebase-crashlytics/index.ts new file mode 100644 index 0000000000..3100404650 --- /dev/null +++ b/src/@ionic-native/plugins/firebase-crashlytics/index.ts @@ -0,0 +1,195 @@ +import { Injectable } from '@angular/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; + +/** + * @name Firebase Crashlytics + * @description + * A Google Firebase Crashlytics plugin to enable capture of crash reports. + * + * @usage + * ```typescript + * import { FirebaseCrashlytics } from '@ionic-native/firebase-crashlytics'; + * + * + * constructor(private firebaseCrashlytics: FirebaseCrashlytics) { } + * + * ... + * + * + * const crashlytics = this.firebaseCrashlytics.initialize(); + * crashlytics.logException('my caught exception'); + * + * ``` + */ +@Plugin({ + pluginName: 'FirebaseCrashlytics', + plugin: 'cordova-plugin-firebase-crashlytics', + pluginRef: 'FirebaseCrashlytics', + repo: + 'https://github.com/ReallySmallSoftware/cordova-plugin-firebase-crashlytics', + install: + 'ionic cordova plugin add cordova-plugin-firebase-crashlytics --variable ANDROID_FIREBASE_CORE_VERSION=16.0.0', + installVariables: ['ANDROID_FIREBASE_CORE_VERSION'], + platforms: ['Android', 'iOS'] +}) +@Injectable() +export class FirebaseCrashlytics extends IonicNativePlugin { + /** + * Simply add the plugin to get the default Crashlytics functionality. Note that crashes and logged exceptions will only be reported when the application restarts. In order to log caught exceptions the following can be used: + * + * @returns {void} + * @memberof FirebaseCrashlytics + */ + @Cordova({ + sync: true + }) + initialize(): void { + return; // We add return; here to avoid any IDE / Compiler errors + } + + /** + * Generate a forced crash. Visible in console after restart of application. + * + * @returns {void} + * @memberof FirebaseCrashlytics + */ + @Cordova({ + sync: true + }) + crash(): void { + return; // We add return; here to avoid any IDE / Compiler errors + } + + /** + * Log a priority message. Will only be logged in the event of a crash. + * + * @param {number} priority + * @param {string} tag + * @param {string} message + * @returns {void} + * @memberof FirebaseCrashlytics + */ + @Cordova({ + sync: true + }) + logPriority(priority: number, tag: string, message: string): void { + return; + } + + /** + * Log a message. Will only be logged in the event of a crash. + * + * @param {string} message + * @returns {void} + * @memberof FirebaseCrashlytics + */ + @Cordova({ + sync: true + }) + log(message: string): void { + return; + } + + /** + * Log when a handled exception has happened. Visible in console after restart of application. + * + * @param {string} message + * @returns {void} + * @memberof FirebaseCrashlytics + */ + @Cordova({ + sync: true + }) + logException(message: string): void { + return; + } + + /** + * Set extra key/value string value. Will only be logged in the event of a crash. + * + * @param {string} key + * @param {string} value + * @returns {void} + * @memberof FirebaseCrashlytics + */ + @Cordova({ + sync: true + }) + setString(key: string, value: string): void { + return; + } + + /** + * Set extra key/value bool value. Will only be logged in the event of a crash. + * + * @param {string} key + * @param {boolean} value + * @returns {void} + * @memberof FirebaseCrashlytics + */ + @Cordova({ + sync: true + }) + setBool(key: string, value: boolean): void { + return; + } + + /** + * Set extra key/value double value. Will only be logged in the event of a crash. + * + * @param {string} key + * @param {number} value + * @returns {void} + * @memberof FirebaseCrashlytics + */ + @Cordova({ + sync: true + }) + setDouble(key: string, value: number): void { + return; + } + + /** + * Set extra key/value float value. Will only be logged in the event of a crash. + * + * @param {string} key + * @param {number} value + * @returns {void} + * @memberof FirebaseCrashlytics + */ + @Cordova({ + sync: true + }) + setFloat(key: string, value: number): void { + return; + } + + /** + * Set extra key/value integer value. Will only be logged in the event of a crash. + * + * @param {string} key + * @param {number} value + * @returns {void} + * @memberof FirebaseCrashlytics + */ + @Cordova({ + sync: true + }) + setInt(key: string, value: number): void { + return; + } + + /** + * Set the identifier for the user. Take care when using this method and ensure you privacy policy is updated accordingly. + * + * @param {string} identifier + * @returns {void} + * @memberof FirebaseCrashlytics + */ + @Cordova({ + sync: true + }) + setUserIdentifier(identifier: string): void { + return; + } +} From e6dbe8ee683d3ce46f74372c521eb1174a759525 Mon Sep 17 00:00:00 2001 From: Nicolas Naso Date: Tue, 22 Jan 2019 09:37:06 -0300 Subject: [PATCH 02/10] fix(): remove @memberof annotation --- .../plugins/firebase-crashlytics/index.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/@ionic-native/plugins/firebase-crashlytics/index.ts b/src/@ionic-native/plugins/firebase-crashlytics/index.ts index 3100404650..35bfc60946 100644 --- a/src/@ionic-native/plugins/firebase-crashlytics/index.ts +++ b/src/@ionic-native/plugins/firebase-crashlytics/index.ts @@ -38,7 +38,6 @@ export class FirebaseCrashlytics extends IonicNativePlugin { * Simply add the plugin to get the default Crashlytics functionality. Note that crashes and logged exceptions will only be reported when the application restarts. In order to log caught exceptions the following can be used: * * @returns {void} - * @memberof FirebaseCrashlytics */ @Cordova({ sync: true @@ -51,7 +50,6 @@ export class FirebaseCrashlytics extends IonicNativePlugin { * Generate a forced crash. Visible in console after restart of application. * * @returns {void} - * @memberof FirebaseCrashlytics */ @Cordova({ sync: true @@ -67,7 +65,6 @@ export class FirebaseCrashlytics extends IonicNativePlugin { * @param {string} tag * @param {string} message * @returns {void} - * @memberof FirebaseCrashlytics */ @Cordova({ sync: true @@ -81,7 +78,6 @@ export class FirebaseCrashlytics extends IonicNativePlugin { * * @param {string} message * @returns {void} - * @memberof FirebaseCrashlytics */ @Cordova({ sync: true @@ -95,7 +91,6 @@ export class FirebaseCrashlytics extends IonicNativePlugin { * * @param {string} message * @returns {void} - * @memberof FirebaseCrashlytics */ @Cordova({ sync: true @@ -110,7 +105,6 @@ export class FirebaseCrashlytics extends IonicNativePlugin { * @param {string} key * @param {string} value * @returns {void} - * @memberof FirebaseCrashlytics */ @Cordova({ sync: true @@ -125,7 +119,6 @@ export class FirebaseCrashlytics extends IonicNativePlugin { * @param {string} key * @param {boolean} value * @returns {void} - * @memberof FirebaseCrashlytics */ @Cordova({ sync: true @@ -140,7 +133,6 @@ export class FirebaseCrashlytics extends IonicNativePlugin { * @param {string} key * @param {number} value * @returns {void} - * @memberof FirebaseCrashlytics */ @Cordova({ sync: true @@ -155,7 +147,6 @@ export class FirebaseCrashlytics extends IonicNativePlugin { * @param {string} key * @param {number} value * @returns {void} - * @memberof FirebaseCrashlytics */ @Cordova({ sync: true @@ -170,7 +161,6 @@ export class FirebaseCrashlytics extends IonicNativePlugin { * @param {string} key * @param {number} value * @returns {void} - * @memberof FirebaseCrashlytics */ @Cordova({ sync: true @@ -184,7 +174,6 @@ export class FirebaseCrashlytics extends IonicNativePlugin { * * @param {string} identifier * @returns {void} - * @memberof FirebaseCrashlytics */ @Cordova({ sync: true From 0628a9f2b44dec0649199d817dcd8a083c4d8e7f Mon Sep 17 00:00:00 2001 From: Nicolas Naso Date: Mon, 4 Feb 2019 16:39:04 -0300 Subject: [PATCH 03/10] fix(): update package-lock --- package-lock.json | 128 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 91 insertions(+), 37 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7f052fd711..a8d24744ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ionic-native", - "version": "5.0.0-beta.24", + "version": "5.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -679,6 +679,7 @@ "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -882,7 +883,7 @@ }, "util": { "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "resolved": "http://registry.npmjs.org/util/-/util-0.10.3.tgz", "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", "dev": true, "requires": { @@ -1346,7 +1347,7 @@ }, "browserify-aes": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, "requires": { @@ -1391,7 +1392,7 @@ }, "browserify-rsa": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", "dev": true, "requires": { @@ -2657,7 +2658,7 @@ }, "create-hash": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, "requires": { @@ -2670,7 +2671,7 @@ }, "create-hmac": { "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, "requires": { @@ -3099,7 +3100,7 @@ }, "diffie-hellman": { "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dev": true, "requires": { @@ -4000,7 +4001,8 @@ "version": "0.4.2", "resolved": false, "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", - "dev": true + "dev": true, + "optional": true }, "bcrypt-pbkdf": { "version": "1.0.1", @@ -4017,6 +4019,7 @@ "resolved": false, "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", "dev": true, + "optional": true, "requires": { "inherits": "~2.0.0" } @@ -4036,6 +4039,7 @@ "resolved": false, "integrity": "sha1-Pv/DxQ4ABTH7cg6v+A8K6O8jz1k=", "dev": true, + "optional": true, "requires": { "balanced-match": "^0.4.1", "concat-map": "0.0.1" @@ -4083,7 +4087,8 @@ "version": "0.0.1", "resolved": false, "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", @@ -4213,13 +4218,15 @@ "version": "1.0.0", "resolved": false, "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "dev": true, + "optional": true }, "fstream": { "version": "1.0.11", "resolved": false, "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", "dev": true, + "optional": true, "requires": { "graceful-fs": "^4.1.2", "inherits": "~2.0.0", @@ -4280,6 +4287,7 @@ "resolved": false, "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, + "optional": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -4293,7 +4301,8 @@ "version": "4.1.11", "resolved": false, "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true + "dev": true, + "optional": true }, "har-schema": { "version": "1.0.5", @@ -4337,7 +4346,8 @@ "version": "2.16.3", "resolved": false, "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", - "dev": true + "dev": true, + "optional": true }, "http-signature": { "version": "1.1.1", @@ -4356,6 +4366,7 @@ "resolved": false, "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, + "optional": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -4365,7 +4376,8 @@ "version": "2.0.3", "resolved": false, "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.4", @@ -4497,6 +4509,7 @@ "resolved": false, "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -4505,13 +4518,15 @@ "version": "0.0.8", "resolved": false, "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true + "dev": true, + "optional": true }, "mkdirp": { "version": "0.5.1", "resolved": false, "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -4593,6 +4608,7 @@ "resolved": false, "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -4626,7 +4642,8 @@ "version": "1.0.1", "resolved": false, "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "dev": true, + "optional": true }, "performance-now": { "version": "0.2.0", @@ -4730,6 +4747,7 @@ "resolved": false, "integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0=", "dev": true, + "optional": true, "requires": { "glob": "^7.0.5" } @@ -4850,6 +4868,7 @@ "resolved": false, "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", "dev": true, + "optional": true, "requires": { "block-stream": "*", "fstream": "^1.0.2", @@ -4945,7 +4964,8 @@ "version": "1.0.2", "resolved": false, "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "dev": true, + "optional": true } } }, @@ -10111,7 +10131,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -10154,7 +10175,8 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", @@ -10165,7 +10187,8 @@ "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -10282,7 +10305,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -10294,6 +10318,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -10316,12 +10341,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -10340,6 +10367,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -10420,7 +10448,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -10432,6 +10461,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -10517,7 +10547,8 @@ "safe-buffer": { "version": "5.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -10553,6 +10584,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -10572,6 +10604,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -10615,12 +10648,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -10796,7 +10831,7 @@ }, "sha.js": { "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { @@ -12970,7 +13005,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -12991,12 +13027,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -13011,17 +13049,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -13138,7 +13179,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -13150,6 +13192,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -13164,6 +13207,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -13171,12 +13215,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -13195,6 +13241,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -13275,7 +13322,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -13287,6 +13335,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -13372,7 +13421,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -13408,6 +13458,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -13427,6 +13478,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -13470,12 +13522,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, From a78ad963648f463f2e18ffcc4ebc50911961c524 Mon Sep 17 00:00:00 2001 From: Nicolas Naso Date: Mon, 4 Feb 2019 16:39:38 -0300 Subject: [PATCH 04/10] feat(app-launcher): add new plugin --- .../plugins/app-launcher/index.ts | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/@ionic-native/plugins/app-launcher/index.ts diff --git a/src/@ionic-native/plugins/app-launcher/index.ts b/src/@ionic-native/plugins/app-launcher/index.ts new file mode 100644 index 0000000000..3a45911cf1 --- /dev/null +++ b/src/@ionic-native/plugins/app-launcher/index.ts @@ -0,0 +1,64 @@ +import { Injectable } from '@angular/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; + +export interface AppLauncherOptions { + uri?: string; + packageName?: string; +} + +/** + * @name App Launcher + * @description + * Simple Cordova plugin to see if other apps are installed and launch them. + * + * @usage + * ```typescript + * import { AppLauncher, AppLauncherOptions } from '@ionic-native/app-launcher'; + * import { Platform } from 'ionic-angular'; + * + * constructor(private appLauncher: AppLauncher, private platform: Platform) { } + * + * ... + * const options: AppLauncherOptions = { + * } + * if (this.platform.is('ios')) { + * options.uri = 'fb://' + * }else{ + * options.packageName = 'com.facebook.katana' + * } + * + * this.appLauncher.canLaunch(options) + * .then((canLaunch: boolean) => console.log('Facebook is available')) + * .catch((error: any) => console.error('Facebook is not available')); + * + * ``` + */ +@Plugin({ + pluginName: 'AppLauncher', + plugin: 'cordova-plugin-app-launcher', + pluginRef: 'window.plugins.launcher', + repo: 'https://github.com/nchutchind/cordova-plugin-app-launcher', + platforms: ['Android', 'iOS'] +}) +@Injectable() +export class AppLauncher extends IonicNativePlugin { + /** + * Check if any apps are installed that can launch via a specified URI or Package Name. + * @param options {AppLauncherOptions} App Launcher options + * @return {Promise} Returns a promise that resolves if the app is installed + */ + @Cordova() + canLaunch(options: AppLauncherOptions): Promise { + return; + } + + /** + * Launches the app via a specified URI or Package Name + * @param options {AppLauncherOptions} App Launcher options + * @return {Promise} Returns a promise that resolves the launched app + */ + @Cordova() + launch(options: AppLauncherOptions): Promise { + return; + } +} From 067fb3e76e41272b6a3d28c603de114fe1380a31 Mon Sep 17 00:00:00 2001 From: Nicolas Naso Date: Tue, 22 Jan 2019 09:20:25 -0300 Subject: [PATCH 05/10] feat(firebase-crashlytics): add new plugin --- .../plugins/firebase-crashlytics/index.ts | 195 ++++++++++++++++++ 1 file changed, 195 insertions(+) create mode 100644 src/@ionic-native/plugins/firebase-crashlytics/index.ts diff --git a/src/@ionic-native/plugins/firebase-crashlytics/index.ts b/src/@ionic-native/plugins/firebase-crashlytics/index.ts new file mode 100644 index 0000000000..3100404650 --- /dev/null +++ b/src/@ionic-native/plugins/firebase-crashlytics/index.ts @@ -0,0 +1,195 @@ +import { Injectable } from '@angular/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; + +/** + * @name Firebase Crashlytics + * @description + * A Google Firebase Crashlytics plugin to enable capture of crash reports. + * + * @usage + * ```typescript + * import { FirebaseCrashlytics } from '@ionic-native/firebase-crashlytics'; + * + * + * constructor(private firebaseCrashlytics: FirebaseCrashlytics) { } + * + * ... + * + * + * const crashlytics = this.firebaseCrashlytics.initialize(); + * crashlytics.logException('my caught exception'); + * + * ``` + */ +@Plugin({ + pluginName: 'FirebaseCrashlytics', + plugin: 'cordova-plugin-firebase-crashlytics', + pluginRef: 'FirebaseCrashlytics', + repo: + 'https://github.com/ReallySmallSoftware/cordova-plugin-firebase-crashlytics', + install: + 'ionic cordova plugin add cordova-plugin-firebase-crashlytics --variable ANDROID_FIREBASE_CORE_VERSION=16.0.0', + installVariables: ['ANDROID_FIREBASE_CORE_VERSION'], + platforms: ['Android', 'iOS'] +}) +@Injectable() +export class FirebaseCrashlytics extends IonicNativePlugin { + /** + * Simply add the plugin to get the default Crashlytics functionality. Note that crashes and logged exceptions will only be reported when the application restarts. In order to log caught exceptions the following can be used: + * + * @returns {void} + * @memberof FirebaseCrashlytics + */ + @Cordova({ + sync: true + }) + initialize(): void { + return; // We add return; here to avoid any IDE / Compiler errors + } + + /** + * Generate a forced crash. Visible in console after restart of application. + * + * @returns {void} + * @memberof FirebaseCrashlytics + */ + @Cordova({ + sync: true + }) + crash(): void { + return; // We add return; here to avoid any IDE / Compiler errors + } + + /** + * Log a priority message. Will only be logged in the event of a crash. + * + * @param {number} priority + * @param {string} tag + * @param {string} message + * @returns {void} + * @memberof FirebaseCrashlytics + */ + @Cordova({ + sync: true + }) + logPriority(priority: number, tag: string, message: string): void { + return; + } + + /** + * Log a message. Will only be logged in the event of a crash. + * + * @param {string} message + * @returns {void} + * @memberof FirebaseCrashlytics + */ + @Cordova({ + sync: true + }) + log(message: string): void { + return; + } + + /** + * Log when a handled exception has happened. Visible in console after restart of application. + * + * @param {string} message + * @returns {void} + * @memberof FirebaseCrashlytics + */ + @Cordova({ + sync: true + }) + logException(message: string): void { + return; + } + + /** + * Set extra key/value string value. Will only be logged in the event of a crash. + * + * @param {string} key + * @param {string} value + * @returns {void} + * @memberof FirebaseCrashlytics + */ + @Cordova({ + sync: true + }) + setString(key: string, value: string): void { + return; + } + + /** + * Set extra key/value bool value. Will only be logged in the event of a crash. + * + * @param {string} key + * @param {boolean} value + * @returns {void} + * @memberof FirebaseCrashlytics + */ + @Cordova({ + sync: true + }) + setBool(key: string, value: boolean): void { + return; + } + + /** + * Set extra key/value double value. Will only be logged in the event of a crash. + * + * @param {string} key + * @param {number} value + * @returns {void} + * @memberof FirebaseCrashlytics + */ + @Cordova({ + sync: true + }) + setDouble(key: string, value: number): void { + return; + } + + /** + * Set extra key/value float value. Will only be logged in the event of a crash. + * + * @param {string} key + * @param {number} value + * @returns {void} + * @memberof FirebaseCrashlytics + */ + @Cordova({ + sync: true + }) + setFloat(key: string, value: number): void { + return; + } + + /** + * Set extra key/value integer value. Will only be logged in the event of a crash. + * + * @param {string} key + * @param {number} value + * @returns {void} + * @memberof FirebaseCrashlytics + */ + @Cordova({ + sync: true + }) + setInt(key: string, value: number): void { + return; + } + + /** + * Set the identifier for the user. Take care when using this method and ensure you privacy policy is updated accordingly. + * + * @param {string} identifier + * @returns {void} + * @memberof FirebaseCrashlytics + */ + @Cordova({ + sync: true + }) + setUserIdentifier(identifier: string): void { + return; + } +} From 0cc479ce5b735fceb366ab10adb958b05bd731bb Mon Sep 17 00:00:00 2001 From: Nicolas Naso Date: Tue, 22 Jan 2019 09:37:06 -0300 Subject: [PATCH 06/10] fix(): remove @memberof annotation --- .../plugins/firebase-crashlytics/index.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/@ionic-native/plugins/firebase-crashlytics/index.ts b/src/@ionic-native/plugins/firebase-crashlytics/index.ts index 3100404650..35bfc60946 100644 --- a/src/@ionic-native/plugins/firebase-crashlytics/index.ts +++ b/src/@ionic-native/plugins/firebase-crashlytics/index.ts @@ -38,7 +38,6 @@ export class FirebaseCrashlytics extends IonicNativePlugin { * Simply add the plugin to get the default Crashlytics functionality. Note that crashes and logged exceptions will only be reported when the application restarts. In order to log caught exceptions the following can be used: * * @returns {void} - * @memberof FirebaseCrashlytics */ @Cordova({ sync: true @@ -51,7 +50,6 @@ export class FirebaseCrashlytics extends IonicNativePlugin { * Generate a forced crash. Visible in console after restart of application. * * @returns {void} - * @memberof FirebaseCrashlytics */ @Cordova({ sync: true @@ -67,7 +65,6 @@ export class FirebaseCrashlytics extends IonicNativePlugin { * @param {string} tag * @param {string} message * @returns {void} - * @memberof FirebaseCrashlytics */ @Cordova({ sync: true @@ -81,7 +78,6 @@ export class FirebaseCrashlytics extends IonicNativePlugin { * * @param {string} message * @returns {void} - * @memberof FirebaseCrashlytics */ @Cordova({ sync: true @@ -95,7 +91,6 @@ export class FirebaseCrashlytics extends IonicNativePlugin { * * @param {string} message * @returns {void} - * @memberof FirebaseCrashlytics */ @Cordova({ sync: true @@ -110,7 +105,6 @@ export class FirebaseCrashlytics extends IonicNativePlugin { * @param {string} key * @param {string} value * @returns {void} - * @memberof FirebaseCrashlytics */ @Cordova({ sync: true @@ -125,7 +119,6 @@ export class FirebaseCrashlytics extends IonicNativePlugin { * @param {string} key * @param {boolean} value * @returns {void} - * @memberof FirebaseCrashlytics */ @Cordova({ sync: true @@ -140,7 +133,6 @@ export class FirebaseCrashlytics extends IonicNativePlugin { * @param {string} key * @param {number} value * @returns {void} - * @memberof FirebaseCrashlytics */ @Cordova({ sync: true @@ -155,7 +147,6 @@ export class FirebaseCrashlytics extends IonicNativePlugin { * @param {string} key * @param {number} value * @returns {void} - * @memberof FirebaseCrashlytics */ @Cordova({ sync: true @@ -170,7 +161,6 @@ export class FirebaseCrashlytics extends IonicNativePlugin { * @param {string} key * @param {number} value * @returns {void} - * @memberof FirebaseCrashlytics */ @Cordova({ sync: true @@ -184,7 +174,6 @@ export class FirebaseCrashlytics extends IonicNativePlugin { * * @param {string} identifier * @returns {void} - * @memberof FirebaseCrashlytics */ @Cordova({ sync: true From 7cdd4d3efbb0aa1e410702b9de7cb995be962b19 Mon Sep 17 00:00:00 2001 From: Nicolas Naso Date: Mon, 4 Feb 2019 16:39:04 -0300 Subject: [PATCH 07/10] fix(): update package-lock --- package-lock.json | 128 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 91 insertions(+), 37 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7f052fd711..a8d24744ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ionic-native", - "version": "5.0.0-beta.24", + "version": "5.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -679,6 +679,7 @@ "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -882,7 +883,7 @@ }, "util": { "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "resolved": "http://registry.npmjs.org/util/-/util-0.10.3.tgz", "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", "dev": true, "requires": { @@ -1346,7 +1347,7 @@ }, "browserify-aes": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, "requires": { @@ -1391,7 +1392,7 @@ }, "browserify-rsa": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", "dev": true, "requires": { @@ -2657,7 +2658,7 @@ }, "create-hash": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, "requires": { @@ -2670,7 +2671,7 @@ }, "create-hmac": { "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, "requires": { @@ -3099,7 +3100,7 @@ }, "diffie-hellman": { "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dev": true, "requires": { @@ -4000,7 +4001,8 @@ "version": "0.4.2", "resolved": false, "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", - "dev": true + "dev": true, + "optional": true }, "bcrypt-pbkdf": { "version": "1.0.1", @@ -4017,6 +4019,7 @@ "resolved": false, "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", "dev": true, + "optional": true, "requires": { "inherits": "~2.0.0" } @@ -4036,6 +4039,7 @@ "resolved": false, "integrity": "sha1-Pv/DxQ4ABTH7cg6v+A8K6O8jz1k=", "dev": true, + "optional": true, "requires": { "balanced-match": "^0.4.1", "concat-map": "0.0.1" @@ -4083,7 +4087,8 @@ "version": "0.0.1", "resolved": false, "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", @@ -4213,13 +4218,15 @@ "version": "1.0.0", "resolved": false, "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "dev": true, + "optional": true }, "fstream": { "version": "1.0.11", "resolved": false, "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", "dev": true, + "optional": true, "requires": { "graceful-fs": "^4.1.2", "inherits": "~2.0.0", @@ -4280,6 +4287,7 @@ "resolved": false, "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, + "optional": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -4293,7 +4301,8 @@ "version": "4.1.11", "resolved": false, "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true + "dev": true, + "optional": true }, "har-schema": { "version": "1.0.5", @@ -4337,7 +4346,8 @@ "version": "2.16.3", "resolved": false, "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", - "dev": true + "dev": true, + "optional": true }, "http-signature": { "version": "1.1.1", @@ -4356,6 +4366,7 @@ "resolved": false, "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, + "optional": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -4365,7 +4376,8 @@ "version": "2.0.3", "resolved": false, "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.4", @@ -4497,6 +4509,7 @@ "resolved": false, "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -4505,13 +4518,15 @@ "version": "0.0.8", "resolved": false, "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true + "dev": true, + "optional": true }, "mkdirp": { "version": "0.5.1", "resolved": false, "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -4593,6 +4608,7 @@ "resolved": false, "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -4626,7 +4642,8 @@ "version": "1.0.1", "resolved": false, "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "dev": true, + "optional": true }, "performance-now": { "version": "0.2.0", @@ -4730,6 +4747,7 @@ "resolved": false, "integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0=", "dev": true, + "optional": true, "requires": { "glob": "^7.0.5" } @@ -4850,6 +4868,7 @@ "resolved": false, "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", "dev": true, + "optional": true, "requires": { "block-stream": "*", "fstream": "^1.0.2", @@ -4945,7 +4964,8 @@ "version": "1.0.2", "resolved": false, "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "dev": true, + "optional": true } } }, @@ -10111,7 +10131,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -10154,7 +10175,8 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", @@ -10165,7 +10187,8 @@ "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -10282,7 +10305,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -10294,6 +10318,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -10316,12 +10341,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -10340,6 +10367,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -10420,7 +10448,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -10432,6 +10461,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -10517,7 +10547,8 @@ "safe-buffer": { "version": "5.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -10553,6 +10584,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -10572,6 +10604,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -10615,12 +10648,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -10796,7 +10831,7 @@ }, "sha.js": { "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { @@ -12970,7 +13005,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -12991,12 +13027,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -13011,17 +13049,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -13138,7 +13179,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -13150,6 +13192,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -13164,6 +13207,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -13171,12 +13215,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -13195,6 +13241,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -13275,7 +13322,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -13287,6 +13335,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -13372,7 +13421,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -13408,6 +13458,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -13427,6 +13478,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -13470,12 +13522,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, From 528a847d00fa29c8c00018c0b327bfbf22aa45cd Mon Sep 17 00:00:00 2001 From: Nicolas Naso Date: Mon, 4 Feb 2019 16:39:38 -0300 Subject: [PATCH 08/10] feat(app-launcher): add new plugin --- .../plugins/app-launcher/index.ts | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/@ionic-native/plugins/app-launcher/index.ts diff --git a/src/@ionic-native/plugins/app-launcher/index.ts b/src/@ionic-native/plugins/app-launcher/index.ts new file mode 100644 index 0000000000..3a45911cf1 --- /dev/null +++ b/src/@ionic-native/plugins/app-launcher/index.ts @@ -0,0 +1,64 @@ +import { Injectable } from '@angular/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; + +export interface AppLauncherOptions { + uri?: string; + packageName?: string; +} + +/** + * @name App Launcher + * @description + * Simple Cordova plugin to see if other apps are installed and launch them. + * + * @usage + * ```typescript + * import { AppLauncher, AppLauncherOptions } from '@ionic-native/app-launcher'; + * import { Platform } from 'ionic-angular'; + * + * constructor(private appLauncher: AppLauncher, private platform: Platform) { } + * + * ... + * const options: AppLauncherOptions = { + * } + * if (this.platform.is('ios')) { + * options.uri = 'fb://' + * }else{ + * options.packageName = 'com.facebook.katana' + * } + * + * this.appLauncher.canLaunch(options) + * .then((canLaunch: boolean) => console.log('Facebook is available')) + * .catch((error: any) => console.error('Facebook is not available')); + * + * ``` + */ +@Plugin({ + pluginName: 'AppLauncher', + plugin: 'cordova-plugin-app-launcher', + pluginRef: 'window.plugins.launcher', + repo: 'https://github.com/nchutchind/cordova-plugin-app-launcher', + platforms: ['Android', 'iOS'] +}) +@Injectable() +export class AppLauncher extends IonicNativePlugin { + /** + * Check if any apps are installed that can launch via a specified URI or Package Name. + * @param options {AppLauncherOptions} App Launcher options + * @return {Promise} Returns a promise that resolves if the app is installed + */ + @Cordova() + canLaunch(options: AppLauncherOptions): Promise { + return; + } + + /** + * Launches the app via a specified URI or Package Name + * @param options {AppLauncherOptions} App Launcher options + * @return {Promise} Returns a promise that resolves the launched app + */ + @Cordova() + launch(options: AppLauncherOptions): Promise { + return; + } +} From cf4a6638787c12bce339a8ee1aa9c8eecb2c1bc3 Mon Sep 17 00:00:00 2001 From: Nicolas Naso Date: Mon, 4 Feb 2019 16:52:41 -0300 Subject: [PATCH 09/10] fix(): reorder imports base on ordered-imports lint rule --- src/@ionic-native/core/decorators/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/@ionic-native/core/decorators/common.ts b/src/@ionic-native/core/decorators/common.ts index 7dc831e64d..9aa7e5d891 100644 --- a/src/@ionic-native/core/decorators/common.ts +++ b/src/@ionic-native/core/decorators/common.ts @@ -1,4 +1,4 @@ -import { fromEvent, Observable } from 'rxjs'; +import { Observable, fromEvent } from 'rxjs'; import { CordovaOptions } from './interfaces'; From e2ae6ac33958a77b484b6fcb46c7f94ca48cd03b Mon Sep 17 00:00:00 2001 From: Nicolas Naso Date: Thu, 14 Feb 2019 09:12:21 -0300 Subject: [PATCH 10/10] fix(): undo imports reorder and removes change from package-lock --- src/@ionic-native/core/decorators/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/@ionic-native/core/decorators/common.ts b/src/@ionic-native/core/decorators/common.ts index 9aa7e5d891..7dc831e64d 100644 --- a/src/@ionic-native/core/decorators/common.ts +++ b/src/@ionic-native/core/decorators/common.ts @@ -1,4 +1,4 @@ -import { Observable, fromEvent } from 'rxjs'; +import { fromEvent, Observable } from 'rxjs'; import { CordovaOptions } from './interfaces';