11import type { LinkingOptions } from '@react-navigation/native' ;
22import { findFocusedRoute } from '@react-navigation/native' ;
3- import { Linking , Platform , TurboModuleRegistry } from 'react-native' ;
4- import type { TurboModule } from 'react-native ' ;
3+ import { Linking } from 'react-native' ;
4+ import continuePlaidOAuth from '@libs/continuePlaidOAuth ' ;
55import navigationRef from '@libs/Navigation/navigationRef' ;
66import type { RootNavigatorParamList } from '@libs/Navigation/types' ;
77import CONST from '@src/CONST' ;
88import ROUTES from '@src/ROUTES' ;
99
10- type PlaidNativeBridge = TurboModule & {
11- continueFromRedirectUri : ( urlString : string ) => void ;
12- } ;
13-
14- const plaidNativeBridge = Platform . OS === 'ios' ? TurboModuleRegistry . get < PlaidNativeBridge > ( 'RNLinksdk' ) : null ;
15-
1610const subscribe : LinkingOptions < RootNavigatorParamList > [ 'subscribe' ] = ( listener ) => {
1711 const subscription = Linking . addEventListener ( 'url' , ( { url} : { url : string } ) => {
1812 // Skip GPS distance screen deep links when the user is already on that screen.
@@ -34,7 +28,7 @@ const subscribe: LinkingOptions<RootNavigatorParamList>['subscribe'] = (listener
3428 // Forward the OAuth redirect URI into the Plaid SDK so it can finalize OAuth.
3529 // Without this, the native SDK never sees the callback URL and retries OAuth in a loop
3630 // after app-to-app bank auth returns. See issue #87757.
37- plaidNativeBridge ?. continueFromRedirectUri ( url ) ;
31+ continuePlaidOAuth ( url ) ;
3832 return ;
3933 }
4034 listener ( url ) ;
0 commit comments