Bug 13649 - Monotouch SKPaymentTransactionObserver casting error
Summary: Monotouch SKPaymentTransactionObserver casting error
Status: RESOLVED NORESPONSE
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 6.9.3.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-07-31 08:29 UTC by Gleb
Modified: 2013-12-05 18:36 UTC (History)
2 users (show)

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


Attachments
bug screenshot (197.19 KB, image/jpeg)
2013-07-31 08:29 UTC, Gleb
Details


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 on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NORESPONSE

Description Gleb 2013-07-31 08:29:08 UTC
Created attachment 4497 [details]
bug screenshot

I am trying to use In-Apps in my project. I started with the exact implementation as in https://github.com/conceptdev/xamarin-samples/tree/master/InAppPurchase/NonConsumables

On the simulator all works fine and i have responses from Apple. But on the real device (iPod5, last OS) i have an error casting SKPaymentTransactionObserver. It crashes the application on startup.

Here is the screenshot.

Code for SKPaymentTransactionObserver:

using System;
using System.Linq;
using MonoTouch.StoreKit;
using MonoTouch.Foundation;
using MonoTouch.UIKit;

namespace MyNameSpace {
	internal class iOSCustomPaymentObserver : SKPaymentTransactionObserver {
		private iOSInAppPurchaseManager theManager;

		public iOSCustomPaymentObserver(iOSInAppPurchaseManager manager)
		{
			theManager = manager;
		}

		// called when the transaction status is updated
		public override void UpdatedTransactions (SKPaymentQueue queue, SKPaymentTransaction[] transactions)
		{
			Console.WriteLine ("UpdatedTransactions");
			foreach (SKPaymentTransaction transaction in transactions)
			{
				switch (transaction.TransactionState)
				{
					case SKPaymentTransactionState.Purchased:
						theManager.CompleteTransaction(transaction);
						break;
						case SKPaymentTransactionState.Failed:
						theManager.FailedTransaction(transaction);
						break;
						case SKPaymentTransactionState.Restored:
						theManager.RestoreTransaction(transaction);
						break;
						default:
						break;
				}
			}
		}

		public override void PaymentQueueRestoreCompletedTransactionsFinished (SKPaymentQueue queue)
		{
			// Restore succeeded
			Console.WriteLine(" ** RESTORE PaymentQueueRestoreCompletedTransactionsFinished ");
		}
		public override void RestoreCompletedTransactionsFailedWithError (SKPaymentQueue queue, NSError error)
		{
			// Restore failed somewhere...
			Console.WriteLine(" ** RESTORE RestoreCompletedTransactionsFailedWithError " + error.LocalizedDescription);
		}
	}
}
Comment 1 Gleb 2013-07-31 08:36:59 UTC
The bug is go away when I turn off the "Use the reference counting extension" in profile.
Comment 2 Rolf Bjarne Kvinge [MSFT] 2013-07-31 11:56:11 UTC
Can you please attach crash report / device logs for the crash, as well as a test project we can use to reproduce it?
Comment 3 Gleb 2013-08-02 07:46:44 UTC
Can't reproduce it now :(
Comment 4 PJ 2013-11-19 17:05:57 UTC
This bug has been in the NEEDINFO state with no changes for the last 90 days. Can we put this back into the NEW or CONFIRMED state, or are we still awaiting response?

If there is no change in the status of this bug over the next two weeks, this bug will be marked as NORESPONSE.
Comment 5 PJ 2013-12-05 18:36:25 UTC
This bug has not been changed from the NEEDINFO state since my previous comment, marking as RESOLVED NORESPONSE.

Please feel free to REOPEN this bug at any time if you are still experiencing the issue. Please add the requested information and set the bug back to the NEW (or CONFIRMED) state.