I am using Google.Apis.AndroidPublisher.v2 to get Inappproducts: list and inapp purchases details. I have created a new service account in my app console and using .p12 key as required. Here is my code:
String serviceAccountEmail = "iap-119@abc.iam.gserviceaccount.com";
var fullPath = System.Web.Hosting.HostingEnvironment.MapPath(@"~/App_Data/key.p12");
var certificate = new X509Certificate2(fullPath, "notasecret", X509KeyStorageFlags.Exportable);
ServiceAccountCredential credential = new ServiceAccountCredential(
new ServiceAccountCredential.Initializer(serviceAccountEmail)
{
Scopes = new[] { "https://www.googleapis.com/auth/androidpublisher" }
}.FromCertificate(certificate));
var service = new AndroidPublisherService(
new BaseClientService.Initializer()
{
ApplicationName = "abc",
HttpClientInitializer = credential
});
var request = service.Inappproducts.List("com.Its.abc");
var purchaseState = request.Execute();
I got following error on request.Execute(); Message[No application was found for the given package name.] Location[packageName - parameter] Reason[applicationNotFound] Domain[global]
However my package name is correct and same package name is uploaded on play store.
Thanks,