Posts

Showing posts with the label storage

Firebase Database in Android with Phone Authentication - Kotlin

Image
Configure Database: (a) Go to https://console.firebase.google.com/ (b) Then click Add Project , a dialog will be prompted. Enter project name and choose country in it and click on Create Project . (c) Click on Add Firebase to your Android App, another dialog will be prompted. In that, enter package name and SHA-1 (compulsary for using Database) and click Register App . (d) Then download google_services.json file, by clicking download button and put that file in your module's root directory. (e) Then navigate to Database on Side tab and click on Get Started. Initially the Database rules will be like, { "rules" : { ".read" : "auth != null" , ".write" : "auth != null" } } Below rule is to allow everyone to read and write data without any authentication. { "rules" : { ".read" : true , ".write...

Firebase Storage - Upload Files - Kotlin

Image
Let's see how to upload the file to Firebase storage and download the same. Its really easy to upload files to Storage and it supports any type of files.  Preparing Firebase Console: (a) Go to https://console.firebase.google.com/ (b) Then click Add Project , a dialog will be prompted. Enter project name and choose country in it and click on Create Project . (c) Click on Add Firebase to your Android App, another dialog will be prompted. In that, enter package name (SHA-1 and App Nickname are optional) and click Register App . (d) Then download google_services.json file, by clicking download button and put that file in app's folder. (e) After that click on Storage on Side tab. Then click on Rules in that page. Make changes as follows: Code: project-level gradle: Add google service in dependencies buildscript { ext.kotlin_version = ' 1.2 . 10' repositories...