Created
June 4, 2019 08:21
-
-
Save nwaughachukwuma/6976b1f087c5f9490313ebf3f3249146 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 {Platform, Linking} from 'react-native' | |
import firebase from 'react-native-firebase' | |
firebase.links() | |
.getInitialLink() | |
.then((url) => { | |
if (url) { | |
// app opened from a dynamic link URL | |
} else { | |
// use deep link to handle the URL. | |
if (Platform.OS === 'android') { | |
Linking.getInitialURL() | |
.then((url) => { | |
// do something with the URL | |
}) | |
.catch(err => err); | |
} else { | |
// handle case for iOS | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment