I added an in-app purchase plugin for iOS to my game. When I send the game to Testflight and open it, the payment screen does not appear, that is, it does not work. There is no response.
I did the following steps:
https://github.com/LettucePie/ios-plugin-integrate-demo?tab=readme-ov-file
I created the ios inappstore plugin files for Godot 4.2.2 by following the steps mentioned in the link above.
I pasted the created xcframework folders with the inappstore.gdip file to the ios/plugins path in my project.
The codes are as follows:
extends Node
var in_app_store
signal bought_product(product_id: String)
var my_product_id = "bundle_seven"
func _ready():
if Engine.has_singleton("InAppStore"):
in_app_store = Engine.get_singleton("InAppStore")
else:
print("iOS IAP plugin is not available on this platform.")
func _on_button_pressed():
if OS.get_name() == "iOS":
on_purchase_pressed(my_product_id)
await get_tree().create_timer(1.0).timeout
check_events()
func on_purchase_pressed(product_id: String):
in_app_store.set_auto_finish_transaction(true)
var result = in_app_store.purchase({ "product_id": product_id })
if result == OK:
print("busy ...")
#animation.play("busy") # show the "waiting for response" animation
else:
print("error.")
#show_error()
# put this on a 1 second timer or something
func check_events():
while in_app_store.get_pending_event_count() > 0:
var event = in_app_store.pop_pending_event()
if event.type == "purchase":
if event.result == "ok":
emit_signal("bought_product", event.product_id)
print(event.product_id + " purchase successful!")
#show_success(event.product_id)
else:
print(event.product_id + " purchase failed.")
#show_error()
I got export for iOS from Godot 4.2.2. Export settings are as follows :
I opened the export project from Xcode, the frameworks settings were as follows :
I added the product id in Apple Developer and it was approved :
But the payment screen does not appear, what did I do wrong or missing?