Skip to content

Commit 5723df8

Browse files
committed
unawaited GoogleMobileAds init
1 parent fb87b1d commit 5723df8

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/main.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'dart:async';
2+
13
import 'package:firebase_core/firebase_core.dart';
24
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
35
import 'package:flutter/foundation.dart';
@@ -28,7 +30,7 @@ Future<void> main() async {
2830
);
2931

3032
await AppRemoteConfig.initConfig();
31-
await AdHelper.initAds();
33+
unawaited(AdHelper.initAds());
3234

3335
// turn off the # in the URLs on the web
3436
usePathUrlStrategy();

lib/src/utils/ads/ad_helper.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import 'package:vs_live/src/utils/remote_config/remote_config.dart';
1010

1111
class AdHelper {
1212
// for initializing ads sdk
13-
static Future<void> initAds() async {
14-
await MobileAds.instance.initialize();
13+
static Future initAds() async {
14+
return MobileAds.instance.initialize();
1515
}
1616

1717
static InterstitialAd? _interstitialAd;

0 commit comments

Comments
 (0)