I can not figure out if this should work or not.
According to this post it should NOT work. But it's also from 2017.
According to this it should be stored in the Keystore services, which seems to only be erased if you log out.
Played a couple of other games that I'm confident uses firebase as well, and they seem to be able to log me back in after I uninstall the app (without connecting to Facebook or similar)
Also as a side note iOS keeps the credentials also after uninstall and are able to log back in
Related
I am trying to use phone auth from firebase and I get this error now.
Unable to process request due to missing initial state. This may happen if browser session storage is inaccessible or accidentally cleared.
This was working a week ago and no longer works.
I have solved this by registering my app with SafetyNet with SHA2. To do this follow these steps:
Get your SHA2. If you don't know how to get this, follow this tutorial:
https://www.youtube.com/watch?v=kLaNnuoqnmA
Note. This youtube link is for SHA1 but you will notice that SHA2 will be shown here if you pay attention.
Go to your Firebase Console then, go to Project Settings > App Check. You will notice your app is "Unregistered." click this to register your app.
Enter the SHA2 you copied and Accept some terms below then click Save. you will notice the "Registered" with green check icon.
Btw, this error happens on one of my devices but not on another. I also searched through this error and no one has solved this including this page. This happens in my phone authentication using firebase when getting an OTP as I send my phone number. The app tries to redirect you to a browser for Recaptcha for verification if you don't have SafetyNet. Thus, having no SafetyNet will cause your app to always be redirected for Recaptcha which sometimes causes an error. Thus, to solve this, register your app with Safety Net. to understand this, read this documentation.
https://firebase.google.com/docs/auth/android/phone-auth?authuser=0
Focus on 2. Enable App Verification and you will notice that recaptcha is just an alternative for SafetyNet.
It had on the Ionic/Angular/Capacitor app too. i.e. Android and Chrome. Firebase Auth with Microsoft Login.
So I have cleared all the chrome browser data on the Android device and then no issues. i.e. working fine now.
More workarounds: https://github.com/firebase/firebase-js-sdk/issues/4256
I experienced the issue with an iphone web app. I went into Settings -> Safari and disabled 'Prevent Cross-Site Tracking'.
My question is concerning the Android app data backup feature configured by android:allowBackup in the manifest, as documented here. As I understand it, this backed-up app data is restored when the user uninstalls and later re-installs an app from the play store.
In this scenario, when exactly is the data restoration done? Is it:
During installation from Play Store, before user has ability to open app
After installation is complete, potentially allowing user to open app before the restore is done
Our users are on slow internet connections and a few have reported scenarios where data they entered shortly after a reinstall is replaced by old data from past backups. If the Google backups are to blame, this seems to suggest that the restore is done after install (#2 above), but I can't find concrete information to back this.
I'm slightly skeptical because this backup feature is enabled by default. If this overwriting can indeed happen on reinstalls, this would mean all android apps under android 6+ will have encountered issues where first-time setup data (auth tokens and such) is overwritten when a restore is applied. Does anyone have any links or anecdotal information on whether this theory is correct?
Auto backup in android
Check "Restore schedule" para which says that restore happens after the APK is installed, but before the app is available to be launched by the user. BTW if you want to handle Autobackup, you can follow the setup step on codelab Autobackup setup for Android Codelab
I've got an Android application that uses Firebase password and email authentication and the real time database. This all works completely fine when the user has just logged in.
However maybe a few hours later data will stop being shown even if the data changes in the database, it almost seems as though the user is no longer authenticated. But when I connect my device to the adb I can see in the log that the user is logged in with the correct uid and there are no errors being reported. The only strange thing I noticed is that there is no network requests in the network monitor.
Can anyone shed some light on what is happening? I'm not sure if it's a database problem or an authentication problem. I can provide any information needed
EDIT
Marked answer down below but also take a look at these instructions also when adding your SHA1 Keys to firebase, add both production and dev copies
You need to add SHA1 of your debug and production certificates to Firebase console.
It is needed so firebase knows your app has access to refresh access token.
Docs Reference: https://firebase.google.com/support/guides/launch-checklist
My app uses Google App Engine as backend and it provides google plus & facebook login option to user.
One of the endpoint Api takes user profile picture url as input parameter and tries to store it in the user profile table. My endpoint Api was not getting called successfully when user choose the option of google plus as login,
I have narrowed down the issue to find out that it only happens during google plus login scenario and from the backend logs I see the issue is only because of below parameter which is profile photo url.
https:%2F%2Flh3.googleusercontent.com%2F-xPc6TIzQiFA%2FAAAAAAAAAAI%2FAAAAAAAAAeU%2FUIIpz-4G1dQ%2Fphoto.jpg%3Fsz=400
Backend Request from logs(Data changed for privacy reasons).
/_ah/api/registrationAPI/v2/XXXXXX/Rahul%20Purswani/rahulfhp#gmail.com/https:%2F%2Flh3.googleusercontent.com%2F-xPc6TIzQiFA%2FAAAAAAAAAAI%2FAAAAAAAAAeU%2FUIIpz-4G1dQ%2Fphoto.jpg%3Fsz=400/XXX/YYY/VVV, returning NOBODY to imply authentication is in progress.
My Api Class Declaration :
#Api(name="registrationAPI",
version="v2",
namespace=#ApiNamespace(ownerDomain="backend.XXX.XXX.YY",ownerName="backend.XXX.XXX.YY",packagePath=""))
public class PlayerRegistrationEndPoint {
}
And to my surprise this only happens when I test the Api on local development server through real device. If I deploy my api all works fine, I have spent almost the day to narrow it down, If you have any clue about it that will be really appreciable.
Are you accidentally logging the bytes of your pictures using logging.info(), logging.error(), print, etc? Logging bytes to either the logger or standard out can make the dev instances (or even production instance) go into zombie mode.
This has happened to me many times. Check all logs to make sure you aren't trying to log something that isn't a basic variable type.
I was getting this issue since we migrated our code base from Eclipse to Android Studio, during this migration our app-engine sdk version got changed from 1.9.22 to 1.9.18.
Looking back and doing comparative analysis with why it used to work with eclipse, I tried using 1.9.22 app-engine sdk here and issue got resolved, the zombie behavior is no more and even in development environment everything is stable now.
I also checked & removed all the loggers and out statements, though the issue was not fixed with trying that alone.
Thanks for even letting me know that it can also go wrong in future during development environment testing.
I'm trying to understand: On Android, How does TestFlight determine that it is in a beta-tester environment, and should upload activity to the TestFlight server? There have been some similar questions asking about TestFlight on iOS, but none related to Android.
I've integrated the TestFlight SDK into my company's Android app because it looked like a great solution for beta-testing and remote logging (we already use it for iOS), but I'm can't get it to actually send the session information to the TestFlight server. Once I install my app through the TestFlight app, I immediately see that it was installed through the TestFlight web console, and then... nada. I get no session data or remote logs, even though I clearly should be getting something.
What I have done so far:
Quadruple-checked my TestFlight api key
Verified for certain that TestFlight.takeOff() is getting called
Verified that TestFlight.isActive() reports true
Tried signing the apk with the debug-only key
Tried signing the apk with our release key
Checked the android log for errors related to TestFlight (none)
Contacted TestFlight support a couple days ago (I've made contact, but no progress yet)
My current guess is that the TestFlight lib thinks it is in a production environment, and therefore it should not be uploading logs and session information.
The SDK Documentation has nothing to offer to answer this question, but I feel that if I understood what conditions it is looking for I could nail this down pretty quickly.
I poked into TestFlightLib.jar and found that TestFlight.isActive() is really only reporting whether or not you've already called TestFlight.takeOff(), so that's not a good indicator of whether the whole system is working.
Edit: per Isra's answer below, it looks like my first point (batching checkpoints) may no longer be valid.
After trading a few emails with TestFlight support, I am seeing events and have a better understand of what is going on. There are two issues:
TestFlight for Android batches checkpoint events and sends them to the server once 10 or more events are collected. Events are not preserved across app process lifetimes. My test app was only creating two or three checkpoints, thus nothing ever got sent to the server.
There is an apparent issue where log events are not posted to the server at all unless the TestFlight session is explicitly ended with TestFlight.endSession()
So, the workaround (for now) is to explicitly call TestFlight.endSession() periodically. Hopefully TestFlight will change (or at least document) this behavior in future releases of the library.
I am going to make a comment on the checkpoint front. I can see checkpoints being reported straight away without needing to end sessions. Looks like they removed the batching on Android
We made it work by calling TestFlight.startSession() on our activities onStart and TestFlight.endSession() on onStop.
The extra steps are not documented in TestFlight SDK, but it seems to force the app to send session logs to TestFlight servers.