Без опису
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. using System;
  2. using System.Collections.Generic;
  3. using Windows.ApplicationModel.Store;
  4. using Windows.Foundation;
  5. namespace UnityEngine.Purchasing.Default
  6. {
  7. /// <summary>
  8. /// Wrapper class for the Windows Store API CurrentApp class.
  9. /// </summary>
  10. public class CurrentApp : ICurrentApp
  11. {
  12. /// <summary>
  13. /// Returns a list of purchased consumable in-app products that have not been reported to the Microsoft Store as fulfilled..
  14. /// </summary>
  15. /// <returns> The list of purchased consumable products that have not been reported as fulfilled. </returns>
  16. public IAsyncOperation<IReadOnlyList<UnfulfilledConsumable>> GetUnfulfilledConsumablesAsync()
  17. {
  18. return global::Windows.ApplicationModel.Store.CurrentApp.GetUnfulfilledConsumablesAsync();
  19. }
  20. /// <summary>
  21. /// Loads the app's listing information asynchronously.
  22. /// Additionally, the listing information for available in-app products is also provided.
  23. /// </summary>
  24. /// <returns> The ListingInformation that contains info (ex: name, price) specific to the market the user currently resides in. </returns>
  25. public IAsyncOperation<ListingInformation> LoadListingInformationAsync()
  26. {
  27. return global::Windows.ApplicationModel.Store.CurrentApp.LoadListingInformationAsync();
  28. }
  29. /// <summary>
  30. /// Notifies the Microsoft Store that the purchase of a consumable add-on (also called an in-app product or IAP)
  31. /// is fulfilled and that the user has the right to access the content.
  32. /// </summary>
  33. /// <param name="productId"> The product ID of the consumable add-on to report as fulfilled. </param>
  34. /// <param name="transactionId"> The transaction ID for the purchase of the consumable add-on. </param>
  35. /// <returns> An async operation for a <c>FulfillmentResult</c> value that indicates the status for the consumable add-on.</returns>
  36. public IAsyncOperation<FulfillmentResult> ReportConsumableFulfillmentAsync(string productId, Guid transactionId)
  37. {
  38. return global::Windows.ApplicationModel.Store.CurrentApp.ReportConsumableFulfillmentAsync(productId, transactionId);
  39. }
  40. /// <summary>
  41. /// Requests the purchase of an add-on (also called an in-app product or IAP).
  42. /// Additionally, calling this method displays the UI that is used to complete the transaction via the Microsoft Store.
  43. /// </summary>
  44. /// <param name="productId"> The product ID of the add-on to purchase. </param>
  45. /// <returns> An async operation for a <c>PurchaseResults</c> containing the results of the product purchase request.</returns>
  46. public IAsyncOperation<PurchaseResults> RequestProductPurchaseAsync(string productId)
  47. {
  48. return global::Windows.ApplicationModel.Store.CurrentApp.RequestProductPurchaseAsync(productId);
  49. }
  50. /// <summary>
  51. /// Requests the purchase of an add-on (also called an in-app product or IAP).
  52. /// Additionally, calling this method displays the UI that is used to complete the transaction via the Microsoft Store.
  53. /// </summary>
  54. /// <param name="productId"> The product ID of the add-on to purchase. </param>
  55. /// <returns> An async operation for a string providing in-app transaction details for the provided productId. </returns>
  56. public IAsyncOperation<string> RequestProductReceiptAsync(string productId)
  57. {
  58. return global::Windows.ApplicationModel.Store.CurrentApp.GetProductReceiptAsync(productId);
  59. }
  60. /// <summary>
  61. /// Read access to the current app's license metadata.
  62. /// </summary>
  63. public LicenseInformation LicenseInformation
  64. {
  65. get
  66. {
  67. return global::Windows.ApplicationModel.Store.CurrentApp.LicenseInformation;
  68. }
  69. }
  70. /// <summary>
  71. /// Requests all receipts for the purchase of the app and any in-app products.
  72. /// </summary>
  73. /// <returns> An async operation for an XML-formatted string containing all receipt information for the purchases of the app and of its products.. </returns>
  74. public IAsyncOperation<string> RequestAppReceiptAsync()
  75. {
  76. return global::Windows.ApplicationModel.Store.CurrentApp.GetAppReceiptAsync();
  77. }
  78. /// <summary>
  79. /// Dummy function implementing the building of Mock Products.
  80. /// </summary>
  81. /// <param name="products"> The list of product descriptions. </param>
  82. public void BuildMockProducts(List<WinProductDescription> products)
  83. {
  84. // Only implemented by the mock store.
  85. }
  86. }
  87. }