https://gist.github.com/sturmenta/cbbe898227cb1eaca7f85d0191eaec7e#gistcomment-2837988
ok can use. good job.
timestamp have error.
bootstrap + web firebase realtime + firebase storage
Auth:Use Email&password then input one user with email & password. Login use be added user.
index.html <!doctype html> <html lang="zh-Hant-TW"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <!-- Bootstrap CSS --> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> <link type="text/css" rel="stylesheet" href="https://cdn.firebase.com/libs/firebaseui/4.0.0/firebaseui.css" /> <title>Hello, world!</title> </head> <body> <div class="container"> <div id="firebaseui-auth-container" class="alert alert-light" role="alert"></div> </div> <div class="container my-1"> <div class="row"> <div class="col-sm">Login Status <div class="user-signed-in" style="display: none;"><span class="badge badge-pill badge-success">user-signed-in</span></div> <div class="user-signed-out" style="display: none;"><span class="badge badge-pill badge-secondary">user-signed-out</span></div> </div> <div class="col-sm"><a class="btn btn-outline-primary" data-toggle="collapse" href="#multiCollapseExample1" role="button" aria-expanded="false" aria-controls="multiCollapseExample1">Account Details</a> <div class="collapse multi-collapse" id="multiCollapseExample1"> <div class="card card-body"> <pre id="account-details">.
https://www.oxxostudio.tw/articles/201904/firebase-realtime-database-rules.html
https://angularfirebase.com/lessons/understanding-firebase-database-rules-by-example/
ERR_TOO_MANY_REDIRECTS
Or
Error 526
SSL change Full or Full (strict)
just try
best easy know
1、auth != null – only auth pass user ( login success user)
2、$uid === auth.uid – usually only data owner can read or modify
$userId === auth.uid
==========
1、only admins group can wirte data
a. Database data
add admins -> add uid:true (uid -> user in admins group)
b. Database rule
add
{
“rules”: {
“admins”:{
“.read” : “auth != null && root.child(‘admins’).hasChild(auth.uid)”,
“.write” : “auth != null && root.
https://forum.ionicframework.com/t/push-notifications-with-ionic-2/63851/4
https://github.com/fechanique/cordova-plugin-fcm
=====
https://www.youtube.com/watch?v=7yXtzhqT1uk
https://medium.com/@ankushaggarwal/push-notifications-in-ionic-2-658461108c59#.ff6hz41ot
.sender_id who is sender or This guy is send message.
.FCM_token (api_key) it’s right to use FMC, who get token, then can send
.Device token this device (which device)
Where is come from?
.sender_id 、 FCM_token from FCM (firebase)
.Device_token from device
How to get?
.sender_id 、 FCM_token : login firebase console -> settings -> colud messageing
.Device_token : If ionic2, when you use
Push @ionic/cloud-angular push.
https://github.com/rodrigoreal/ionic2-angularfire-login
==========
https://github.com/angular/angularfire2/issues/560
https://blog.khophi.co/angularfire2-authentication/
https://github.com/angular/angularfire2/issues/568
https://github.com/angular/angularfire2/issues/566