Closed kamalasim74 closed 1 month ago
You haven't said anything useful to identify your problem. What is the function? Did you use the signal mentioned in the README file?
Sorry for my English, I have implemented this sdk in my game which shows rewardAd successfully. But the problem is when rewardAd completed now I want to give user Rewards I am beginner in programming. I have use this method to give rewards to users when rewardAd completes
func _ready():
YandexSDK.rewarded_ad.connect(_on_rewarded_ad)
func _on_rewarded_ad(result: String) -> void:
match result:
"rewarded":
rewardad_completed()
"closed":
pass
"opened":
pass
"error":
pass
func rewardad_completed():
Coins += 30
Можно по русски если удобно, мой англисский тоже не очень. Did _on_reward_ad called? Try to add print(result) to function and check it in browser debug panel (F12 button, press it before launch the game or find "developer tools" button in your browser)
Объявления показываются успешно, но не удается добавить награды пользователям после завершения рекламы.
Можете ли вы дать мне метод, чтобы награждать игроков, когда реклама завершена?
Проверь вызывается ли у тебя функция func _ready(): и func _on_rewarded_ad(result: String) -> void: Поставь в них какие-нибудь принты print("ready") и print(result) или что-то типа, запусти на площадке и зайди в дебаг браузера (F12 нажми) и посмотри вызываются ли эти функции
Это правильный метод для награждения игрока? Если вы используете другой метод, пожалуйста, предоставьте ваш метод.
func _on_rewarded_ad(result: String) -> void:
match result:
"rewarded":
rewardad_completed()
"closed":
pass
"opened":
pass
"error":
pass
Yes, I was used this call inside _ready in my game and it's worked
YandexSDK.rewarded_ad.connect(func(result: String) -> void:
if not result:
return
match result:
"opened":
pass
"rewarded":
reward_func()
"closed":
pass
"error":
pass
)
Not working bro. I am using Godot 4.3
TRY TO DEBUG IT PLS. Try to add print(result) to function and check it in browser debug panel (F12 button, press it before launch the game or find "developer tools" button in your browser)
get plugin from git, newer version
ok
Did it's work?
Looks like you somehow got an older version of the plugin (I checked, I updated it in the asset lib two months ago), so resent README guide didn't work.
It worked bro thanks.
Hi I am using this sdk for my game. When reward ads completes Rewards not added to players. I am using this method
func _on_rewarded_ad(result: String) -> void:
func rewardad_completed()
here is the code which add rewards