fix(deeplinks): add options parameter(#1601) (#2141)

This commit is contained in:
Harshith Kashyap 2017-12-02 09:24:16 +05:30 committed by Ibby Hadeed
parent 7255795ae5
commit bb2291cd16
2 changed files with 30 additions and 21 deletions

40
package-lock.json generated
View File

@ -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",

View File

@ -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<DeeplinkMatch>} Returns an Observable that resolves each time a deeplink comes through, and
* errors if a deeplink comes through that does not match a given path.
@ -123,6 +132,6 @@ export class Deeplinks extends IonicNativePlugin {
@Cordova({
observable: true
})
routeWithNavController(navController: any, paths: any): Observable<DeeplinkMatch> { return; }
routeWithNavController(navController: any, paths: any, options?: DeeplinkOptions): Observable<DeeplinkMatch> { return; }
}