"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.
May be a little late, but if anyone else runs into this, the following may be of help.
From Google Fit docs:
As at 1 Jun 2021.
https://developers.google.com/fit/datatypes/health