Skip to content

Commit

Permalink
refactor(deeplinks): add more logs (#6351)
Browse files Browse the repository at this point in the history
### Description

As the title

### Test plan

N/A

### Related issues

- Part of ACT-1469

### Backwards compatibility

N/A

### Network scalability

N/A
  • Loading branch information
satish-ravi authored Dec 10, 2024
1 parent dbbb667 commit e80f3de
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/useDeepLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ export const useDeepLinks = () => {
Logger.info('useDeepLinks/handleOpenURL', 'Ignoring dynamic link', event.url)
return
}

Logger.debug(
'useDeepLinks/handleOpenURL',
`Handling url: ${event.url}, isSecureOrigin: ${isSecureOrigin}, shouldConsumeDeepLinks: ${shouldConsumeDeepLinks}`
)
// defer consuming deep links until the user has completed onboarding
if (shouldConsumeDeepLinks) {
dispatch(openDeepLink(event.url, isSecureOrigin))
Expand All @@ -44,6 +47,7 @@ export const useDeepLinks = () => {

useEffect(() => {
if (pendingDeepLink && shouldConsumeDeepLinks) {
Logger.debug('useDeepLinks/useEffect', 'Consuming pending deep link', pendingDeepLink.url)
dispatch(openDeepLink(pendingDeepLink.url, pendingDeepLink.isSecureOrigin))
}
}, [pendingDeepLink, address, hasVisitedHome])
Expand All @@ -64,7 +68,7 @@ export const useDeepLinks = () => {
CleverTap.getInitialUrl(async (err: any, url: string) => {
if (err) {
if (/CleverTap initialUrl is (nil|null)/gi.test(err)) {
Logger.warn('useDeepLinks/useAsync', 'CleverTap InitialUrl is nil|null', err)
Logger.debug('useDeepLinks/useAsync', 'CleverTap InitialUrl is nil|null', err)
} else {
Logger.error('useDeepLinks/useAsync', 'App CleverTap Deeplink on Load', err)
}
Expand Down

0 comments on commit e80f3de

Please sign in to comment.