Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ package com.freshplanet.ane.AirInAppPurchase {

productsIds ||= [];
subscriptionIds ||= [];
_context.call("getProductsInfo", productsIds, subscriptionIds);
if (!_allStrings(productsIds) || !_allStrings(subscriptionIds)) {
_dispatchEvent(InAppPurchaseEvent.PRODUCT_INFO_ERROR, "Product and subscription IDs must all be strings");
} else {
_context.call("getProductsInfo", productsIds, subscriptionIds);
}
}
}

Expand Down Expand Up @@ -214,6 +218,17 @@ package com.freshplanet.ane.AirInAppPurchase {
_dispatchEvent(event.code, event.level);
}

/** Return true if all values in the array are strings */
private static function _allStrings(arr:Array):Boolean {

for each (var obj:Object in arr) {
if (!(obj is String)) {
return false;
}
}
return true;
}

/**
*
* @param strings
Expand Down