Answered by:
[WP8.1][C#] Crash on IAP page

Question
-
I installed published application from store and when I test IAP on developer unlocked device IAP page appears for 5 - 10 seconds and closes, application closes too. In Application Insights reports I do not see any errors, when I test with CurrentAppSimulator it works fine. Also in reports I see some users bought IAP. I can buy IAPs in other applications from that device, but not in mine. Is it some known limitation or a bug?
CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () => { try { await CurrentApp.RequestProductPurchaseAsync("RemoveAd"); } catch (Exception e) { TelemetryService.Exception(e, "Settings View Model (try purchase IAP)"); } }) .AsTask();
- Edited by Username already in use Wednesday, September 16, 2015 8:50 AM
Wednesday, September 16, 2015 8:48 AM
Answers
-
Today it is working. Thank you!
- Proposed as answer by Franklin ChenMicrosoft employee Monday, September 21, 2015 1:38 AM
- Marked as answer by Franklin ChenMicrosoft employee Wednesday, September 30, 2015 11:18 AM
Friday, September 18, 2015 8:12 AM
All replies
-
Hi,
>>Also in reports I see some users bought IAP
Is there any end-users report this issue for your app? Have you tried to install your app on other device?
The IAP feature is also closely associated with Windows Store service side, I would also suggest you contacting with support using MS account/subscription.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.
- Edited by Franklin ChenMicrosoft employee Thursday, September 17, 2015 9:00 AM typo
Thursday, September 17, 2015 9:00 AM -
They do not report, but app already got one one star rating without explanation of reasons. I added custom events in Application Insights and see following picture:
Obviously, user tried make purchase and after 5 seconds page closed. He tried again and next time he had 2 seconds, what is of course not enought to complete purchase.
Maybe I do something wrong, maybe I should call LoadListingInformationAsync() before RequestProductPurchaseAsync() or something like that? Is there some sample project for IAPs?
Thursday, September 17, 2015 11:55 AM -
And full code:
//Used to bind banner visibility public bool IsAdEnabled { get { var internetAvailable = NetworkInterface.GetIsNetworkAvailable(); if (!internetAvailable) return false; var license = CurrentApp.LicenseInformation.ProductLicenses["RemoveAd"]; return !(license != null && license.IsActive); } } //Used to bind Disable Ads button visibility public bool CanDisableAd { get { var internetAvailable = NetworkInterface.GetIsNetworkAvailable(); var license = CurrentApp.LicenseInformation.ProductLicenses["RemoveAd"]; return internetAvailable && !license.IsActive; } } private void DisableAd() { if (NetworkInterface.GetIsNetworkAvailable()) { OnPurchaseStarting(); CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () => { try { await CurrentApp.RequestProductPurchaseAsync("RemoveAd"); } catch (Exception e) { TelemetryService.Exception(e, "Settings View Model (try purchase IAP)"); } OnPurchaseCompleted(); OnPropertyChanged("IsAdEnabled"); OnPropertyChanged("CanDisableAd"); }) .AsTask(); } }
Thursday, September 17, 2015 12:22 PM -
Today it is working. Thank you!
- Proposed as answer by Franklin ChenMicrosoft employee Monday, September 21, 2015 1:38 AM
- Marked as answer by Franklin ChenMicrosoft employee Wednesday, September 30, 2015 11:18 AM
Friday, September 18, 2015 8:12 AM