AppStateClient loadState gets null bytes

In my Android app elsewhere, I (definitely) fired appStateClient.updateStateImmediate with some data in it. But when the onStateLoaded callback finally lights up after that, the incoming bytes are zero. and for the record, I reach onConnected OK. The code is as follows:

start download:

appStateClient.loadState(this, 0); 

start by saving:

 appStateClient.updateStateImmediate(this, 0, bytes); // bytes have content here 

reply onStateLoaded:

 @Override public void onStateLoaded(int statusCode, int statusKey, byte[] bytes) { // bytes are null here, statusCode is 7 AKA developer error 

See this in log cat:

 07-18 09:11:09.402: E/Volley(7866): [3530] ip.a: Unexpected response code 403 for https://www.googleapis.com/appstate/v1/states/0 07-18 09:11:09.472: E/Volley(7866): [3530] ip.a: Unexpected response code 403 for https://www.googleapis.com/appstate/v1/states/0 07-18 09:11:09.482: E/LoadStateOp(7866): Error executing operation: Access Not Configured 

I went through the whole process of creating APP_ID on the Google API pages and use only the whole part. I checked that I use the same SHA1 from debug.keystore that eclipse uses as my OAuth SHA1 in the Google API, and the package name matches my <manifest package> tag.

What did I miss? thanks in advance

+4
source share
1 answer

Have you customized your AndroidManifest.xml with the appropriate metadata?

 <meta-data android:name="com.google.android.gms.appstate.APP_ID" android:value="@string/APP_ID" /> 

Without this, you will receive a developer error.

+1
source

Source: https://habr.com/ru/post/1492136/


All Articles