Closed varunsinghNW18 closed 2 years ago
Have you tried running it in an emulator? Maybe the device has some kind of problem. I remember seeing this error too but I don't remember how I fixed it 😅
Thanks, Nikolas for replying. I use two devices & an emulator. The problem is those two devices every time I run gives me the error code GOOGLE_SERVICE_UNAVAILABLE error don't know where it is coming from. I have already been given 12 days two fix it but really don't know anything about it. If you have seen this error please try to think about how did you fix it. I really appreciate your effort on your example which really worked fantastically but the same thing gives me one error every time as it does not enter onSuccess listener.
Okay I think I remembered. Is your app on Google Play right now?
Yes it is
Is the integrity enabled?
Play integrity is enabled on the Play console side and not on Cloud console because we want that the app should be downloaded from the Play store only
Google Cloud is unrelated to the app being downloaded outside Play Store. You'll have to link a Google Cloud project to Play Console and configure the Google Cloud project as in here https://github.com/1nikolas/play-integrity-checker-server#how-to-set-up-google-cloud
Hey Nikolas, I have linked already the google cloud project to the play store. And I followed your link earlier carefully still it is throwing the same problem
I have done uptill here also downloaded the json ---> Go to Keys -> Add Key -> Create new key. The json that downloads automactially is the json you need for the Environment Variable.
something like this :
"type": "service_account", "project_id": "money-control-361608", "private_key_id": "e1e58eda3a9a", "private_key": "-----BEGIN "
Have you tried doing a release build of your app? Theoretically if someone was to generate fake tokens for your app, they could have the debug signing (aka when you hit run) and have your tokens. So I think this requires a release build. But not 100% this is the problem you can try
Ok let me understand what you are trying to say.. but where should I put the json in which environment variable ?. I am using Mac
The json should be in the server not the app
oh ok that means the back end server file rite ? I will try making a signed release build I guess.but I am not sure if this .
Now I have created a signed release build of my app. What is the next step ?
sorry I don't know how to help you
Following your example but unfortunately am not getting the token since it is giving an error as GOOGLE_SERVER__UNAVAILABLE. Have done the ground works like Play & Cloud console enablement.
You can check my code: