Skip to content

Commit

Permalink
[Android] Make Linking.getInitialURL works properly even if current a…
Browse files Browse the repository at this point in the history
…ctivity is not initialized
  • Loading branch information
Injung Chung committed May 8, 2019
1 parent b79d7db commit a92f8b2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Libraries/Linking/Linking.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
const NativeEventEmitter = require('NativeEventEmitter');
const NativeModules = require('NativeModules');
const Platform = require('Platform');
const InteractionManager = require('InteractionManager');

const invariant = require('invariant');

Expand Down Expand Up @@ -87,7 +88,11 @@ class Linking extends NativeEventEmitter {
* See https://facebook.github.io/react-native/docs/linking.html#getinitialurl
*/
getInitialURL(): Promise<?string> {
return LinkingManager.getInitialURL();
return Platform.OS === 'android'
? InteractionManager.runAfterInteractions().then(() =>
LinkingManager.getInitialURL(),
)
: LinkingManager.getInitialURL();
}

/*
Expand Down

0 comments on commit a92f8b2

Please sign in to comment.