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:
committed by
Facebook Github Bot
parent
4f914a655e
commit
ce996ba8af
32
src/dispatcher/__tests__/deeplinkURLParsing.node.js
Normal file
32
src/dispatcher/__tests__/deeplinkURLParsing.node.js
Normal 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([]);
|
||||
});
|
||||
Reference in New Issue
Block a user