Crash when user attempts to purchase in-app product

hi all,
I didn't use to get any crash reports before introducing in-app purchase. I have approx. 30 downloads a day and 5 crashes a day now which doesn't sound right.
Please could you help me find out why this is?
Here is the crash info. It seems like something goes wrong when the user presses the 'Buy Product button' and it looks like it's got something to do with the async/awaiting business. I'm very new to this and don't really understand.
Frame Image Function Offset
0 mscorlib.ni.dll System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess 0x0023a00e
1 mscorlib.ni.dll System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification 0x0000003a
2 mscorlib.ni.dll System.Runtime.CompilerServices.TaskAwaiter_1[[System.__Canon,_mscorlib]].GetResult 0x0000001c
3 BACanglais.ni.DLL BACanglais.WhatsIncluded+_Button_Click_d__2.MoveNext 0x000000b8
4 mscorlib.ni.dll System.Runtime.CompilerServices.AsyncMethodBuilderCore._ThrowAsync_b__0 0x00000036
my code behind the "Buy Product button" is as follows:
async private void Button_Click(object sender, RoutedEventArgs e)
// go to the buy product page
var listing = await CurrentApp.LoadListingInformationAsync();
var product1 =
listing.ProductListings.FirstOrDefault(p => p.Value.ProductId == "33333" && p.Value.ProductType == ProductType.Durable);
try
if (CurrentApp.LicenseInformation.ProductLicenses[product1.Value.ProductId].IsActive)
myVersionLine.Text = "FULL Version";
myUpgradeButton.Visibility = System.Windows.Visibility.Collapsed;
MessageBox.Show("You already own this product");
else
receipt = await CurrentApp.RequestProductPurchaseAsync(product1.Value.ProductId, true);
catch (Exception ex)
//MessageBox.Show(ex.ToString());
MessageBox.Show("Purchase did not take place");
thanks for your help. I'd hate to think that those 5 crashes a day are 5 potential buyers! what's strange is that no-one contacted me to say there was a problem.
anyone ran into a similar problem or has any idea?
many thanks!
cypripri

I can suggest to use the following strategy.
Define listing outside the Button_Click event
private ListingInformation listing = null;
and try to load the listing information before the user can tap on the button and you can enable the button after the listing has been loaded. For example, in the Loaded event of your page you can:
try
Task.Run(async () =>
listing = await CurrentApp.LoadListingInformationAsync();
}).Wait();}
catch { }
Button.IsEnabled = (listing != null);
In the Button_Click event verify that listing is not null, otherwise try to reload it.

Similar Messages

  • When I attempt to upgrade an app in iTunes for windows, I get an error:  "Could not purchase.  An unknown error occurred (11111).  There was an error in the iTunes Store.  Please try again later"

    When I attempt to upgrade an app in iTunes for windows, I get an error:  "Could not purchase.  An unknown error occurred (11111).  There was an error in the iTunes Store.  Please try again later"
    I am running the latest iTunes 10.7.0.21 for Windows 7.
    This error occurs if I try to either update the app or if I delete it and attempt to redownload.
    I have an iPhone and an iPad.  I am unable to update the apps or install the apps from within the App Store on iOS.
    I do not have an AOL ID, as is a common issue with this type of error.
    From what I can tell, my Apple ID account seems fine.  I logged in, changed some information, and ensured my credit card is valid and updated.
    I can download new apps just fine.  I am unable to update or install apps I have purchased in the past.

    After 30 minutes this morning, no resolution. Then another tech support call this afternoon, 15 minutes in, was escalated to a Tier 2 (Senior) advisor. He said something similar to the above ("this is one of the strangest things I've seen"). He was chatted with iTunes guys and took all my info into the case and was escalating it over to engineering. Said they would be in touch.
    So, no solution...yet.
    Just to clarify:
    iTunes on Windows7: trying to update an existing app, or re-download a prior app, gives the (11111) error. Downloading a new (free) app worked fine.
    App Store on iPhone5, iOS 6.0.1: click on UPDATE, switches to INSTALLING...for a second, then switches back to UPDATE. No error message (and nothing in Diagnostic data).
    App Store on iPad 3, iOS 6.0.1: same as iPhone 5.
    Definitely account related.
    I have cleared the store cache, signed out and back in, deleted the credit card data, and re-added, rebooting PC and iPhone...nothing works.
    Will post if I hear anything back from Apple.

  • I am not able to purchase apps, I'm not getting any error alerts. I just get no response when I attempt to purchase. Also when I attempt to use a search engine to find a itunes app I just get redirected.

    I am not able to purchase itune apps. I do not receive a error message.
    I do not get a response when I attempt to purchase.
    When I use a search engine to find a app and it is to be
    Found at the itunes site I get redirected.

    Have you tried resetting and restarting >  iPhone, iPad, iPod touch: Turning off and on (restarting) and resetting
    Or restoring >  iTunes: Restoring iOS software

  • HT204053 I just purchased more storage space(10gb) for   iPAD, but when I attempted to download an app An error message appeared prompting me to buy more storage. according to my ICloud  I have 15gb available. Does anyone have any suggestions

    I purchased more storage space(10gb)for my IPAD,but when I attempted to download an app an error message prompted me to purchase more storage.According to my ICloud I have 15gbavailable Any suggestions Help!!!

    If you are trying to download an app and get an error about not enough memory, it's talking about memory on your iPad, not in iCloud.  I don't know what you mean by purchasing more storage space for your iPad, you can't add more memory to a device.  You may have bought more memory in iCloud, but that's not going to fix your current problem.  You need to delete songs or video, or some other large files from your iPad to make room for a new download.

  • HT1689 when i attempt to purchase something in app it says "contact iTunes store support to complete transaction" anyone knows how to contact store support?

    when i attempt to purchase something in app it says "contact iTunes store support to complete transaction" anyone knows how to contact store support?

    Click here and request assistance.
    (77309)

  • When I attempt to download an app my email address isn't there, the other ipad users is there.  How do I change the email address so I can enter my password?

    When I attempt to download an app my email address isn't there, the other ipad users is there.  How do I change the email address so I can enter my password?

    Go to Settings > iTunes and App Stores
    At the top of the window you will see the Apple ID that the iPad is using. To change that tap on the ID and then tap on Sign Out. Then sign in with the correct ID.
    Not really a good idea to be using two different Apple IDs on a single iPad.

  • When I try to purchase new app or update apps on iPad it tells me user name is disabled.  I have done all the "tricks" from the tech support on phone and still not working.

    When I try to purchase new app or update apps on iPad it tells me user name is disabled.  I have done all the "tricks" from the tech support on phone and still not working.

    Contact Apple Support
    https://expresslane.apple.com/GetproductgroupList.action
    Apple ID: "This Apple ID has been disabled for security reasons" alert appears
    http://support.apple.com/kb/ts2446
     Cheers, Tom

  • When I attempt to purchase a song from itunes, I keep getting the following error message: Could not purchase "song name". An unknown error occurred (-42408). There was an error in the itunes store. Please try again later

    When I attempt to purchase a song from itunes, I keep getting the following error message: Could not purchase "song name". An unknown error occurred (-42408). There was an error in the itunes store. Please try again later
    Can anyone help solve this problem?

    I've done a search on here and haven't found any solutions posted for it for windows computers. You could try posting in the iTunes For Windows forum and see if you get any suggestions in there (are you able to download other items from the store e.g. a free app ?) - I use a Mac, the only things that I could think of to suggest trying is see if you get the same error on a different iTunes library :
    creating and/or opening a different iTunes library : http://support.apple.com/kb/HT1589
    or using a different user account on your computer in case it's a problem with that user account.
    But you may want to try the iTunes For Windows forum first, apart from anything else you are likely to get better help for the above

  • Imovie 9.0.9 crashes when I attempt to send it to i-dvd message is exc_crash(sigabrt) ?

    I Movie crashes when I attempt to send it to i DVD. Shuts down and send message exc_crash(sigbrt). This is new and I have already made more then 20 i-movies and burned DVDs. Is this a corrupt file in the pictures, videos, music or themes or a problem  with the i-movie program?  There is plenty of space on the drives. Geek squad could not figure it out?
    Thank you
    Richard

    I would first delete the app and reinstall it. Then try your move again. If still having issues, I would try to isolate the cause by making a quick video and then try to send it to your DVD. If that doesn't crash, then I would suspect the other movie or something embedded in it. If you've used some of the stock music, themes or other stock files in the video that crashes, you can try adding the music, themes or other files to your new short video that didn't crash one at a time to try and isolate a particular file that may be causing the issue. I know this is a lot of work but from your post it looks like you use this app often so I think it's worth it to try this unless someone else has a better idea.

  • ITunes crashes when I attempt to sync music to iPhone

    This has been an ongoing problem for about a month or so. When I connect my iPhone to my computer it shows in iTunes that it's connected, however, when I hit "sync" iTunes crashes. iTunes updates all of my applications and even allowed me to update my 3GS to iOS4 but it just crashes when it attempts to sync all of my music in iTunes. I've reinstalled iTunes using the step by step article like Apple tech support told me but after that they said it has to be a hardware problem.
    Any suggestions? This is driving me nuts.
    BTW I am running Vista Home Premium.

    Okay ... I've got no +a priori+ reason to suspect the nVidia's at this stage. (There has been a bit of an uptick in unorthodox Radeon issues over the past couple of weeks, but nothing related to nVidia's that I'm aware of.)
    More experimentation, if you're still game J.
    There have been a few more preference file issues cropping up in recent months than I like. Although I'd usually associate them with something like an iTunes.dll faulting module than a QuickTime component, I've seen them mimic QuickTime component troubles down through the years.
    If it's a pref file issue, it should produce a user-account-specific crash. (There's different sets of iTunes pref files in each different Windows user account.) So it's probably worth checking to see if this is user account specific or not.
    Create a new user account with full administrative rights on the PC. Log out of your usual account and log into the new account. (Don't use fast user switching to move between accounts.)
    Launch iTunes in the new account. The iTunes Setup Assistant will run. When prompted, don't let iTunes add files to the new account. Just let it launch to an empty library.
    In iTunes, go "Edit > Preferences". In the "Devices" tab, check the "Prevent iPods, iPhones and iPads from syncing automatically" checkbox. Click OK.
    Plug in the iPhone. *(Do not associate the iPhone with the empty library.)*
    Do we get another "iTunes has stopped working"? Or does iTunes stay open this time around?

  • When I try to purchase an app using my iphone it asks me for a password for the wrong email address. How do I reset my iphone to show the correct email address/apple ID

    when I try to purchase an app using my iphone it asks me for a password for the wrong email address. How do I reset my iphone to show the correct email address/apple ID

    Thanks for your reply. Having read through relevant topics it suggests that if I sync my iphone with the correct account on my pc it should use that one thereafter. i will try both.

  • I recently changed my e-mail address and have made the changes in my Apple account. But when I try to purchase an app from the App Store on my ipad, the sign in cue still shows my old e-mail address rather than my new one.

    Hi there. I am having difficulty buying apps from the App Store. I recently changed my e-mail associated with my apple account. when i try to purchase an app, the cue to sign in does not show my new e-mail, but still shows my old e-mail. when I put in my password, it does not work because my password is no longer associated with the old e-mail address. i don't understand why my old e-mail still shows up. Can someone help me?

    Hello there, loupar.
    The following Knowledge Base article offers up just how to change your Apple ID for the App Store on your iOS device:
    iOS: Sign in with a different Apple ID in the iTunes Store, App Store, and iBooks Store
    http://support.apple.com/kb/ht1311
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • When I try to purchase an app, I keep getting the (error Id:11200)

    When i try to purchase any app the same error message comes up saying, "There was a problems completing this purchase. Please try again or visit blackberry app world support for more information. (error Id:11200)". And I've tried to visit blackberry app world support and it didn't help at all. I've checked my visa card and it's not expired, I've put in my BlackBerry ID correctly. This has been happening for a few days now. Idk, help?!?

    Hi and Welcome to the Community!
    I don't find anything with that exact error code, and several that could match the wording of the message...therefore, please go here:
    http://btsc.webapps.blackberry.com/btsc/microsites/microsite.do
    and conduct a search through the KBs for likely candidate articles. It is most likely that there is indeed something wrong with the credit card that is attached, and switching to a different one (or PayPal) may cure it.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • The App Store just goes white when I attempt to search for apps.

    My App Store screen just goes white when I attempt to search for apps. You can tell it tries for a few seconds and then nothing but white.

    See if any of these suggestions from appletoolbox.com work for you.
    Please try each step until you resolve your issue:
    Tap Settings > General > Date and Time > Set Automatically > Off. Set the date one year ahead. Then try to access the App Store.
    It may be a connection issue. Try changing your DNS settings to Google’s open DNS by tapping Settings > Wi-Fi >, tap the blue arrow next to your current Wi-Fi network, and then tap the “DNS” field and enter the DNS servers; 8.8.8.8 (Google’s Public DNS). (see this article)
    Close the App Store completely by pressing the home button twice, pressing and hold the App Store icon until it starts to wiggle, then tapping the minus sign to close it. Re-launch the App Store.
    Restart your device by pressing and holding the sleep/wake button until “Slide to Power off” appears.
    Launch the App Store; if it is still blank with nothing shown, wait a few minutes. Sometimes apps may load slowly because of networking issues.
    If still nothing appears, try changing the device’s language by tapping Settings > General > International > Language. Pick a language. Pick any other second language you already know or be familiar with. If you don’t, do not forget to navigate back in a different language. Change the language, launch the App Store, then change the language back to what it was originally.
    Sign out of your Apple ID by tapping Settings > iTunes & App Store, tap your Apple ID and select “Sign Out”. Wait one minute and sign back in by reentering your Apple ID and password.

  • PSE 11 crashes when I attempt to add a new catalog

    PSE 11 crashes when I attempt to add a new catalog to those that already exist. No programs are running that might conflict with Organizer, and I can run other functions such as downloading photos from my camera. As soon as I attempt to add a new sub-catalog to an existing major catalog, the program crashes. I'm using Windows 7, and have tried various compatibilities, but none solves the problem. Any ideas?

    expat31 wrote:
    PSE 11 crashes when I attempt to add a new catalog to those that already exist. No programs are running that might conflict with Organizer, and I can run other functions such as downloading photos from my camera. As soon as I attempt to add a new sub-catalog to an existing major catalog, the program crashes. I'm using Windows 7, and have tried various compatibilities, but none solves the problem. Any ideas?
    How do you attempt to 'add a new catalog' or a new 'sub-catalog' ?
    There are no such things as 'sub-catalogs' or catalogs included in catalog.
    Catalogs are totally independent storing systems, they ignore what is managed in other catalogs.That's why it is recommended to have only one catalog, unless you have a good reason to create several ones because they are totally independent by nature (home vs professional for instance).
    You can create several levels of albums, of tags categories, but not with catalogs.

Maybe you are looking for

  • Video Chat Error Message need help asap

    Someone Please Help I run a Netgear Wireless Router WPN824 RangeMAX, iChat works everywhere but my house...I need to talk to my family overseas someone gimme a hand please Date/Time: 2008-02-28 14:30:10.323 -0500 OS Version: 10.5.2 (Build 9C2015) Rep

  • How to create a pdf-file dynamically

    Hi all, does anybody have a tutorial or self-made code, in which is illustrated, how to dynamically create a pdf-file. I am getting some information like this: "Line one has a textfield and an input-field", etc. These informations have to be translat

  • Best operating system?

    My mum has an eMac What is the recommended OS for this Mac? Right now she has Tiger but it's running incredibly slow and I'm going to re-nitialise the HD and re install the OS Should I stick with Tiger or try Loeopard or SN? She only uses it for emai

  • Fetching mail from a mail server

    Hai, I've tried to fetch the mail from my inbox which belongs to the MODOMAIL server. I've write code for that.But iam not able to dwnload.Whenever i tried that program The following exceptions are occured. NORoute to host Exception : Operation timed

  • AAM Download Error

    I was wondering if someone can help me. We recently purchased the CS Cloud product and when trying to install AAM, it popped up with an error. I managed to download the full installer and after installing, when I try and download and install an appli