Skip to content

Commit

Permalink
removing getLoadedProducts from both platforms. use loadProductDetail…
Browse files Browse the repository at this point in the history
…s instead
  • Loading branch information
mohamnag committed Jul 4, 2014
1 parent 64d96df commit 8502794
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 49 deletions.
27 changes: 1 addition & 26 deletions src/android/com/mohamnag/inappbilling/InAppBillingPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,6 @@ else if ("consumeProduct".equals(action)) {
if (isReady(callbackContext)) {
consumeProduct(data.getString(0), callbackContext);
}

} // Get the list of loaded products
else if ("getLoadedProducts".equals(action)) {
if (isReady(callbackContext)) {
getLoadedProducts(callbackContext);
}
} // Get details of a loaded product
else if ("loadProductDetails".equals(action)) {
if (isReady(callbackContext)) {
Expand Down Expand Up @@ -484,26 +478,7 @@ private Error queryPurchases(String itemType) {

return ret;
}

/**
* Returns the list of all loaded products.
*
* @param callbackContext
*/
private void getLoadedProducts(CallbackContext callbackContext) throws JSONException {
jsLog("getLoadedProducts called.");

if (initialized) {
callbackContext.success(myInventory.getAllProductsJSON());
}
else {
callbackContext.error(new Error(
ERR_INVENTORY_NOT_LOADED,
"Inventory is not loaded."
).toJavaScriptJSON());
}
}


/**
* Loads products with specific IDs and gets their details.
*
Expand Down
23 changes: 0 additions & 23 deletions www/inappbilling.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,29 +307,6 @@ InAppBilling.prototype.consumeProduct = function(success, fail, productId) {
* @property {string} description description of product
*/

/**
* The success callback for [getLoadedProducts]{@link module:InAppBilling#getLoadedProducts}.
*
* @callback getLoadedProductsSuccessCallback
* @param {Array.<ProductDetails>} products
*/

/**
* Get all the loaded products. Products should be loaded before this call.
* You can either load items at [init]{@link module:InAppBilling#init} or by
* calling [loadProductDetails]{@link module:InAppBilling#loadProductDetails}.
*
* @param {getLoadedProductsSuccessCallback} success callback for successful query
* @param {errorCallback} fail callback for failed query
*/
InAppBilling.prototype.getLoadedProducts = function(success, fail) {
// TODO: remove this and use simply the loadProductDetails
this.log('getLoadedProducts called!');

//TODO: implement this for iOS!
return cordova.exec(success, fail, "InAppBillingPlugin", "getLoadedProducts", ["null"]);
};

/**
* This is the success callback for [loadProductDetails]{@link module:InAppBilling#loadProductDetails}.
* This will be called when process is successfully finished and will receive a list of valid and
Expand Down

0 comments on commit 8502794

Please sign in to comment.