godot: iOS SKPaymentTransactionStateFailed not generating a purchase failed event

Godot version: 3.2.3

OS/device including version: iOS 12.4, Xcode 11.3

Issue description: When a transaction fails because of an itunes login error xcode debug is showing status transaction failed! Per in_app_store.mm I would expect an event.error to show in console but this is never happening

	while payment.get_pending_event_count() > 0:
		var event = payment.pop_pending_event()
#		print("EVENT KEYS: ",event.keys())
		
		if event.type == "purchase":
			if event.result == "ok":
				print("PURCHASE EVENT, OK: ", event.product_id)
				ios_purchases_updated( str(event.product_id)) 
				payment.finish_transaction(event.product_id)
				Events.emit_signal("working")
			else:
				print("PURCHASE EVENT, ERROR: ",event.error)

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 18 (12 by maintainers)

Most upvoted comments

I’ve been delving into the IAP process and code. I just opened #44969 which might address some of the issues seen here.

Here’s a simplified version of my approach. Whenever I want to take an action that should result in an event in the queue I will

  • call the method on the app store singleton (_purch_singleton)
  • set a local status variable to “querying”
  • start a timer that will fire every second for 180 seconds.
  • when the timer fires all events are removed from the queue and “handlers” are called for each recognized “type”
  • When the 180 seconds is reached I check the status variables to see if any are still “querying”. If there are some then I perform my timeout logic.

It’s a long timeout, but it shouldn’t be encountered very often.