Skip to content

Instantly share code, notes, and snippets.

@josefrichter
Created June 24, 2015 15:20
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 josefrichter/22a51857cff06d005262 to your computer and use it in GitHub Desktop.
Save josefrichter/22a51857cff06d005262 to your computer and use it in GitHub Desktop.
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