App Check PlayIntegrity Not Working - Firebase Android - android

I have implemented App Check for my application , I have registered Sha256s,activated appcheck in console,initialized it buy it doesnt work with play Integrity !! I always get " Detected invalid AppCheck token. Reconnecting (0 attempts remaining) Firebase Database connection was forcefully killed by the server. Will not attempt reconnect. Reason: Invalid appcheck token" ,
But with safetynet it works well however as we know it will be deprecated
My code:
initialize app check
as you can see if I change play integrity by safetynet it works well ,i can access to my db,but safe net will stop working in about one year
I have already read all posts related to this problem on this web ,but i havent been able to find a solution Thanks in advance

Related

Multiple Accounts suddenly added in Firebase Authentication

I'm currently developing an app which is only accessible by me for now. I can already connect to Firebase but somehow I noticed that there's alot of unknown email added. I'm expecting it to have around 4 email which I have used for testing. May I know why this happened? And will this affect my app if ever I finished developing it?
Note that I didn't share/upload any info/keys that I'm using.
I was thinking that someone might have used my info/keys mistakenly that is why this happens.
If you uploaded your App to the Play Store such accounts are created by Google while they verify your app. That is normal. You don't need to worry about it.
Also see: My Firebase project has unknown users, has my google cloud service account been compromised?

Firebase unable to process request due to missing initial state

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'.

Android Google Play Games Services

Trying to integrate google play games leaderboard in an android application.
Google API client get connected successfully. I am getting result code as -1 which is nothing but RESULT_OK.
But when I call google leaderboard api using leaderboard intent in my on activity result I get 10001 which stands for inconsistent state which is RESULT_RECONNECT_REQUIRED. Even though before calling the intent i am checking is the google api client is connected or not. Which returns true each and every time.
Not able to understand what might be causing this issue.
hope this may help you in solving your problem:
https://code.tutsplus.com/tutorials/google-play-game-services-leaderboards--cms-20700
These links will help u in, Overview : https://code.tutsplus.com/tutorials/google-play-game-services-achievements--cms-20591. Integration :https://code.tutsplus.com/tutorials/integrating-google-play-services-on-android--cms-19828. If you are not satisfied refer this link,https://coronalabs.com/blog/2013/06/25/tutorial-introducing-google-play-game-services/
According to the documentation, RESULT_RECONNECT_REQUIRED is sent back to the calling Activity when a reconnect is required.
The GoogleApiClient is in an inconsistent state and must reconnect to the service to resolve the issue. Further calls to the service using the current connection are unlikely to succeed.
To handle it call googleApiClient.reconnect() and onConnected() will be called when the client is connected again.
The reason you might get that code is because app is not linked. So on play games developer console linked my application and it started to work.

Android In App Billing - Error Retrieving Information From Server

I am using Android in app billing for in app purchases.
In rare cases a number of my users are reporting this error:
"Error retrieving information from server. [RPC:S-7:AEC-0]"
This is happening in production and not in testing. And I'm unable to reproduce this locally to debug.
What does this error mean and how to resolve it?
You might want to take a look at This Previous Question
Check if you are using latest version of Google Play.
OR
Following the steps below.
RPC:AEC:0 error is known as CPU/RAM/Device/Identity failure.
Only possible way you can follow to get rid off this error is,
Go to settings >application > Play Store >Clear Data & Clear Cache.
Go to accounts >Google >Remove account.
Reboot device.
Again Settings>Account >Google >Log In.
Refer to this link
OR
Factory Reset is the last working option, if none of the above worked.
I believe that this might have the solution that you are looking for. Since the question mentioned that he/she noticed the issue with a test account, it may be that your customers are not using the latest version of Google play or that they need to clear their cache.
You can also View this Youtube Video titled "How to Fix " Error retrieving information from server [RPC:S-7:AEC-0] "
In my case the problem was that Google suspended the merchant account for the application.

Login banned on Google Play Game Services

I am implementing realtime multiplayer game using Google Play Game Services. I am experiencing weird issues. My Google Account I am using for login gets randomly "banned" and is unable to communicate with Google servers for approx. 30-40 minutes. After that, everything is working well again. In the meantime I can use other accounts.
The response error I get from LogCat is this:
Unexpected response code 403 for
https://www.googleapis.com/games/v1/players/102515671693140579145
Access Not Configured
Unable to sign in - application does not have a registered client ID
This message is very misleading since everything is set up well. It works most of the time.
I have tried publishing the game and using test as well as non-test accounts. All of them get banned at some point.
Thanks for any help !
This behavior will occur if:
Current user is connected into any room and:
the app is restarted such that it tries to login to Google Services without having gone through the disconnect portion as required by Google Play Services.
I found this happened to me quite regularly (unfortunately for me) as I was figuring out how to pass messages between my Android code and LibGDX code side (my app would just Lock up due to synchronization issues). I also setup some test accounts that I could "cycle" through to avoid being completely locked out of logging in. However, I found out that if I used Task Manager to Kill the process before restarting the app, 90+ percent of the time, I could continue to use the same account.
If you are updating your code, and load to the device while you are in a Room, this will also earn you the server wrath for approximately 30 minutes for that account.
In short, to keep your account viable:
1) ensure you LeaveRoom prior to updating your code (I have found logging out of PS is not required)
2) If your app locks up... Killing the process via Task Manager (I use Samsung devices) will most likely let your account continue (you can see in the logcat where it calls the disconnect when you do that) when you start up the app again.

Categories

Resources