firebase api key code example

Example 1: api key firebase

Go to project settings, and then to Cloud Messaging, there you can find your api key

Example 2: firebase find api key

Navigate to your firebase project, then find project settings, there you will find your API key and other useful information

Example 3: how to get the API KEY of my firebase project

You can open the project in the firebase, then you should click on the project settings, then goto project settings you will see the web API Key there

Example 4: using firebase with react key value

componentDidMount() {
  const itemsRef = firebase.database().ref('items');
  itemsRef.on('value', (snapshot) => {
    let items = snapshot.val();
    let newState = [];
    for (let item in items) {
      newState.push({
        id: item,
        title: items[item].title,
        user: items[item].user
      });
    }
    this.setState({
      items: newState
    });
  });
}

Tags:

Go Example