poingstudios / godot-admob-ios

Godot's AdMob Plugin for iOS with support for Mediations.
https://poingstudios.github.io/godot-admob-plugin/
MIT License
89 stars 14 forks source link

Script error occurs when interstitial or rewarded ad fails to load #84

Closed abcjjy closed 6 months ago

abcjjy commented 7 months ago

Godot version

v4.1.1.stable.official [bd6af8e0e]

Plugin version

3.0.0

System information

Godot v4.1.1.stable - macOS 13.4.0 - Vulkan (Mobile) - dedicated AMD Radeon Pro 560X - Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz (12 Threads)

Phone information, if applicable

iPhone X iOS 14.8

Issue description

When ad fails to load, error is raised when creating responses.

USER SCRIPT ERROR: Invalid get index 'adapter_class_name' (on base: 'Dictionary').
   at: create (res://addons/admob/src/api/core/AdapterResponseInfo.gd:55)

After looking into the code, the error is originated from here

https://github.com/Poing-Studios/godot-admob-plugin/blob/0ad47f8b933e2283c4f6ae9713e490b4a9a76d63/addons/admob/src/api/core/ResponseInfo.gd#L45C50-L45C50

The adapter_responses in the dictionary only contains a pubid key.

I've setup mediation in admob but I don't include any mediation plugins.

Here is response info dictionary.

{
"loaded_adapter_response_info": 
  { "adapter_class_name": "",
  "ad_source_id": "", 
  "ad_source_name": "", 
  "ad_source_instance_id": "", 
  "ad_source_instance_name": "", 
  "ad_unit_mapping": {  }, 
  "ad_error": {  },
  "latency_millis": 0 
  }, 
"adapter_responses": {
  0: { 
    "pubid": "ca-app-pub-xxxxxx/cak=no_cache&cadc=d4&caqid=xxxxxx"
   }
}, 
"response_extras": { 
  "mediation_group_name": "app ios reward" 
}, 
"mediation_adapter_class_name": "", 
"response_id": "yyhGZb-rJ6mas8IPhqC14A8" 
}

Steps to reproduce

Turn off device internet connection and load ad, error occurs

Additional context

No response

gumaciel commented 7 months ago

hi, thank you for opening this issue, we will fix it in the next version

gumaciel commented 6 months ago

@abcjjy Fixed at:

https://github.com/Poing-Studios/godot-admob-ios/releases/tag/v3.1.0 https://github.com/Poing-Studios/godot-admob-plugin/releases/tag/v3.1.0

please test it