/* @flow */

import ReactNative from 'react-native';
import { bus } from '../../core-client';

const {
	Linking
} = ReactNative;

bus.on('state:init', async () => {
	const initialURL = await Linking.getInitialURL();

	bus.emit('change', {
		state: {
			initialURL
		}
	});
});

/* @flow */

import ReactNative from 'react-native';
import { bus } from '../../core-client';

const {
	Linking
} = ReactNative;

bus.on('state:init', () => {
	Linking.getInitialURL()
	.catch(() => null)
	.then(initialURL => {
		bus.emit('change', {
			state: {
				initialURL
			}
		});
	});
});

Handle error when getting initial URL
Handle error when getting initial URL
