Created
June 24, 2015 15:20
-
-
Save josefrichter/22a51857cff06d005262 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
class LaunchScreen extends React.Component { | |
goTo(route) { | |
this.refs.nav.push(route) | |
} | |
receiveRemoteNotification(notification) { | |
var onPressFollow = function() { | |
console.log("follow"); | |
console.log(this); // says 'undefined' | |
this.refs.nav.push(subScreenRoute); // obviously fails | |
// this.goTo(subScreenRoute); // fails too | |
} | |
AlertIOS.alert( | |
notification.aps.alert.title, | |
notification.aps.alert.body, | |
[ | |
{text: 'OK', onPress: () => console.log('Ok pressed!')}, | |
{text: 'Follow link', onPress: onPressFollow} | |
] | |
); | |
} | |
render() { | |
return ( | |
<NavigatorIOS | |
ref="nav" | |
style={styles.wrapper} | |
initialRoute={{ | |
title: 'Home Screen', | |
component: HomeScreen, | |
}} | |
/> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment