From bb2291cd16e4ac3f0f9d29ad7947ac83ce551393 Mon Sep 17 00:00:00 2001 From: Harshith Kashyap Date: Sat, 2 Dec 2017 09:24:16 +0530 Subject: [PATCH] fix(deeplinks): add options parameter(#1601) (#2141) --- package-lock.json | 40 ++++++++++---------- src/@ionic-native/plugins/deeplinks/index.ts | 11 +++++- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index d4d6dc275..845634b1e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,16 +60,6 @@ "integrity": "sha512-El3+WJk2D/ppWNd2X05aiP5l2k4EwF7KwheknQZls+I26eSICoWRhRIJ56jGgw2dqNGQ5LtNajmBU2ajS28EvQ==", "dev": true }, - "JSONStream": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", - "integrity": "sha1-cH92HgHa6eFvG8+TcDt4xwlmV5o=", - "dev": true, - "requires": { - "jsonparse": "1.3.1", - "through": "2.3.8" - } - }, "abbrev": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", @@ -1591,8 +1581,8 @@ "integrity": "sha1-HxXOa4RPfKQUlcgZDAgzwwuLFpM=", "dev": true, "requires": { - "JSONStream": "1.3.1", "is-text-path": "1.0.1", + "JSONStream": "1.3.1", "lodash": "4.17.4", "meow": "3.7.0", "split2": "2.2.0", @@ -3876,6 +3866,16 @@ "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", "dev": true }, + "JSONStream": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", + "integrity": "sha1-cH92HgHa6eFvG8+TcDt4xwlmV5o=", + "dev": true, + "requires": { + "jsonparse": "1.3.1", + "through": "2.3.8" + } + }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -6242,6 +6242,15 @@ } } }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", @@ -6253,15 +6262,6 @@ "strip-ansi": "3.0.1" } }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "dev": true, - "requires": { - "safe-buffer": "5.1.1" - } - }, "stringmap": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/stringmap/-/stringmap-0.2.2.tgz", diff --git a/src/@ionic-native/plugins/deeplinks/index.ts b/src/@ionic-native/plugins/deeplinks/index.ts index 0039f271a..0b9519168 100644 --- a/src/@ionic-native/plugins/deeplinks/index.ts +++ b/src/@ionic-native/plugins/deeplinks/index.ts @@ -23,6 +23,13 @@ export interface DeeplinkMatch { } +export interface DeeplinkOptions { + /** + * Set the matched route as root page using `navCtrl.setRoot()` method. + */ + root: boolean; +} + /** * @name Deeplinks * @description This plugin handles deeplinks on iOS and Android for both custom URL scheme links @@ -116,6 +123,8 @@ export class Deeplinks extends IonicNativePlugin { * promise result which you can then use to navigate in the app as you see fit. * * @param {Object} paths + * + * @param {DeeplinkOptions} options * * @returns {Observable} 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. @@ -123,6 +132,6 @@ export class Deeplinks extends IonicNativePlugin { @Cordova({ observable: true }) - routeWithNavController(navController: any, paths: any): Observable { return; } + routeWithNavController(navController: any, paths: any, options?: DeeplinkOptions): Observable { return; } }