"OAuth 2.0 Client ID" was successfully obtained,but "OAuth consent Scree" was not verified

FitnessOptions fitnessOptions = FitnessOptions.builder()
                .addDataType(HealthDataTypes.TYPE_BLOOD_GLUCOSE,FitnessOptions.ACCESS_WRITE)
                .addDataType(HealthDataTypes.TYPE_BLOOD_GLUCOSE,FitnessOptions.ACCESS_READ)
                .build();
DataSource mDataSource = new DataSource.Builder()
                    .setStreamName("test")
                    .setAppPackageName(context)
                    .setDataType(HealthDataTypes.TYPE_BLOOD_GLUCOSE)
                    .setType(DataSource.TYPE_DERIVED)
                    .build();
DataPoint bloodGlucose = DataPoint.builder(mDataSource)
                .setField(HealthFields.FIELD_BLOOD_GLUCOSE_LEVEL,15)
                .setTimestamp(now.getTimeMillis(),TimeUnit.MILLISECONDS)
                .build();
DataSet dataSet = DataSet.builder(mDataSource)
                .add(dataPoint)
                .build();
Task<Void> response = Fitness
                .getHistoryClient(context, GoogleSignIn.getAccountForExtension(context, fitnessOptions))
                .insertData(dataSet);

I've passed the GoogleSignIn permission and an exception(com.google.android.gms.common.api.ApiException: 5024) has occurred when inserting data

please see: [https://developers.google.com/fit/scenarios/write-blood-glucose-data] Does not allow the user to write blood sugar information anymore? or maybe there's something wrong with my code.

I would be very grateful if you could give us some suggestions based on your rich experience.

1

There are 1 best solutions below

0
On

May be a little late, but if anyone else runs into this, the following may be of help.

From Google Fit docs:

Google Fit has health data types for measurements related to managing general health (as opposed to fitness). Because health data can be sensitive, these data types have sensitive scopes. This means you need to apply for OAuth API verification for sensitive scopes on top of the standard authorization permissions for Android and REST to read and write to these data types.

Google will review your application and grant or deny verification. Users will review the scope requests and grant or deny access to these.

Note: Google has temporarily stopped taking new requests to write to health data types. We are updating our policy and process for reviewing requests and will update this documentation again when we resume.

As at 1 Jun 2021.

https://developers.google.com/fit/datatypes/health