In-App Purchases for both android and iOS

Godot Version

Godot 4.2.1

Question

Hi community,

I want to ask about android and ios in-app purchases. For android, I am having errors in my consumePurchase method because I am calling the skus from the _on_purchases_updated function. I want to fetch the product id / sku of the item, what method can I call for this one? (Note: I used item.product_id and it returned null)

This is my code snippet for it:

func _on_purchases_updated(items):
print(“These are the items”, items)
for item in items:
# Check if item needs acknowledgment
if !item.is_acknowledged:
print(“Acknowledging purchase:”, item.skus[0])
print(“Purchase Token:”, item.purchase_token)
# Acknowledge the purchase
payment.acknowledgePurchase(item.purchase_token)
purchase_data[item.skus[0]] = item.purchase_token

acknowledged_items.emit(purchase_data)

For iOS:
Are there any updates about iOS In-App purchases? I am having a difficulty in finding sources for it. Also, I want to ask the following:

  1. Are there no specific method for iOS about consumePurchase (like the one for android google play)?
  2. Is there a method for iOS where I query the product details, in order to know whether that product is consumable, non-consumable, or subscription?

Thank you so much in advance! :))

1 Like