diff --git a/Libraries/Linking/NativeLinking.desktop-qt.js b/Libraries/Linking/NativeLinking.desktop-qt.js new file mode 100644 index 000000000..52c60b615 --- /dev/null +++ b/Libraries/Linking/NativeLinking.desktop-qt.js @@ -0,0 +1,37 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow + * @format + */ + +'use strict'; + +import type {TurboModule} from 'RCTExport'; +import * as TurboModuleRegistry from 'TurboModuleRegistry'; +import Platform from 'Platform'; + +export interface Spec extends TurboModule { + // Common interface + +getInitialURL: () => Promise; + +canOpenURL: (url: string) => Promise; + +openURL: (url: string) => Promise; + +openSettings: () => Promise; + + // Android only + +sendIntent: ( + action: string, + extras: ?Array<{key: string, value: string | number | boolean}>, + ) => Promise; + + // Events + +addListener: (eventName: string) => void; + +removeListeners: (count: number) => void; +} + +export default ((Platform.OS === 'ios' || Platform.OS == 'desktop-qt') + ? TurboModuleRegistry.getEnforcing('LinkingManager') + : TurboModuleRegistry.getEnforcing('IntentAndroid')); diff --git a/RNTester/js/RNTesterList.desktop-qt.js b/RNTester/js/RNTesterList.desktop-qt.js index 24f7605ec..5db7f76ca 100644 --- a/RNTester/js/RNTesterList.desktop-qt.js +++ b/RNTester/js/RNTesterList.desktop-qt.js @@ -208,10 +208,10 @@ const APIExamples: Array = [ key: 'LayoutExample', module: require('./LayoutExample'), }, - // { - // key: 'LinkingExample', - // module: require('./LinkingExample'), - // }, + { + key: 'LinkingExample', + module: require('./LinkingExample'), + }, { key: 'NativeAnimationsExample', module: require('./NativeAnimationsExample'), diff --git a/babel/babel-config-generator.js b/babel/babel-config-generator.js index 00cb0fa7d..7094b736a 100644 --- a/babel/babel-config-generator.js +++ b/babel/babel-config-generator.js @@ -19,6 +19,8 @@ function createRnToRndMap(rndPath) { ["../../../Components/ScrollView/ScrollView", path.resolve(rndPath, "Libraries/Components/ScrollView/ScrollView")], ["SafeAreaView", path.resolve(rndPath, "Libraries/Components/SafeAreaView/SafeAreaView")], ["../../Components/SafeAreaView/SafeAreaView", path.resolve(rndPath, "Libraries/Components/SafeAreaView/SafeAreaView")], + ["../../Components/SafeAreaView/SafeAreaView", path.resolve(rndPath, "Libraries/Components/SafeAreaView/SafeAreaView")], + ["./NativeLinking", path.resolve(rndPath, "Libraries/Linking/NativeLinking")], ]); }