I am working on using Google In-App Billing in a Xamarin Android app, using the Xamarin.InAppBilling component.
I am working on receiving the result of the purchase. The documentation says:
To complete the purchase cycle, you will need to override the OnActivityResult method of the Activity of the app that initiated the purchase and pass the result to the HandleActivityResult method of the BillingHandler of your open InAppBillingServiceConnection:
protected override void OnActivityResult (int requestCode, Result resultCode, Intent data)
{
// Ask the open service connection's billing handler to process this request
_serviceConnection.BillingHandler.HandleActivityResult (requestCode, resultCode, data);
// TODO: Use a call back to update the purchased items
// or listen to the OnProductPurchased event to
// handle a successful purchase
}
My issue is that my activity that initiates the purchase also starts other activities besides the Google Play purchase activity. I already have an OnActivityResult method for these other activities. So, I don't want to call BillingHandler.HandleActivityResult() in every case. I need to know whether this is from a Google Play purchase, or something else.
Is there a particular requestCode or range of requestCodes that the Google Play purchase uses that I can filter on?