mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
e85cd6cd02
Summary:
For other platforms such as React VR it doesn't make sense to use `IntentAndroid` native module and it should use `LinkingManager` instead.
The code used to be:
```
const LinkingManager =
Platform.OS === 'android'
? NativeModules.IntentAndroid
: NativeModules.LinkingManager;
```
This diff changes the behaviour back to what it used to be.
Reviewed By: cpojer
Differential Revision: D16561073
fbshipit-source-id: 544551f8ff1affca5a71835133e8a9e7abc75e1a
38 lines
1.0 KiB
JavaScript
38 lines
1.0 KiB
JavaScript
/**
|
|
* 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 '../TurboModule/RCTExport';
|
|
import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
|
|
import Platform from '../Utilities/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 === 'android'
|
|
? TurboModuleRegistry.getEnforcing<Spec>('IntentAndroid')
|
|
: TurboModuleRegistry.getEnforcing<Spec>('LinkingManager'));
|