- Changed interface 'Phonegap.exec' to 'cordova.exec'
- Use paymentWithProduct instead of paymentWithProductIndentifier
because It was deprecated in iOS 5.0
- Changed interface of requestProductData parameters
- Add prefix in NSLog
When I changed the JS callbacks to use `apply()`, I left the
"this" argument set to null. This caused code in InAppPurchaseManager.prototype.updatedTransactionCallback
to fail because references to `this` become null instead
of references to the default instance of InAppPurchaseManager.
This commit modifies the apply() calls to use plugins.inAppPurchaseManager as the "this" argument.
The newest version of PhoneGap (or Apache Callback) has switched from using SBJson to JSONKit. If JSONKit is available, we its `JSONString` implementation, otherwise, use SBJson's `JSONRepresentation` implementation.
Also, this commit fixes callback arguments for requestProductData and updatedTransactionCallback.
Calls to requestProductsData currently fails for
the following two conditions:
1. Title or description contains single quotes
2. Invalid product IDs are returned.
Here's an example JavaScript statement generated:
window.plugins.inAppPurchaseManager.callbackMap.b0([{
id: 'com.acme.product.1',
title: 'Acme's #1 Product',
description: 'Acme's #1 Product Description.',
price: '$4.99'
}, ], [com.acme.product.5, com.acme.product.2, com.acme.product.4, com.acme.product.3]);
Note the single quote in the title and description
(they are not properly escaped). Also, look at the invalid product IDs returned -- they are not quoted.
After restoring completed transactions, the payment queue observer is
notified by a call to either
paymentQueue:restoreCompletedTransactionsFailedWithError: or
paymentQueueRestoreCompletedTransactionsFinished:. This patch
delegates calls to these methods to callback functions on the
plugins.inAppPurchaseManager.
Adds a requestProductsData method to the InAppPurchaseManager which
takes an array of productIds and invokes a single callback with the
results of the SKProductsRequest.
Callback mapping for requestProductData already depends on the
existence of plugins.inAppPurchaseManager. So no need to depend
on InAppPurchaseManager.manager and require another global
variable.
In paymentQueue:updateTransactions there was no case handling
SKPaymentTransactionStatePurchasing which resulted in an superfluous
"Invalid state" log message.