views:

58

answers:

2

I have a complete in app purchase solution but am wondering if I am handling errors correctly. I handle errors using code similar to the Apple example here;

- (void) failedTransaction: (SKPaymentTransaction *)transaction
{
if (transaction.error.code != SKErrorPaymentCancelled)
    {
        // Optionally, display an error here.
    }
    [[SKPaymentQueue defaultQueue] finishTransaction: transaction];
}

But my question is - WILL the storekit display relevant errors to the user (unable to connect, payment declined etc) OR do I need to always handle this? It seems from testing that when the storekit is working OK, it does indeed handle errors itself, so I can silently dump them (well, in fact we log them on another server).

However when the storekit sandbox is playing up, we get random errors that indicate a problem, and NO alerts from the storekit itself.

What do you guys do with errors? Do you always alert the user or will that end up duplicating alerts that the storekit has already given.

Thanks Roger

+1  A: 

It is the app's responsibility to handle errors.

The OS doesn't display a message because what message to display, or whether to display one at all (as opposed to, say, removing an item from a table) is something the OS can't know for certain.

Olie
Hi Ollie - do you use storekit? I ask because the OS DOES display many storekit errors by itself.
Roger