Windows 10 IAP seemingly broken

The short explanation to our issue is that calls to IAP on Windows 10 Universal builds cause this error: System.Exception: Exception from HRESULT: 0x803F6107

It seems to occur after calling this method: CurrentApp.RequestProductPurchaseAsync()

We were using Unity 5.2.4f1 but found that the same errors occurred in 5.3.1 as well. We use .NET scripting backend and have not touched IL2CPP. We believe this may not have to do with Unity specifically, but I thought I’d post this here for those who have encountered this issue, and so that Unity may get some sort of hotline going with Microsoft to find out what the issue is. I’ll link to the various forums of users who have experienced this issue farther below.

Now for the long explanation:

This first occurred when using Prime31 IAP plugins meant for Windows 8.1. Prime31 says their 8.1 IAP plugins may or may not work on Windows 8.1, as they don’t intend to officially support Windows 10 due to low demand. That’s fine, so we instead decided to use Microsoft’s official Windows 10 IAP plugins for Unity. Same error. We tried using IAP in a blank Windows Universal (non-Unity) project. Same error. I’d like to note that test IAPs using CurrentAppSimulator don’t cause these errors, only when accessing various methods within CurrentApp.

Upon further investigation, we found that a few people have encountered this error:

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/c9653f06-0d48-498f-9b3e-335435780fd4/cw81windows-81-app-license-error-0x803f6107?forum=wpdevelop

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/1b66ca11-825f-4091-85c6-85a532ab141b/affecting-users-now-iap-in-my-windows-phone-app-not-working-under-windows-10-mobile?forum=wpdevelop

We tested and Windows 8.1 builds seem to have working IAPs, and this seems to be a fact confirmed by the people who’ve reported this problem. The issue seems to be specifically for Windows 10.

There’s also Microsoft’s gitHub for testing Windows 10 Universal IAP:

https://github.com/Microsoft/Windows-universal-samples/blob/master/Samples/Store/cs/Scenario9_B2B.xaml.cs

They catch this exact error in this example script, and the error message they log seems to imply that the issue is caused by the app not being properly associated with the store. However, we tried associating our app with the store and the same errors occurred. We took a deeper look at the documentation (as well as the notes in that example script) and it appears that Microsoft recommends downloading a privately published app and then deploying over it using a store associated build? The notes are unclear and outline a highly unorthodox testing method that wasn’t necessary for Windows 8.1. Also, we can’t store associate our app privately because our app was already submitted as Windows 8.1 builds a while ago and they’re live. Microsoft doesn’t give you the option to make individual builds private; you have to hide the entire app. This means that in order to privately test IAP from the store (without submitting a Windows 10 build with possibly broken IAP), we have to hide our perfectly working Windows 8.1 builds. This is rather unacceptable.

I somehow doubt that broken IAP would make it past Microsoft’s QA team, but it seems like there’s some native Windows 10 OS failure to reconcile licenses or store associations. An alternative explanation is that somehow we missed a step in the IAP testing procedure.

I know this isn’t specifically a Unity problem, but it definitely pertains to us Unity developers who are developing for Windows 10 (especially with the upcoming contest deadline). The last word heard from Microsoft on this was 11 days ago in an MSDN thread saying they were “looking at it”. Any help or insight would be greatly appreciated.

1 Like

I ran into this issue. I’m on one of those MSDN threads you linked. This is just my experience. I do believe this is a Microsoft bug, but details are sketchy right now.

We got it when attempting to access CurrentApp.LicenseInformation specifically. We put a try-catch around it and act like there’s a connection error when it happens.

It seems to occur a lot more when we sideload apps, but rarely when we download directly from the Windows Store. In other words, testing made this seem like a much bigger issue than it ended up being. My guess is that going through the Windows Store is caching something, thus this exception is thrown less often.

For testing, we published a private second “Beta” version of our app. It was not publicly available. Then at least we could spend real money on a live server to test IAP code. Note: Pushing a build this way takes approximately 16 hours!

Short version: We try-catch and treat it like any other IAP error. Hopefully it’s not an issue for your live published app!

We reached our deadline and decided to publish our game anyway even with broken IAP (and handle the errors with try/catch)… and to our surprise, IAPs now work. Apparently, this exception does not seem to occur on a store build.

Now, IAPs on Windows 8.1 builds wouldn’t work unless they were uploaded to store either, HOWEVER the IAP would simply return a failure callback and a native XAML popup that specified that the IAPs weren’t available. On Windows 10, the failure takes the form of an internal system exception that can give developers the wrong impression that their code, or the plugin, or the SDK is broken in some way.

Although the documentation does mention something about having to download your published store app and whatnot to test, it wasn’t very clear and seems like a highly impractical development and testing procedure. To receive exceptions like that in a build and trust that IAPs will “just work” on upload is a pretty crummy way to handle it. So hopefully any devs who’ve also run into this will hopefully find this information helpful.