mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
InAppPurchases: Add support for Android BillingClient 5.0.0
This commit is contained in:
parent
7c66dc8e15
commit
6375f640db
7 changed files with 402 additions and 185 deletions
|
|
@ -192,20 +192,23 @@ private:
|
|||
{
|
||||
purchaseInProgress = false;
|
||||
|
||||
auto idx = findVoiceIndexFromIdentifier (info.purchase.productId);
|
||||
|
||||
if (isPositiveAndBelow (idx, voiceProducts.size()))
|
||||
for (const auto productId : info.purchase.productIds)
|
||||
{
|
||||
auto& voiceProduct = voiceProducts.getReference (idx);
|
||||
auto idx = findVoiceIndexFromIdentifier (productId);
|
||||
|
||||
voiceProduct.isPurchased = success;
|
||||
voiceProduct.purchaseInProgress = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// On failure Play Store will not tell us which purchase failed
|
||||
for (auto& voiceProduct : voiceProducts)
|
||||
if (isPositiveAndBelow (idx, voiceProducts.size()))
|
||||
{
|
||||
auto& voiceProduct = voiceProducts.getReference (idx);
|
||||
|
||||
voiceProduct.isPurchased = success;
|
||||
voiceProduct.purchaseInProgress = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// On failure Play Store will not tell us which purchase failed
|
||||
for (auto& voiceProduct : voiceProducts)
|
||||
voiceProduct.purchaseInProgress = false;
|
||||
}
|
||||
}
|
||||
|
||||
guiUpdater.triggerAsyncUpdate();
|
||||
|
|
@ -217,13 +220,16 @@ private:
|
|||
{
|
||||
for (auto& info : infos)
|
||||
{
|
||||
auto idx = findVoiceIndexFromIdentifier (info.purchase.productId);
|
||||
|
||||
if (isPositiveAndBelow (idx, voiceProducts.size()))
|
||||
for (const auto productId : info.purchase.productIds)
|
||||
{
|
||||
auto& voiceProduct = voiceProducts.getReference (idx);
|
||||
auto idx = findVoiceIndexFromIdentifier (productId);
|
||||
|
||||
voiceProduct.isPurchased = true;
|
||||
if (isPositiveAndBelow (idx, voiceProducts.size()))
|
||||
{
|
||||
auto& voiceProduct = voiceProducts.getReference (idx);
|
||||
|
||||
voiceProduct.isPurchased = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue