My game crashes after a rewarded video is closed

#1

Hi, I tried out the admob extension and it turns out anytime a rewarded video has finished playing and I close it, the game stops.
What might have caused this?

0 Likes

#2

Is it the one by @sergey.lerg?

0 Likes

#3

Yeah

0 Likes

#4

Have you checked the logs?
Is there a “_crash” file you can supply?

0 Likes

#5

Do you have the admob listener function? What do you have in it?

0 Likes

#6
local sysinfo = sys.get_sys_info()
local function listener(event)
    if event.phase == "init" or event.phase == "closed" then
	admob.load{
		type = "rewarded",
		id = rewarded_id[sysinfo.system_name],
		immersive = true,
		keywords = {"game", "casual"},
		is_designed_for_families = true
	}
     elseif event.phase == "rewarded" then
	    msg.post(sender, "completed")
    end
end

function init(self)
    admob.init{
	    app_id = app_id[sysinfo.system_name],
	    test = true, 
	    listener = listener
    	}
 end
0 Likes

#7

What is sender in msg.post? Can you remove this line and test without it?

1 Like

#8

That seems to be the problem. Thanks.

0 Likes