Skip to content

Commit

Permalink
Fixed issue on using Linking (#590)
Browse files Browse the repository at this point in the history
  • Loading branch information
vkjr authored May 29, 2020
1 parent 8338592 commit 3bb39dd
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 4 deletions.
37 changes: 37 additions & 0 deletions Libraries/Linking/NativeLinking.desktop-qt.js
Original file line number Diff line number Diff line change
@@ -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<string>;
+canOpenURL: (url: string) => Promise<boolean>;
+openURL: (url: string) => Promise<void>;
+openSettings: () => Promise<void>;

// Android only
+sendIntent: (
action: string,
extras: ?Array<{key: string, value: string | number | boolean}>,
) => Promise<void>;

// Events
+addListener: (eventName: string) => void;
+removeListeners: (count: number) => void;
}

export default ((Platform.OS === 'ios' || Platform.OS == 'desktop-qt')
? TurboModuleRegistry.getEnforcing<Spec>('LinkingManager')
: TurboModuleRegistry.getEnforcing<Spec>('IntentAndroid'));
8 changes: 4 additions & 4 deletions RNTester/js/RNTesterList.desktop-qt.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,10 @@ const APIExamples: Array<RNTesterExample> = [
key: 'LayoutExample',
module: require('./LayoutExample'),
},
// {
// key: 'LinkingExample',
// module: require('./LinkingExample'),
// },
{
key: 'LinkingExample',
module: require('./LinkingExample'),
},
{
key: 'NativeAnimationsExample',
module: require('./NativeAnimationsExample'),
Expand Down
2 changes: 2 additions & 0 deletions babel/babel-config-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")],
]);
}

Expand Down

0 comments on commit 3bb39dd

Please sign in to comment.