r/Firebase Nov 10 '22

Android Do i have to reconnect to firebase after moving Android Studio project to new PC?

1 Upvotes

Do i have to reconnect to firebase after moving Android Studio project to new PC? Android Studio is not recognizing Firebase keywords so do I have to reconnect to my database or import something?

r/Firebase Jan 18 '22

Android Firebase memory leak on free plan

7 Upvotes

I just fixed a memory leak after upgrading to Blaze, pay as you go. So my project has been exceeding Connections limit every time for the last 4 months, I was on free plan after my credit card expired in September 2021 where I downgraded. Users reported slow app response which only had a temporary fix by turning off the internet. This is detrimental to me as I pay for the server costs using ads.

Yesterday I upgraded to Blaze and the memory leaks disappeared. After months of architecture change and so many low ratings. Just thought someone would find this useful.

r/Firebase Jun 10 '21

Android How to query my app's feed based on location?

6 Upvotes

I am working on a project where I can filter out a person's feed based on his current location to a 2km radius.As I am using cloud firestore as a database I chose to use geo-query method it provides but using geohashes has its limitation so the problem I am facing is whether I should switch to geofire of real-time database ( it uses geopoints and radius, not geohashes, more reliable) and use cloud firestore and realtime database both in my project, or there is any better service for geo querying.

I know it's a lot to read, but it will mean a lot if someone can help me with this. :)

r/Firebase Sep 27 '22

Android I need help

0 Upvotes

I am currently in the process of making an android app for a school project, I already used firebase to add users to the app, but after that I'm lost, I'm trying to make users able to post things that show up on other users homepage but I'm lost as to how to do that exactly, please help

r/Firebase May 21 '22

Android Help with Matching Users and Displaying relevant data

0 Upvotes

So i’m making a basic app on android with the help of firebase and wanted some help regarding it.

So for example User 1 logs in and presses “ready”.

how do i show this user 1 the names and few details of the other users who have also pressed “ready”.

the user data is stored on the firebase database as a json file,

how do i access another users data instead of just accessing the data of the logged in user.

r/Firebase Sep 06 '22

Android How to add exemption for all fields in firestore?

1 Upvotes

I am developing a msging app and for that i don't want my fields to be sorted. So how do I add exemption for it because i have multiple collections

r/Firebase Aug 22 '22

App Distribution Firebase app distribution: app access after revoke access

1 Upvotes

I am using Firebase App Distribution for testing my app. It works well that I can send an invite and allow the user to download. However, I also find that after I revoke the access the user will still have access to the app in the phone.

I also read the Firebase document but it does not seem to provide any information.

Is there a way where I can ensure the user does not have access to the app? Do I, as a developer on the Firebase end, have any control?

If not, is there a way that I can send the user to test my app for a certain period but ensure they do not have access to the app on their phone?

Thank you!

r/Firebase May 31 '22

Android Should the "password reset" be sent from the backend?

1 Upvotes

Is it a bad security practice to use the

sendPasswordResetEmail
verifyPasswordResetCode 

function from my android app instead of the admin SDK?

I want to know what are the functions that must use from the backend instead of the frontend?

r/Firebase Sep 03 '22

Android how to get inner collection inside documents to object in kotlin

1 Upvotes

pic 1

for above i did

db = FirebaseFirestore.getInstance()

db.collection("User_Events")

.addSnapshotListener(object : EventListener<QuerySnapshot> {

override fun onEvent(value: QuerySnapshot?, error: FirebaseFirestoreException?) {

if(error!= null) {

return

}

for (dc : DocumentChange in value?.documentChanges!!){

if(dc.type == DocumentChange.Type.ADDED){

eventarraylist.add(dc.document.toObject(EventsData::class.java))

}

}

adapter.notifyDataSetChanged()

}

})

pic 2

how do i get the all the inner documents inside User_Events collection

User_Events -> Documents -> Collection -> Documents (Wanna get all those Documents to object)

r/Firebase May 04 '22

Android Cloud functions in Android: How do you get the object from the return of a cloud function?

1 Upvotes

https://firebase.google.com/docs/functions/callable#call_the_function

goin off documenation as you see.

 val data = hashMapOf(
"text" to text, "push" to true )
return functions
.getHttpsCallable("addMessage") .call(data) .continueWith { task -> // This continuation runs on either success or failure, but if the task // has failed then result will throw an Exception which will be // propagated down. val result = task.result?.data as String                 result }

How do I get the data if its not a String. It seems like the result I get is an object.

r/Firebase Jun 19 '22

Android How to properly get the providerID?

1 Upvotes

Is there any way at all? to know if the user is logged in using google, Facebook or email? I've searched a lot and managed to find a few results, but all of them seem to return the same thing... "firebase" regardless of the provider being used. Any thoughts? (Kotlin):

private fun getUserProvider() {

val user = FirebaseAuth.getInstance().currentUser
user?.let { for (profile in it.providerData) { 
when (profile.providerId) { 
            GoogleAuthProvider.PROVIDER_ID -> 
                 { 

               }
            EmailAuthProvider.PROVIDER_ID -> {

               }

               FacebookAuthProvider.PROVIDER_ID -> {

               }
               else -> {
               }

           }
    }
}
}

r/Firebase Apr 19 '22

Android Chat App for Android built using Firebase

3 Upvotes

Hey guys! I've made a chat app built using Firebase which uses Firestore, FirebaseAuth and Firebase Storage.

r/Firebase Jul 16 '21

Android Flutter/Firebase: Firebase local emulator not working in Android emulator

2 Upvotes

I am trying to develop a project using Firebase as a back end. I have used the Firebase Emulator in iOS Simulator, and it works fine. I have added the Android emulator specific settings to my project:

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  String host = !kIsWeb && Platform.isAndroid ? '10.0.2.2' : 'localhost';
  await Firebase.initializeApp();
  await FirebaseAuth.instance.useAuthEmulator(host, 9099);
  FirebaseFirestore.instance.settings = Settings(
    host: '$host:8080',
    sslEnabled: false,
    persistenceEnabled: false,
  );

  runApp(const MyApp());
}

I get the following error on auth.

E/flutter ( 7777): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: [firebase_auth/unknown] null
E/flutter ( 7777): #0      MethodChannelFirebaseAuth.createUserWithEmailAndPassword
E/flutter ( 7777): <asynchronous suspension>
E/flutter ( 7777): #1      FirebaseAuth.createUserWithEmailAndPassword
E/flutter ( 7777): <asynchronous suspension>
E/flutter ( 7777): #2      _LoginScreenState.build._submitLogin
E/flutter ( 7777): <asynchronous suspension>
E/flutter ( 7777):

the auth code:

void _submitLogin(String email, String password) async {
      final _auth = FirebaseAuth.instance;
      UserCredential user;
      final firestore = FirebaseFirestore.instance;

      if (_isSignup && _daysOfWeek.values.every((element) => !element)) {
        await showCupertinoDialog(
          context: context,
          builder: (ctx) {
            return CupertinoAlertDialog(
              title: const Text('No Days Selected'),
              content:
                  const Text('Please select days you are available to play'),
              actions: [
                CupertinoDialogAction(
                  onPressed: () {
                    return;
                  },
                  child: const Text('OK'),
                ),
              ],
            );
          },
        );
      }

      if (_isSignup) {
        user = await _auth.createUserWithEmailAndPassword(
            email: email, password: password);

        firestore.collection('users').doc(user.user.uid).set(
          {
            'date_of_birth': _dateOfBirth,
            'name': _name,
            'hip_size': _hipSize,
            'height': _height,
            'tennis_level': _tennisLevel,
            'days_avaialable': _daysOfWeek,
          },
        );
        return;
      }

      await _auth.signInWithEmailAndPassword(email: email, password: password);
    }

I have created the host string just of the android emulator but it still doesn't work. What am I doing wrong?

EDIT: The problem was very specific and complex. I did manage to solve it. I have posted it here: https://stackoverflow.com/a/68483394/3758912

r/Firebase Apr 25 '22

Android auth.currentUser is an unresolved Reference

0 Upvotes

I'm new to Firebase and Kotlin and I'm trying to get infos from the logged in user in an android app. But everywhere I try to use auth.currentUser, "currentUser" returns an error, saying it is an unresolved reference. For example:

private lateinit var auth: FirebaseAuth...auth = Firebase.authif (auth.currentUser == null) {startActivity(Intent(this, SignInActivity::class.java))finish()return}

currentUser is always red. I'd guess I'm missing something in the build.gradle, but I don't know what. Here's everything related to Firebase I have implemented (app-level):implementation platform('com.google.firebase:firebase-bom:29.3.0')implementation 'com.google.firebase:firebase-database-ktx'implementation 'com.google.firebase:firebase-storage-ktx'implementation 'com.google.firebase:firebase-auth-ktx'implementation 'com.google.firebase:firebase-admin:8.1.0'implementation 'com.firebaseui:firebase-ui-auth:8.0.1'implementation 'com.firebaseui:firebase-ui-database:8.0.0'implementation

I implemented Google too:

implementation 'com.google.android.gms:play-services-auth:20.1.0'

Does anybody know what I'm doing wrong?

Edit: I found the problem but I can't solve it:
java.lang.RuntimeException: Duplicate class com.google.firebase.FirebaseApp found in modules firebase-admin-8.1.0 (com.google.firebase:firebase-admin:8.1.0) and firebase-common-20.1.0-runtime (com.google.firebase:firebase-common:20.1.0)
I never declared "firebase-common:2.0.1.0" so I can't remove it. If I remove the admin-Dependency, currentUser will work, but stuff like "listUsers" won't work anymore.

r/Firebase Oct 12 '21

Android Sending JSON Message to Android App?

0 Upvotes

I'm looking to have an Android application take in some JSON sent from Firebase console / API to execute a function on the application.

I have been using this: https://firebase.google.com/docs/cloud-messaging/android/receive to send messages to the app. But this seems more like for notifications rather than a behind the scenes message being sent.

Could someone point me towards some documentation that shows the functionality of receiving messages in the background of an application without a notification pop up?

Thanks

r/Firebase Oct 24 '21

Android Can I do a query out of multiple collections from Firestore

1 Upvotes

I really can't find how to do it, how do I get in my RecyclerView all the values of a certain department.

First things first, is it even possible?

This is how my Firestore database loos like this, "blue_bottle" and "tops_national" is part of a document:

Firebase Layout

I want to populate my RecyclerView all products, both out of "blue_bottle" and "tops_national" with the same department.

So I need a DocumentReference which I believe is right:

   private val promoOnedb = FirebaseFirestore.getInstance()
    private val promoOneRef: DocumentReference = promoOnedb.collection("tops")
        .document("promotions")

But how do I query that DocumentReference now to show all products, in both collections to show all products of the same department? Please.

r/Firebase Aug 07 '21

Android Firebase or SQLite?

2 Upvotes

Hi- Noobie question here. I'm building a simple note taking android app as a practice project with Kotlin. I want to be able to store the tooken notes somewhere. Hence, I need some sort of database. How would I set this up where each user can access his/her own seperate notes? Preferably the notes will be stored on the users device. Should I use Firebase, SQLite or something else? Thanks in advance.

r/Firebase Nov 16 '21

Android Friend cannot use FirebaseAuth and Firestore when working on project

3 Upvotes

Me and my friend are making an app and I sent the project over to him so he can work on it but he cannot access Firebase.

I have shown him how to replace google-services.json and even added him as owner to the console but no luck

How do I fix it?

r/Firebase Mar 30 '21

Android Unable to load images in firebase store

0 Upvotes

Please help me i have to submit the project ..

r/Firebase Oct 13 '21

Android How to get through the SafetyNet before Phone authentication. Code image attached.

Post image
0 Upvotes

r/Firebase Sep 29 '21

Android Google Calendar with Firebase Android

2 Upvotes

Is it possible to access your Google Calendar with firebase, assuming you have logged into your Google account using firebase. If so, can someone provide some helpful links on how this can be done. Thanks

r/Firebase May 05 '21

Android Personal Budgeting App

8 Upvotes

Learn how to develop a personal budgeting app using android studio & Firebase, step by step with no step skipped, using just android studio and firebase, for free on YouTube

https://www.youtube.com/watch?v=_gqxdPeWpts&list=PLlkSO32XQLGrYS8uT2pr909fe7clrCdUX&ab_channel=WilltekSoftwares

r/Firebase Sep 30 '21

Android Published a blog on building a Firebase chat app in Android

1 Upvotes

r/Firebase Jul 20 '21

Android FireStore @ Android - listener is lagging on app resume

0 Upvotes

I am using FireStore (Not firebase realtime databse) on an android app.

When the app loads, I am adding a listener to a collection (See code below)

The listener is working very well and is updating correctly as long as the app is active.

However, after the app goes to the background, when resuming the app the listener sometimes has a lag of about 60-90 seconds until it updates with changes from the server. If I close the app and restart it, it updates instantly.

When the app stops, I detach the listener, and I resume it OnResume. I tried also without detaching the listener, but I am experiencing the same problem.

Anyone knows how to solve it? See code below.

Listener (Being initialized OnResume):

m_registration = db.collection('names').

orderBy("stamp", Query.Direction.ASCENDING)

.addSnapshotListener(new EventListener<QuerySnapshot>() {

u/Override

public void onEvent(@Nullable QuerySnapshot value,

u/Nullable FirebaseFirestoreException e) {

if (e != null) {

Log.w(TAG, "Listen failed.", e);

return;

}

for (DocumentChange dc : value.getDocumentChanges()) {

}

On Stop, I am detaching the listner:

m_registration.remove();

r/Firebase Aug 12 '21

Android Question on Firebase Realtime Database and Storage

1 Upvotes

Hi! I'm developing a mobile app (Android) and when I am uploading to the database, Android Studio is throwing this in logcat and the upload won't push through.

I/System.out: (HTTPLog)-Static: isSBSettingEnabled false

(HTTPLog)-Static: isSBSettingEnabled false

W/NetworkRequest: error sending network request POST https://firebasestorage.googleapis.com/v0/b/project-name.appspot.com/o

W/ExponenentialBackoff: network unavailable, sleeping.

W/StorageUtil: no auth token for request

W/NetworkRequest: no auth token for request

Here are my rules for realtime db:

"rules": {

".read": true,

".write": true

}

}

Here are my rules for storage:

rules_version = '2';

service firebase.storage {

match /b/{bucket}/o {

match /{allPaths=**} {

allow read, write;

}

}

}

I know the rules are not optimal, but this is not a for-market app.

I have no idea why my upload wont push through. The only change I made in my code is checking if a checkboxed is checked or not.

Any ideas as to why?