@@ -172,13 +172,13 @@ class LoggingRewardedVideoListener : public rewarded_video::Listener {
172
172
static void onAdViewInitializeCompletionCallback (
173
173
const firebase::Future<void >& future, void * userData) {
174
174
FirebaseScene* scene = static_cast (userData);
175
- if (future.Error () == firebase::admob::kAdMobErrorNone ) {
175
+ if (future.error () == firebase::admob::kAdMobErrorNone ) {
176
176
scene->logMessage (" Initializing the ad view completed successfully." );
177
177
} else {
178
178
scene->logMessage (" Initializing the ad view failed." );
179
179
scene->logMessage (
180
180
" ERROR: Action failed with error code %d and message \" %s\" ." ,
181
- future.Error (), future.ErrorMessage ());
181
+ future.error (), future.error_message ());
182
182
}
183
183
}
184
184
@@ -187,13 +187,13 @@ static void onAdViewInitializeCompletionCallback(
187
187
static void onAdViewLoadAdCompletionCallback (
188
188
const firebase::Future<void >& future, void * userData) {
189
189
FirebaseScene* scene = static_cast (userData);
190
- if (future.Error () == firebase::admob::kAdMobErrorNone ) {
190
+ if (future.error () == firebase::admob::kAdMobErrorNone ) {
191
191
scene->logMessage (" Loading the ad view completed successfully." );
192
192
} else {
193
193
scene->logMessage (" Loading the ad view failed." );
194
194
scene->logMessage (
195
195
" ERROR: Action failed with error code %d and message \" %s\" ." ,
196
- future.Error (), future.ErrorMessage ());
196
+ future.error (), future.error_message ());
197
197
}
198
198
}
199
199
@@ -202,14 +202,14 @@ static void onAdViewLoadAdCompletionCallback(
202
202
static void onInterstitialAdInitializeCompletionCallback (
203
203
const firebase::Future<void >& future, void * userData) {
204
204
FirebaseScene* scene = static_cast (userData);
205
- if (future.Error () == firebase::admob::kAdMobErrorNone ) {
205
+ if (future.error () == firebase::admob::kAdMobErrorNone ) {
206
206
scene->logMessage (
207
207
" Initializing the interstitial ad completed successfully." );
208
208
} else {
209
209
scene->logMessage (" Initializing the interstitial ad failed." );
210
210
scene->logMessage (
211
211
" ERROR: Action failed with error code %d and message \" %s\" ." ,
212
- future.Error (), future.ErrorMessage ());
212
+ future.error (), future.error_message ());
213
213
}
214
214
}
215
215
@@ -218,13 +218,13 @@ static void onInterstitialAdInitializeCompletionCallback(
218
218
static void onInterstitialAdLoadAdCompletionCallback (
219
219
const firebase::Future<void >& future, void * userData) {
220
220
FirebaseScene* scene = static_cast (userData);
221
- if (future.Error () == firebase::admob::kAdMobErrorNone ) {
221
+ if (future.error () == firebase::admob::kAdMobErrorNone ) {
222
222
scene->logMessage (" Loading the interstitial ad completed successfully." );
223
223
} else {
224
224
scene->logMessage (" Loading the interstitial ad failed." );
225
225
scene->logMessage (
226
226
" ERROR: Action failed with error code %d and message \" %s\" ." ,
227
- future.Error (), future.ErrorMessage ());
227
+ future.error (), future.error_message ());
228
228
}
229
229
}
230
230
@@ -233,13 +233,13 @@ static void onInterstitialAdLoadAdCompletionCallback(
233
233
static void onRewardedVideoInitializeCompletionCallback (
234
234
const firebase::Future<void >& future, void * userData) {
235
235
FirebaseScene* scene = static_cast (userData);
236
- if (future.Error () == firebase::admob::kAdMobErrorNone ) {
236
+ if (future.error () == firebase::admob::kAdMobErrorNone ) {
237
237
scene->logMessage (" Initializing rewarded video completed successfully." );
238
238
} else {
239
239
scene->logMessage (" Initializing rewarded video failed." );
240
240
scene->logMessage (
241
241
" ERROR: Action failed with error code %d and message \" %s\" ." ,
242
- future.Error (), future.ErrorMessage ());
242
+ future.error (), future.error_message ());
243
243
}
244
244
}
245
245
@@ -248,13 +248,13 @@ static void onRewardedVideoInitializeCompletionCallback(
248
248
static void onRewardedVideoLoadAdCompletionCallback (
249
249
const firebase::Future<void >& future, void * userData) {
250
250
FirebaseScene* scene = static_cast (userData);
251
- if (future.Error () == firebase::admob::kAdMobErrorNone ) {
251
+ if (future.error () == firebase::admob::kAdMobErrorNone ) {
252
252
scene->logMessage (" Loading rewarded video completed successfully." );
253
253
} else {
254
254
scene->logMessage (" Loading rewarded video failed." );
255
255
scene->logMessage (
256
256
" ERROR: Action failed with error code %d and message \" %s\" ." ,
257
- future.Error (), future.ErrorMessage ());
257
+ future.error (), future.error_message ());
258
258
// Rewarded Video returned an error. This might be because the developer did
259
259
// not put their Rewarded Video ad unit into kRewardedVideoAdUnit above.
260
260
scene->logMessage (" WARNING: Is your Rewarded Video ad unit ID correct?" );
@@ -539,13 +539,13 @@ bool FirebaseAdMobScene::init() {
539
539
void FirebaseAdMobScene::update (float delta) {
540
540
// If the ad view's Initialize() future has completed successfully, enable the
541
541
// ad view buttons.
542
- if (adView->InitializeLastResult ().Status () ==
542
+ if (adView->InitializeLastResult ().status () ==
543
543
firebase::kFutureStatusComplete &&
544
- adView->InitializeLastResult ().Error () ==
544
+ adView->InitializeLastResult ().error () ==
545
545
firebase::admob::kAdMobErrorNone ) {
546
546
// If ad view's LoadAd() has not been called yet, enable the load ad view
547
547
// button.
548
- if (adView->LoadAdLastResult ().Status () == firebase::kFutureStatusInvalid ) {
548
+ if (adView->LoadAdLastResult ().status () == firebase::kFutureStatusInvalid ) {
549
549
loadAdViewBtn->setEnabled (true );
550
550
}
551
551
showHideAdViewBtn->setEnabled (true );
@@ -554,21 +554,21 @@ void FirebaseAdMobScene::update(float delta) {
554
554
555
555
// Once the InterstitialAd::Intitialize() future has completed successfully,
556
556
// enable the interstitial ad buttons.
557
- if (interstitialAd->InitializeLastResult ().Status () ==
557
+ if (interstitialAd->InitializeLastResult ().status () ==
558
558
firebase::kFutureStatusComplete &&
559
- interstitialAd->InitializeLastResult ().Error () ==
559
+ interstitialAd->InitializeLastResult ().error () ==
560
560
firebase::admob::kAdMobErrorNone ) {
561
561
// If InterstitialAd::LoadAd() method has not been called yet, enable the
562
562
// load interstitial ad button.
563
- if (interstitialAd->LoadAdLastResult ().Status () ==
563
+ if (interstitialAd->LoadAdLastResult ().status () ==
564
564
firebase::kFutureStatusInvalid ) {
565
565
loadInterstitialAdBtn->setEnabled (true );
566
566
}
567
567
// Once the InterstitialAd::LoadAd() future has completed successfully,
568
568
// enable the show interstitial ad button.
569
- if (interstitialAd->LoadAdLastResult ().Status () ==
569
+ if (interstitialAd->LoadAdLastResult ().status () ==
570
570
firebase::kFutureStatusComplete &&
571
- interstitialAd->LoadAdLastResult ().Error () ==
571
+ interstitialAd->LoadAdLastResult ().error () ==
572
572
firebase::admob::kAdMobErrorNone &&
573
573
!interstitialAdShown) {
574
574
showInterstitialAdBtn->setEnabled (true );
@@ -577,9 +577,9 @@ void FirebaseAdMobScene::update(float delta) {
577
577
// ad has been displayed and dismissed by the user, clean up the existing
578
578
// interstitial ad object and create a new one. Note: InterstitialAd is a
579
579
// single-use object that can load and show a single AdMob interstitial ad.
580
- if (interstitialAd->ShowLastResult ().Status () ==
580
+ if (interstitialAd->ShowLastResult ().status () ==
581
581
firebase::kFutureStatusComplete &&
582
- interstitialAd->GetPresentationState () ==
582
+ interstitialAd->presentation_state () ==
583
583
firebase::admob::InterstitialAd::kPresentationStateHidden ) {
584
584
// Invalidate all Futures and enable loadInterstitialAdBtn.
585
585
interstitialAdShown = false ;
@@ -592,11 +592,11 @@ void FirebaseAdMobScene::update(float delta) {
592
592
}
593
593
// If the InterstitialAd::LoadAd() future completed but there was an error,
594
594
// then clean up the existing interstitial ad object and create a new one.
595
- if (interstitialAd->InitializeLastResult ().Status () ==
595
+ if (interstitialAd->InitializeLastResult ().status () ==
596
596
firebase::kFutureStatusComplete &&
597
- interstitialAd->LoadAdLastResult ().Status () ==
597
+ interstitialAd->LoadAdLastResult ().status () ==
598
598
firebase::kFutureStatusComplete &&
599
- interstitialAd->LoadAdLastResult ().Error () !=
599
+ interstitialAd->LoadAdLastResult ().error () !=
600
600
firebase::admob::kAdMobErrorNone ) {
601
601
// Invalidate all Futures and enable loadInterstitialAdBtn.
602
602
interstitialAdShown = false ;
@@ -611,21 +611,21 @@ void FirebaseAdMobScene::update(float delta) {
611
611
612
612
// Once the rewarded_video::Intitialize() future has completed successfully,
613
613
// enable the rewarded video buttons.
614
- if (rewarded_video::InitializeLastResult ().Status () ==
614
+ if (rewarded_video::InitializeLastResult ().status () ==
615
615
firebase::kFutureStatusComplete &&
616
- rewarded_video::InitializeLastResult ().Error () ==
616
+ rewarded_video::InitializeLastResult ().error () ==
617
617
firebase::admob::kAdMobErrorNone ) {
618
618
// If rewarded_video::LoadAd() method has not been called yet, enable the
619
619
// load rewarded video button.
620
- if (rewarded_video::LoadAdLastResult ().Status () ==
620
+ if (rewarded_video::LoadAdLastResult ().status () ==
621
621
firebase::kFutureStatusInvalid ) {
622
622
loadRewardedVideoBtn->setEnabled (true );
623
623
}
624
624
// Once the rewarded_video::LoadAd() future has completed successfully,
625
625
// enable the show rewarded video button.
626
- if (rewarded_video::LoadAdLastResult ().Status () ==
626
+ if (rewarded_video::LoadAdLastResult ().status () ==
627
627
firebase::kFutureStatusComplete &&
628
- rewarded_video::LoadAdLastResult ().Error () ==
628
+ rewarded_video::LoadAdLastResult ().error () ==
629
629
firebase::admob::kAdMobErrorNone &&
630
630
!rewardedVideoAdShown) {
631
631
showRewardedVideoBtn->setEnabled (true );
@@ -634,9 +634,9 @@ void FirebaseAdMobScene::update(float delta) {
634
634
// video has been displayed and dismissed by the user, invalidate all
635
635
// existing futures for rewarded_video methods and enable the load rewarded
636
636
// video button.
637
- if (rewarded_video::ShowLastResult ().Status () ==
637
+ if (rewarded_video::ShowLastResult ().status () ==
638
638
firebase::kFutureStatusComplete &&
639
- rewarded_video::GetPresentationState () ==
639
+ rewarded_video::presentation_state () ==
640
640
firebase::admob::rewarded_video::kPresentationStateHidden ) {
641
641
// Invalidate all Futures and enable loadRewardedVideoBtn.
642
642
rewardedVideoAdShown = false ;
@@ -648,11 +648,11 @@ void FirebaseAdMobScene::update(float delta) {
648
648
}
649
649
// If the rewarded_video::LoadAd() future completed but there was an error,
650
650
// then clean up the existing rewarded_video namespace and reinitialize.
651
- if (rewarded_video::InitializeLastResult ().Status () ==
651
+ if (rewarded_video::InitializeLastResult ().status () ==
652
652
firebase::kFutureStatusComplete &&
653
- rewarded_video::LoadAdLastResult ().Status () ==
653
+ rewarded_video::LoadAdLastResult ().status () ==
654
654
firebase::kFutureStatusComplete &&
655
- rewarded_video::LoadAdLastResult ().Error () !=
655
+ rewarded_video::LoadAdLastResult ().error () !=
656
656
firebase::admob::kAdMobErrorNone ) {
657
657
// Invalidate all Futures and enable loadRewardedVideoBtn.
658
658
rewardedVideoAdShown = false ;
0 commit comments