Skip to content

Commit

Permalink
chore: testing deep link startup (#2140)
Browse files Browse the repository at this point in the history
Signed-off-by: Clécio Varjão <[email protected]>
  • Loading branch information
cvarjao authored Aug 23, 2024
1 parent fffdd76 commit ca4e825
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit ca4e825

Please sign in to comment.