Bug 31677 - InAppBilling works with ReservedProductIDs but not with Live Products
Summary: InAppBilling works with ReservedProductIDs but not with Live Products
Alias: None
Product: Components
Classification: Xamarin
Component: Xamarin Components ()
Version: Production (addons.xamarin.com)
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Kevin Mullins
Depends on:
Reported: 2015-07-06 15:03 UTC by John Miller [MSFT]
Modified: 2015-09-28 16:08 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 31677 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description John Miller [MSFT] 2015-07-06 15:03:02 UTC

   I'm working with the Xamarin.InAppBilling component, and consistently encountering an error. The problem is with the override method OnActivityResult. When using the reserved id (ReservedTestProductIDs.Purchased). This OnActivityResult method works fine, both locally and in the live Beta channel of my application. The method is invoked, and the product is fulfilled.

However with any live In-App Products, those populated by a id string:

 > Products = await _serviceConnection.BillingHandler.QueryInventoryAsync(new List<string> {
 >         "example",
 >         ReservedTestProductIDs.Purchased
 >       }, ItemType.Product);

this method is not invoked when the user completes the purchase cycle.

**Actual Results:**

   The OnActivityResult is not called with live products. 

**Expected Results:**

   OnActivityResult should be called, similar to the local / beta testing.

**Additional Information:**

   More info available here: http://forums.xamarin.com/discussion/44748/problem-with-xamarin-inappbilling-possible-bug
Comment 1 John Miller [MSFT] 2015-07-06 15:32:49 UTC
From customer case:

I'm running version: *2.2* of *Xamarin.InAppBilling*

I managed to get expected behaviour last night (live products update
exactly as Reserved productIDs do), but I don't know which change exactly
did it. I changed three things:

- Switched every relevant method from static to non-static.
- Switched from *Security.Unify* for the *value *to a *string *in this
method: _serviceConnection = new InAppBillingServiceConnection(Invoke,
- Included *base.OnActivityResult(requestCode, resultCode, data); *in
the *override OnActivityResult* method. It wasn't included in the
example project, but I figured it was worth a shot.

So one of those three fixed it. I'm slowly walking back the changes to see
if I can break it again, to see which one did it. I'll try to reproduce the
error in a test project and send that to you.

*Xamarin information:*

*Xamarin 3.11.666.0 *
*Visual Studio extension to enable development for Xamarin.iOS and

*Visual Studio plugin to enable development for Xamarin.Android.*

*Xamarin.Forms Intellisense 1.0*
*Provides intellisense for Xamarin.Forms in the XML editor.*

*Visual Studio extension to enable development for Xamarin.iOS.*

*Xamarin.iOS Unified Migration 1.0*
*Automated migration for Xamarin iOS Classic projects to Unified*

*Xamarin.TestCloud.Integration 1.0*
*Early preview of Xamarin Test Cloud integration*