Я использую приведенный ниже код для получения продукта по подписке в соответствии с msdn ссылкой , хотя возвращаются другие долговременные дополнения. фактическое объявление о подписке не возвращается функцией GetAssociatedStoreProductsAsync.
мое приложение находится в магазине, и подписка также находится в магазине, как показано ниже.
в чем здесь проблема? кто-нибудь может мне помочь?
![enter image description here](https://i.stack.imgur.com/1tDaN.png)
private async Task<StoreProduct> GetSubscriptionProductAsync()
{
// Load the sellable add-ons for this app and check if the trial is still
// available for this customer. If they previously acquired a trial they won't
// be able to get a trial again, and the StoreProduct.Skus property will
// only contain one SKU.
StoreProductQueryResult result =
await context.GetAssociatedStoreProductsAsync(new string[] { "Durable" });
if (result.ExtendedError != null)
{
System.Diagnostics.Debug.WriteLine("Something went wrong while getting the add-ons. " +
"ExtendedError:" + result.ExtendedError);
return null;
}
// Look for the product that represents the subscription.
foreach (var item in result.Products)
{
StoreProduct product = item.Value;
if (product.StoreId == subscriptionStoreId)
{
return product;
}
}
System.Diagnostics.Debug.WriteLine("The subscription was not found.");
return null;
}