Хотя нигде нет работоспособного документа, в котором я нашел эксперимент, я делюсь им с нуждающимися
Вам нужно получить 2 пакета googleapis_auth и googleapis
import 'package:googleapis/androidpublisher/v3.dart' as androidPublisher;
import 'package:googleapis_auth/auth_io.dart' as auth;
final _credentials = new auth.ServiceAccountCredentials.fromJson(r'''
{
"private_key_id": ...,
"private_key": ...,
"client_email": ...,
"client_id": ...,
"type": "service_account"
}
''');
const _SCOPES = const [
androidPublisher.AndroidpublisherApi.AndroidpublisherScope
];
auth.clientViaServiceAccount(_credentials, _SCOPES).then((httpClient) {
var publisher = new androidPublisher.AndroidpublisherApi(httpClient);
publisher.purchases.products
.get(
packageName,
productID,
purchaseToken)
.then((pub) {
debugPrint(pub.toJson().toString());
});
});
И вы можете создавать такие ключи
Open the IAM & Admin page in the Cloud Console.
Open the IAM & Admin page
Click Select a project, choose a project, and click Open.
In the left nav, click Service accounts.
Find the row of the service account that you want to create a key for. In that row, click the More more_vert button, and then click Create key.
Select a Key type and click Create.