-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
96 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,48 @@ | ||
|
||
|
||
import 'dart:io'; | ||
|
||
import 'package:google_mobile_ads/google_mobile_ads.dart'; | ||
|
||
class AdMobService{ | ||
class AdMobService { | ||
static String? get bannerAdUnitId { | ||
if(Platform.isAndroid){ | ||
return 'ca-app-pub-7027299532858015/2193794122'; | ||
}else if (Platform.isIOS){ | ||
return 'ca-app-pub-7027299532858015/2193794122'; | ||
if (Platform.isAndroid) { | ||
return 'yourAdsToken'; | ||
} else if (Platform.isIOS) { | ||
return 'yourAdsToken'; | ||
} | ||
return null; | ||
} | ||
|
||
static String? get bannerAdUnitId2 { | ||
if(Platform.isAndroid){ | ||
return 'ca-app-pub-7027299532858015/9513132515'; | ||
}else if (Platform.isIOS){ | ||
return 'ca-app-pub-7027299532858015/2193794122'; | ||
if (Platform.isAndroid) { | ||
return 'yourAdsToken'; | ||
} else if (Platform.isIOS) { | ||
return 'yourAdsToken'; | ||
} | ||
return null; | ||
} | ||
|
||
|
||
static final BannerAdListener bannerListener = BannerAdListener( | ||
onAdLoaded: (ad) => print('Ad loaded'), | ||
onAdFailedToLoad: (ad,error) { | ||
ad.dispose(); | ||
print("error to load ad: ${error}"); | ||
} | ||
); | ||
|
||
|
||
onAdLoaded: (ad) => print('Ad loaded'), | ||
onAdFailedToLoad: (ad, error) { | ||
ad.dispose(); | ||
print("error to load ad: ${error}"); | ||
}); | ||
|
||
static String? get interstitialAdUnitId { | ||
if(Platform.isAndroid){ | ||
return 'ca-app-pub-7027299532858015/5412652706'; | ||
}else if (Platform.isIOS){ | ||
return 'ca-app-pub-7027299532858015/5412652706'; | ||
if (Platform.isAndroid) { | ||
return 'yourAdsToken'; | ||
} else if (Platform.isIOS) { | ||
return 'yourAdsToken'; | ||
} | ||
return null; | ||
} | ||
|
||
static String? get reardedAdUnitId { | ||
if(Platform.isAndroid){ | ||
return 'ca-app-pub-7027299532858015/6859759457'; | ||
}else if (Platform.isIOS){ | ||
return 'ca-app-pub-7027299532858015/6859759457'; | ||
if (Platform.isAndroid) { | ||
return 'yourAdsToken'; | ||
} else if (Platform.isIOS) { | ||
return 'yourAdsToken'; | ||
} | ||
return null; | ||
} | ||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters