April 2021
Beginner to intermediate
506 pages
11h 57m
English
Currently, there is no way for the GameScene to know when ads are getting loaded and presented to the player. You’ll take care of this problem by adding some custom notifications. With notifications,[63] you can broadcast specific information to designated observers. These observers then watch for the notifications, taking specific actions when they occur.
Open the AdMobHelper.swift file and add the following block of code to the bottom of the file:
| | extension Notification.Name { |
| | static let userDidEarnReward = Notification.Name("userDidEarnReward") |
| | static let adDidOrWillPresent = Notification.Name("adDidOrWillPresent") |
| | static let adDidOrWillDismiss = Notification.Name("adDidOrWillDismiss" ... |
Read now
Unlock full access