I have created a barcode scanner app in which I'm unable to connect it with firebase.(in the blocks)

Well none of your blocks show anything to do with Firebase, so it is not surprising you are unable to connect ?

Actually I'm not familiar with the firebase, so can you help me connect with it to my backend

Why Firebase then ? Are you "familiar" with any other online databases ?

http://ai2.appinventor.mit.edu/reference/components/experimental.html#FirebaseDB

or

Firebase with a Web component