Last active
May 25, 2017 11:42
-
-
Save ShaileshPrajapati-BTC/ce072e816e4be5cd888879160990fb18 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
import React,{Component} from 'react'; | |
import FCM from "react-native-fcm"; | |
export default class Home extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
fcm_token: "" | |
}; | |
} | |
componentDidMount () { | |
FCM.requestPermissions(); | |
FCM.getFCMToken().then(token => { | |
this.setState({fcm_token:token}); | |
//update your fcm token on server. | |
}); | |
} | |
render() { | |
return ( | |
<View> | |
<Text>FCM Setup</Text> | |
</View> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment