How to call App Tracking Transparency in Godot 4?

Godot Version

4.1.1

Question

Hi everyone!

I’m trying to release my game in App Store but I struggle to show this ATT alert.
There are plugins like “DrMoriarty/godot-ios-att” but from what I know I can’t use it in Godot 4.

I’m using Admob plugin from Poing Studios that has UMP implementation. I followed all the instructions here and here but I can’t see the alert on Simulator in Xcode and Apple rejects my submission saying I don’t show the alert.

So this is my code for the first scene:

func _ready():
	var request := ConsentRequestParameters.new()
	# Set tag for underage of consent. false means users are not underage.
	request.tag_for_under_age_of_consent = false
	UserMessagingPlatform.consent_information.update(request, _on_consent_info_updated_success, _on_consent_info_updated_failure)

	MobileAds.initialize()

func _on_consent_info_updated_success():
	if UserMessagingPlatform.consent_information.get_is_consent_form_available():
		load_form()

func _on_consent_info_updated_failure(form_error : FormError):
	pass

func load_form():
	UserMessagingPlatform.load_consent_form(_on_consent_form_load_success, _on_consent_form_load_failure)

func _on_consent_form_load_success(consent_form : ConsentForm):
	_consent_form = consent_form
	if UserMessagingPlatform.consent_information.get_consent_status() == UserMessagingPlatform.consent_information.ConsentStatus.REQUIRED:
		consent_form.show(_on_consent_form_dismissed)

func _on_consent_form_load_failure(form_error : FormError):
	pass

func _on_consent_form_dismissed(form_error : FormError):
	if UserMessagingPlatform.consent_information.get_consent_status() == UserMessagingPlatform.consent_information.ConsentStatus.OBTAINED:
		# App can start requesting ads.
		pass
	# Handle dismissal by reloading form
	load_form()func _finish():
	Global.goto_scene(start_scene)

func _on_consent_info_updated_success():
	if UserMessagingPlatform.consent_information.get_is_consent_form_available():
		load_form()

func _on_consent_info_updated_failure(form_error : FormError):
	pass

func load_form():
	UserMessagingPlatform.load_consent_form(_on_consent_form_load_success, _on_consent_form_load_failure)

func _on_consent_form_load_success(consent_form : ConsentForm):
	_consent_form = consent_form
	if UserMessagingPlatform.consent_information.get_consent_status() == UserMessagingPlatform.consent_information.ConsentStatus.REQUIRED:
		consent_form.show(_on_consent_form_dismissed)

func _on_consent_form_load_failure(form_error : FormError):
	pass

func _on_consent_form_dismissed(form_error : FormError):
	if UserMessagingPlatform.consent_information.get_consent_status() == UserMessagingPlatform.consent_information.ConsentStatus.OBTAINED:
		# App can start requesting ads.
		pass
	# Handle dismissal by reloading form
	load_form()

This is my frameworks list:

And here is my plist:
(will share it in the comments)

And yes, I created messages in Admob Privacy & messaging section. Both for GDPR and IDFA.

I can’t find that someone could face the same problem as me. Please help me, I’m lost :frowning:

My plist:

For those who will be looking to the same question. In my case, the problem was that I was changing the scene too soon, before the form even was loaded. So I just added a timer before scene change and it worked.

1 Like