Last active
June 12, 2020 12:47
-
-
Save jorgemasta/d0e74d1bb672d88e7cfe6466ea7bbd5f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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