firebase-authentication

Get Last Seen in chats application

ぃ、小莉子 提交于 2019-12-17 16:53:16
问题 I have created this chat application with firebase realtime database and firebase authentication methods but i am really confused and I don't exactly know how to get the last seen of user in a chat application. Here is code that I try in my onCreate medthod . @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_chat_avtivity); mauth = FirebaseAuth.getInstance(); currentUser = mauth.getCurrentUser(); String onlineID

“Unable to get provider com.google.firebase.provider.FirebaseInitProvider” Error path Android

假如想象 提交于 2019-12-17 16:24:55
问题 I have an Application which is connected to firebase.The problem is when install the app in device(working on several devices).I read a lot of forums and no one works.I read here and this and so on.Thanks!! The error is here. E/AndroidRuntime: FATAL EXCEPTION: main Process: com.dev.ptruck, PID: 8833 java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider

How to only allow one admin user to write Firebase Database?

依然范特西╮ 提交于 2019-12-17 16:13:57
问题 I am trying to set up a Firebase database that only I can write. So no user will have permission to write anything. But everyone will be able to read it. However, I could not set up the rules for it. I have one admin user that I created using Email/Password login, and I know its UID. Let's say my UID is: dJrGShfgfd2 I tried these two methods, but they didn't allow me to write to database. { "rules": { "events": { ".read": true, ".write": "auth.uid === 'dJrGShfgfd2'" } } } . { "rules": {

Firebase Android onAuthStateChanged called twice

空扰寡人 提交于 2019-12-17 15:43:04
问题 I've start working with new Firebase SDK. When I'm doing user login, I'm onAuthStateChanged method is being called twice with same state (etc. user sign in). I'm sure I'm adding the AuthStateListener only once to the FirebaseAuth reference. Any help? 回答1: Yes, and this is very annoying. This is due a registration call. Not only that, onAuthStateChanged is going to be called many times in many different states, with no possibility of knowing which state it is. Documentation says:

Firebase 3: creating a custom authentication token using .net and c#

时光总嘲笑我的痴心妄想 提交于 2019-12-17 15:35:48
问题 I'm trying to implement Firebase 3 Authentication mechanism using Custom Tokens (as described at https:// firebase.google.com/docs/auth/server/create-custom-tokens). My server is ASP.NET MVC Application. So according to the instructions (https://firebase.google.com/docs/server/setup) I've created a service account for my Firebase application and generated a key in '.p12' format. After that according to instructions here (https://firebase.google.com/docs/auth/server/create-custom-tokens#create

Flutter: Build failed with an exception

 ̄綄美尐妖づ 提交于 2019-12-17 14:52:05
问题 I am trying to use FirebaseAuth in a flutter application. I can use Firestore service but when i include firebase_auth depedency in pubspec.yaml file i got the following exception. FAILURE: Build failed with an exception. * What went wrong:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. > java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex * Try:Run with --stacktrace option to

How to implement a role based access control with AngularFire

て烟熏妆下的殇ゞ 提交于 2019-12-17 14:27:35
问题 My understanding is that I need to undertake the following steps: Make the users' roles read-only Use security rules on the data which access the roles to control access Check for the role in the router There are various examples on the official documentation how to deal with the security rules, but I couldn't figure out how to check for the role in the router. Let's assume I have an admin-only area, if someone who is not an admin tries to access that page I want that user to be redirected. I

Security rule to only allow write for users with verified emails

我只是一个虾纸丫 提交于 2019-12-17 14:07:48
问题 I have very simple write security rule that should only allow users with verified email to write data, "someNode": { ".write": "auth.token.emailVerified === true" } For some reason I am still getting permission denied in simulator with specific users token and in my app with same user. I double checked user object in client and it indeed has emailVerified === true hence I am not sure to why this is not working. Screenshot: 回答1: Turns out auth.token.emailVerified should be auth.token.email

firebase.auth().createUserWithEmailAndPassword Undefined is not a function

穿精又带淫゛_ 提交于 2019-12-17 12:36:55
问题 I am following the firebase documentation on user management var firebase = require('firebase'); // Initialize Firebase firebase.initializeApp({ serviceAccount: "./<mysecreturledittedout>.json", databaseURL: "https://<mydatabaseurljusttobesafe>.firebaseio.com" }); router.get('/create', function(req, res){ var email = req.email; var password = req.password; firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(err){ // LINE 27 CRASH var errorCode = err.code; var

Class file for com.google.android.gms.internal.zzaja not found

会有一股神秘感。 提交于 2019-12-17 10:57:26
问题 I am using Fragment for the designing of the Firebase simple login registration. I get error in the OnCreateView() method on initializing auth = FirebaseAuth.getInstance(); error:- Error:(58, 28) error: cannot access zzaja class file for com.google.android.gms.internal.zzaja not found please help source:- http://www.androidhive.info/2016/06/android-getting-started-firebase-simple-login-registration-auth/ 回答1: I solved this exact problem today and stumbled onto this unanswered question by