StoreKit: UpdatedTransactions() not called for restores?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

StoreKit: UpdatedTransactions() not called for restores?

dermotos
I've implemented my in app purchasing, and the purchasing itself works fine. I have based it on the Xamarin sample.

However, when I do a restore purchase (SKPaymentQueue.DefaultQueue.RestoreCompletedTransactions();)
the delegate PaymentQueueRestoreCompletedTransactionsFinished(SkPaymentQueue queue) (phew!) gets called, but UpdatedTransactions doesn't.

According to Apple docs:

paymentQueueRestoreCompletedTransactionsFinished:
Tells the observer that the payment queue has finished sending restored transactions.

Discussion
This method is called after all restorable transactions have been processed by the payment queue. Your application is not required to do anything in this method.

Is this a StoreKit bug? Everything is setup correctly, if I literally just switch the button that calls purchase to restore instead, the above behavior occurs. Im wondering has anyone encountered similar issues? Im also having strange problems at the moment creating test users (every user, no matter what details I enter already exists apparently).  Hopefully Apple are just making changes. Anyone else encounter issues with StoreKit?

One other thing, I noticed that the sandbox is verrrry slow. It can take up to a minute sometimes for the UpdatedTransactions() method to fire during purchases. Is this normal/limited to sandbox?

Thanks. :-)
Reply | Threaded
Open this post in threaded view
|

Re: StoreKit: UpdatedTransactions() not called for restores?

Craig Dunn-2
Hey there,

I know that Restore "does work", as I've built commercial apps that implement it; and the Xamarin sample also works for me.

The documentation basically says if there are no restorable-transactions then UpdatedTransactions()
won't get called. If
PaymentQueueRestoreCompletedTransactionsFinished()
is getting called, then that indicates that StoreKit is definitely "hearing you" and trying to restore! So it is puzzling...

Might as well check all the obvious stuff:
- there have definitely been purchases done by the Test Apple ID that is performing the restore?
- especially, these transactions are definitely having the FinishTransaction() method called on them?
- the type of products you are selling are Non-Consumable (or Auto-renewing subscription)? All other product types don't get Restored.


Finally, although you don't *have* to do anything in 
PaymentQueueRestoreCompletedTransactionsFinished()
I think it is nice to provide some sort of indication to the user that a Restore was run and is now complete. Otherwise they have just pressed a button (Restore) but with no visual feedback or idea whether it worked or not! 

As for speed - yes, sandbox can be slow.

I've been testing other features of StoreKit the past few days and haven't had any problems (other than it's slightly slower than production).

HTH
craig


On Tue, Sep 18, 2012 at 8:18 PM, dermotos <[hidden email]> wrote:
I've implemented my in app purchasing, and the purchasing itself works fine.
I have based it on the Xamarin sample.

However, when I do a restore purchase
(SKPaymentQueue.DefaultQueue.RestoreCompletedTransactions();)
the delegate PaymentQueueRestoreCompletedTransactionsFinished(SkPaymentQueue
queue) (phew!) gets called, but UpdatedTransactions doesn't.

According to Apple docs:

paymentQueueRestoreCompletedTransactionsFinished:
Tells the observer that the payment queue has finished sending restored
transactions.

Discussion
This method is called after all restorable transactions have been processed
by the payment queue. *Your application is not required to do anything in
this method.*

Is this a StoreKit bug? Everything is setup correctly, if I literally just
switch the button that calls purchase to restore instead, the above behavior
occurs. Im wondering has anyone encountered similar issues? Im also having
strange problems at the moment creating test users (every user, no matter
what details I enter already exists apparently).  Hopefully Apple are just
making changes. Anyone else encounter issues with StoreKit?

One other thing, I noticed that the sandbox is verrrry slow. It can take up
to a minute sometimes for the UpdatedTransactions() method to fire during
purchases. Is this normal/limited to sandbox?

Thanks. :-)



--
View this message in context: http://monotouch.2284126.n4.nabble.com/StoreKit-UpdatedTransactions-not-called-for-restores-tp4657072.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch


_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|

Re: StoreKit: UpdatedTransactions() not called for restores?

dermotos
Hi,

Thanks for your reply. I actually had a large response written, but just went into iTunes connect and created a new user and used it and it worked! The old test user still doesn't work, leading me to believe while Apple were upgrading the store to support iOS6 they must've messed some dev stuff up (I was getting weird errors and it was impossible to create a test user last night).

All good now. Thanks!

PS: Noticed from your blog's header you're a Sydneysider too?
Reply | Threaded
Open this post in threaded view
|

Re: StoreKit: UpdatedTransactions() not called for restores?

dermotos
Ok, Im almost there. I've one other item that's confusing me. When I validate my transaction on the server, I send through the receipt data, and then on my server send it to apple and get the receipt, decode it and it looks like this:

{
"receipt":{"original_purchase_date_pst":"2012-09-19 05:15:32 America/Los_Angeles", "unique_identifier":"44a09377a161d6009cf8a16fe3469f8c4d1c9e40", "original_transaction_id":"1000000056101005", "bvrs":"0.7.0.0", "transaction_id":"1000000056101005", "quantity":"1", "product_id":"(removed)", "item_id":"560739308", "purchase_date_ms":"1348056932296", "purchase_date":"2012-09-19 12:15:32 Etc/GMT", "original_purchase_date":"2012-09-19 12:15:32 Etc/GMT", "purchase_date_pst":"2012-09-19 05:15:32 America/Los_Angeles", "bid":"(removed)", "original_purchase_date_ms":"1348056932296"}, "status":0}

basically for an original purchase (NOT a restore in this case), Apple sends me the above back, which has the same transaction id for the transaction AND the original transaction. Also, the original purchase date and purchase date are the exact same. Is this the normal way it works in the live app store? Should I be comparing the transactionID with the original transaction ID, and if they are the same, processing it as an original purchase?

Given my experiences over the last few days with StoreKit sandbox, I dont want to make any assumptions!