Esempio n. 1
0
        private async Task <string> GetAppReceipt()
        {
#if DEBUG
            return(await CurrentAppSimulator.GetAppReceiptAsync());
#else
            return(await CurrentApp.GetAppReceiptAsync());
#endif
        }
        private async void ShowReceipt_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                String receipt = await CurrentAppSimulator.GetAppReceiptAsync();

                rootPage.NotifyUser(receipt, NotifyType.StatusMessage);
            }
            catch (Exception)
            {
                rootPage.NotifyUser("Get Receipt failed.", NotifyType.StatusMessage);
            }
        }
Esempio n. 3
0
        private async void GetReceipt(object sender, RoutedEventArgs e)
        {
            try
            {
                String receipt = await CurrentAppSimulator.GetAppReceiptAsync();

                String prettyReceipt = XElement.Parse(receipt).ToString(SaveOptions.None);
                tb1.Text = prettyReceipt;
            }
            catch (Exception)
            {
            }
        }
        private async void ShowReceipt_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                String receipt = await CurrentAppSimulator.GetAppReceiptAsync();

                String prettyReceipt = XElement.Parse(receipt).ToString(SaveOptions.None);
                rootPage.NotifyUser(prettyReceipt, NotifyType.StatusMessage);
            }
            catch (Exception)
            {
                rootPage.NotifyUser("Get Receipt failed.", NotifyType.StatusMessage);
            }
        }
        private async void ShowReceipt()
        {
            try
            {
                String receipt = await CurrentAppSimulator.GetAppReceiptAsync();

                String prettyReceipt = XElement.Parse(receipt).ToString(SaveOptions.None);
                Output.Text = prettyReceipt;
            }
            catch (Exception)
            {
                rootPage.NotifyUser("Get Receipt failed.", NotifyType.ErrorMessage);
            }
        }
Esempio n. 6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="OnAppReceiptAcquired"></param>
        public static void GetAppReceipt(Action <CallbackResponse <string> > OnAppReceiptAcquired)
        {
            string receipt = String.Empty;

            Utils.RunOnWindowsUIThread(async() =>
            {
                try
                {
                    if (_isLicenseSimulationOn)
                    {
                        receipt = await CurrentAppSimulator.GetAppReceiptAsync();
                    }
                    else
                    {
                        receipt = await CurrentApp.GetAppReceiptAsync();
                    }
                }
                catch (Exception ex)
                {
                    Utils.RunOnUnityAppThread(() => { if (OnAppReceiptAcquired != null)
                                                      {
                                                          OnAppReceiptAcquired(new CallbackResponse <string> {
                                Result = null, Exception = ex, Status = CallbackStatus.Failure
                            });
                                                      }
                                              });
                    return;
                }

                Utils.RunOnUnityAppThread(() => { if (OnAppReceiptAcquired != null)
                                                  {
                                                      OnAppReceiptAcquired(new CallbackResponse <string> {
                            Result = receipt, Exception = null, Status = CallbackStatus.Success
                        });
                                                  }
                                          });
            });
        }
Esempio n. 7
0
 public static async Task <string> GetAppReceiptAsync(bool isTestingMode)
 {
     return(isTestingMode ? await CurrentAppSimulator.GetAppReceiptAsync() : await CurrentApp.GetAppReceiptAsync());
 }
Esempio n. 8
0
 public IAsyncOperation <string> RequestAppReceiptAsync()
 {
     return(CurrentAppSimulator.GetAppReceiptAsync());
 }
 /// <summary>
 /// Requests all receipts for the purchase of the app
 /// and any in-app products.
 /// </summary>
 /// <returns>
 /// An XML-formatted string that contains all receipt
 /// information for the purchase of the app and any in-app products.
 /// </returns>
 public static IAsyncOperation <string> GetAppReceiptAsync()
 {
     return(IsMockEnabled
         ? CurrentAppSimulator.GetAppReceiptAsync()
         : CurrentApp.GetAppReceiptAsync());
 }