local function adListener( event )
local json = require( "json" )
local data = json.decode( event.data )
if (data.placementId) == "rewardedVideo" and event.phase == "completed" then
if composer.getSceneName("current") == "scenes.home" then
local getCoins = ssk.persist.get( "data.json", "coins" )
ssk.persist.set("data.json", "coins", getCoins + 50)
elseif composer.getSceneName("current") == "scenes.game" then
ssk.persist.set("ads.json", "continueAd", true)
end
end
end
The following code works perfectly fine on Android, but when testing on Xcode and TestFlight I get a Runtime error saying event.data is a nil string. Anyone knows why and how to fix this?