Skip to content

Instantly share code, notes, and snippets.

@jnsdls
Last active September 13, 2016 08:23
Show Gist options
  • Save jnsdls/de2ae75a63b1c6ba1c8a29a1d35e0894 to your computer and use it in GitHub Desktop.
Save jnsdls/de2ae75a63b1c6ba1c8a29a1d35e0894 to your computer and use it in GitHub Desktop.
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