I am using Swift 3.0 and Xcode 8 Beta 6. My application has not yet been released on the AppStore.
I think something is missing here, but I don’t know what. I used to use iAds with other applications without any problems. But this is the first time I'm trying to reward a video and AdMob.
I followed your tutorial and wrote this code in my AppDelegate.swift:
FIRApp.configure() GADMobileAds.configure(withApplicationID: "my_app_id_created_on_admob") let request = GADRequest() GADRewardBasedVideoAd.sharedInstance().load(request, withAdUnitID: "my_add_unit_created_on_admob")
Then I got this in the UIViewController, which I click when I click on the button.
I want this VC to present award-winning ads at startup. Therefore, I also assigned him an AdMob delegate:
override func viewDidLoad() { super.viewDidLoad() GADRewardBasedVideoAd.sharedInstance().delegate = self }
I declared this VC as the following GADRewardBasedVideoAdDelegate and add all these protocol implementations at the end of the VC:
func rewardBasedVideoAdDidOpen(_ rewardBasedVideoAd: GADRewardBasedVideoAd!) { print("rewardBasedVideoAdDidOpen") } func rewardBasedVideoAdDidClose(_ rewardBasedVideoAd: GADRewardBasedVideoAd!) { print("rewardBasedVideoAdDidClose") GADRewardBasedVideoAd.sharedInstance().load(GADRequest(), withAdUnitID: "my_add_unit_created_on_admob") } func rewardBasedVideoAdDidReceive(_ rewardBasedVideoAd: GADRewardBasedVideoAd!) { print("rewardBasedVideoAdDidReceive") } func rewardBasedVideoAdDidStartPlaying(_ rewardBasedVideoAd: GADRewardBasedVideoAd!) { print("rewardBasedVideoAdDidStartPlaying") } func rewardBasedVideoAdWillLeaveApplication(_ rewardBasedVideoAd: GADRewardBasedVideoAd!) { print("rewardBasedVideoAdWillLeaveApplication") } func rewardBasedVideoAd(_ rewardBasedVideoAd: GADRewardBasedVideoAd!, didRewardUserWith reward: GADAdReward!) { print("Should reward user with \(reward.amount) \(reward.type)") } func rewardBasedVideoAd(_ rewardBasedVideoAd: GADRewardBasedVideoAd!, didFailToLoadWithError error: Error!) { print("didFailToLoadWithError") GADRewardBasedVideoAd.sharedInstance().load(GADRequest(), withAdUnitID: "my_add_unit_created_on_admob") }
2 questions from there:
Why did some videos show good results even if I haven’t yet implemented any other mediation network in the AdMob control panel?
Why did not didRewardUserWith be called after I watched the videos shown on my development device?
I thought that perhaps this was normal, and this function didRewardUserWith was called only by other mediation advertisements. Thus, I implemented 3 others (AdColony, Chartboost and AppLovin) to check if this was the reason ... But then this is just AD: there is no up-to-date documentation for those who are “adapters”, but are mostly incompatible with the latest AdMob Platform , the bridges needed from Obj-C to Swift, and no one talks about it ...
Another thing: from this morning I really do not know why my GADRewardBasedVideoAd.sharedInstance () was not able to load the video with ads anymore ...
Any help here would be appreciated by veeeeeery ... I'm running out of hope :(