Code repository for Udacity's Firebase in a Weekend: Android course
A new Firebase project is required. Go to firebase.google.com.
{
"messages" : {
"-KdqgvFEYzj3zQEh2W4b" : {
"name" : "user_1",
"text" : "hello!"
},
"-KdqtFtHUFCnUIfjRK-c" : {
"name" : "user_2",
"text" : "hi!"
}
}
}
{
"rules": {
"messages" : {
// only authenticated users can read and write the messages node
".read": "auth != null",
".write": "auth != null",
"$id": {
// the read and write rules cascade to the individual messages
// messages should have a 'name' and a 'text' key or a 'name' and 'photoUrl' key
".validate": "newData.hasChildren(['name', 'text']) && !newData.hasChildren(['photoUrl']) || newData.hasChildren(['name', 'photoUrl']) && !newData.hasChildren(['text'])"
}
}
}
}
Check out Firebase Realtime Database Security Documentation for more information.
Create a folder called chat_photos in the Storage dashboard of Firebase Cosole.
service firebase.storage {
match /b/friendlychat-c780d.appspot.com/o {
match /{imageId=**} {
allow read: if request.auth != null;
allow write: if request.auth != null && request.resource.size < 3 * 1024 * 1024;
}
}
}
Check out Firebase Storage Security Documentation and Firebase Storage Security Rules Reference for more information.
- Authentication in the Console: Authenticate and manage users from a variety of providers
- FirebaseUI-Android on Github
- Add the gradle dependency for messaging
- Go to the Notifications tab in the Firebase Console
- Create your own message to send as notification
- Send the notification *
- See the notification on your Android device
* Make sure that the app is in the background before sending the notifiaction
- Quickly roll out changes to your app's userbase
- Customize your app for segments of your userbase
- Run A/B tests to improve your app
- Instrument your app wiith Remote Config
- Set default parameter values
- Add logic to fetch, activate and get parameter values
- Update service-side default and conditional parameter values
Check out Firebase Remote Config docs for more information.
Firebase Storage Security rule types:
read,writeFirebase Realtime Database rule types:
.read,.write,.validate
Firebase Storage Security rules are not cascading
(A value of true for a parent doesn't cause all children to be true.)Firebase Realtime Database rules are cascading for
.readand.write(A value of true for a parent applies all children below the point where the node was declared true.)