Why would Android Firebase Connection to RTDB stop connecting but iOS Connection works?

23 Views Asked by At

I have AppCheck and AppAttest added to my iOS and Android app. The iOS app works fine, I'm connected to the internet and when I use my app it connects me to the RTDB. However the Android version of my isn't connecting to the the RTDB (the phone itself can connect to the internet).

In the past I've add issues with AppCheck/AppAttest where App attestation failed as detailed here.

For a little more clarity I launched the app to the PlayStore in November 2023. The app was approved and I added several updates in 12/23 which were also approved. The app 100% connected to RTDB otherwise it nor the updates would've never been approved. The app didn't have any users so it sat dormant (live but no activity) for a few months.

Yesterday someone tried to use the Android version of the app and they couldn't connect. I checked the iOS app version and it works fine. I just check the Android version downloaded from the Play Store and I can't connect either. I ran the app in Android Studio using a real device, switched to Firebase.appCheck.installAppCheckProviderFactory(DebugAppCheckProviderFactory.getInstance(),) and added the debug token to the Firebase Console > AppCheck. When I run FirebaseDatabase.getInstance().getReference(".info/connected") the result is it's not connected.

firebaseConnectedRef = FirebaseDatabase.getInstance().getReference(".info/connected")
firebaseConnectListener = firebaseConnectedRef?.addValueEventListener(object : ValueEventListener {
    override fun onDataChange(snapshot: DataSnapshot) {
        val connected = snapshot.getValue(Boolean::class.java) ?: false
        if (connected) {
            Log.w(TAG, "Firebase is AVAILABLE")
        } else {
            Log.w(TAG, "Firebase is Unavailable") // <-- Always printed in all Activities
        }
    }

    override fun onCancelled(error: DatabaseError) {
        Log.w(TAG, "Listener was cancelled")
    }
})

I've also just updated everything in Android Studio to all of the latest Firebase dependencies/every other dependency but nothing.

I even went to the Firebase console and unenforced AppCheck APIs and the Android app still wouldn't connect.

I have no idea why the iOS app does connect, the Android app did connect, but now the Android app won't connect anymore.

0

There are 0 best solutions below