Add listener in the renderer process for deeplink

Summary:
- Set userPrefferedPlugin for external deeplink
- Listen for deeplink in renderer process and navigate accordingly

Reviewed By: passy

Differential Revision: D10339035

fbshipit-source-id: 4de6249a0672f9ce02b0dfb78a4563302c308578
This commit is contained in:
Pritesh Nandgaonkar
2018-10-17 06:17:55 -07:00
committed by Facebook Github Bot
parent 4f914a655e
commit ce996ba8af
5 changed files with 91 additions and 7 deletions

View File

@@ -0,0 +1,32 @@
/**
* Copyright 2018-present Facebook.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* @format
*/
import {uriComponents} from '../application.js';
test('test parsing of deeplink URL', () => {
const url = 'flipper://app/plugin/meta/data';
let components = uriComponents(url);
expect(components).toEqual(['app', 'plugin', 'meta/data']);
});
test('test parsing of deeplink URL when arguments are less', () => {
const url = 'flipper://app/';
let components = uriComponents(url);
expect(components).toEqual(['app']);
});
test('test parsing of deeplink URL when url is null', () => {
// $FlowFixMe
let components = uriComponents(null);
expect(components).toEqual([]);
});
test('test parsing of deeplink URL when pattern does not match', () => {
const url = 'Some random string';
let components = uriComponents(url);
expect(components).toEqual([]);
});