Skip to content

Instantly share code, notes, and snippets.

@jorgemasta
Last active June 12, 2020 12:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jorgemasta/d0e74d1bb672d88e7cfe6466ea7bbd5f to your computer and use it in GitHub Desktop.
Save jorgemasta/d0e74d1bb672d88e7cfe6466ea7bbd5f to your computer and use it in GitHub Desktop.
import { Linking } from 'react-native'
import BugTracker from 'BUGSNAG/SENTRY/FIREBASE...'
export const openUnsafeUrl = async (url: string): void => {
try {
const supported = await Linking.canOpenURL(url)
if (!supported) {
BugTracker.sendMessage(`Can't handle url: ${url}`)
}
await Linking.openURL(url)
} catch (error) {
BugTracker.sendException(error)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment