diff --git a/app/App.tsx b/app/App.tsx index 8dbb5576e..1a62eb9e7 100644 --- a/app/App.tsx +++ b/app/App.tsx @@ -15,11 +15,12 @@ import { initLanguages, ContainerProvider, MainContainer, + TOKENS, } from '@hyperledger/aries-bifold-core' import { useNavigation } from '@react-navigation/native' import React, { useEffect, useState, useMemo } from 'react' import { useTranslation } from 'react-i18next' -import { StatusBar } from 'react-native' +import { Linking, StatusBar } from 'react-native' import { isTablet } from 'react-native-device-info' import Orientation from 'react-native-orientation-locker' import SplashScreen from 'react-native-splash-screen' @@ -55,6 +56,19 @@ const App = () => { } useEffect(() => { + // this block fixes an issue when deep-link doesn't work + // when the app is fully terminated on Android. + // TODO: review and look for a fix + async function getInitialURL() { + const url = await Linking.getInitialURL() + const logger = bcwContainer.resolve(TOKENS.UTIL_LOGGER) + if (url) { + logger.info(`App launched with URL: ${url}`) + } else { + logger.info('App launched without URL') + } + } + getInitialURL() // Hide the native splash / loading screen so that our // RN version can be displayed. SplashScreen.hide()