Bug: handleResponse with deeplink crashes the app on iOS
upacyxou opened this issue · 7 comments
Describe the bug
When using the handleResponse
function from @coinbase/wallet-mobile-sdk
inside a React Native component with a Linking
url
listener in a useEffect
hook, the app crashes upon opening a deeplink (e.g., app://email?domain=domain&token=very-long-token
).
Steps
- Create a React Native component with a
Linking
url
listener in auseEffect
hook. - Add the handleResponse function from
@coinbase/wallet-mobile-sdk
as the listener. - Open the app's deeplink (e.g.,
app://email?domain=domain&token=very-long-token
). - Notice that the app crashes.
Expected behavior
The app should not crash when handling the deeplink with the handleResponse
function.
Version
1.0.6
Additional info
import { Linking } from 'react-native'
import { handleResponse } from '@coinbase/wallet-mobile-sdk'
import { useEffect } from 'react'
function App() {
useEffect(() => {
const sub = Linking.addEventListener('url', ({ url }) => {
handleResponse(url)
})
return () => sub?.remove()
}, [])
return <></>
}
const WrapperApp = App
export default WrapperApp
Desktop
No response
Smartphone
No response
Having the same problem.
Same for me, the app crashes on iOS if you open a deeplink with listener
Year, iOS deeplinks...
Do you have any ideas on how to fix this?
It's strange because I have the same issue on iOS, but Android is fine. Good workaround, but it's better to have a fix in the package
hey all. thanks for reporting the bug.
seems the code you shared looks pretty much the same as our example, which doesn't crash btw.
can you share the error message you are getting?
hey all. thanks for reporting the bug. seems the code you shared looks pretty much the same as our example, which doesn't crash btw. can you share the error message you are getting?