Search code examples
swiftchartboost

When my reward video finishes it doesn't give the user the coins.......Why?


Im using Chartboost reward videos and when the video is done playing I want to give the user 200 coins. I added the delegate function didCompleteRewardedVideo in my GameViewController but it doesn't give the user 200 coins after the video is finished being watched. What am I doing wrong?

     func didCompleteRewardedVideo(location: String!, withReward reward: Int32) {

    println("REWARDS!!!!")
    gameScene.coins += 200
    gameScene.coinLabel.text = String(gameScene.coins)
}

Solution

  • You are calling your delegate function GameViewController instead of doing that call your function into your GameScene where your coins are. and it will add and save it.