Last active
September 13, 2016 08:23
-
-
Save jnsdls/de2ae75a63b1c6ba1c8a29a1d35e0894 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
componentDidMount() { | |
// turning on the device camera when we load the app (it'll stay on in the background) | |
this.props.bebo.Camera.previewOn(); | |
// we'll use our wrapped Bebo SDK to get the acting user and set it to the app's state | |
this.props.bebo.User.getUser('me', (err, user) => { | |
if (!err) { | |
this.setState({ actingUser: user }); | |
} | |
}); | |
// we'll get the initial 50 photos | |
this.getPhotosFromDB(); | |
} | |
componentWillUnmount() { | |
// when we're leaving the app, we'll turn the device camera off | |
this.props.bebo.Camera.previewOff(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment