Created
July 7, 2020 10:20
-
-
Save Anirudhk07/869aa3fe4f7b60fee62dcc3cd341c3ab to your computer and use it in GitHub Desktop.
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
import 'dart:io'; | |
class AdManager { | |
static String get appId { | |
if (Platform.isAndroid) { | |
return "<YOUR_ANDROID_ADMOB_APP_ID>"; | |
} else if (Platform.isIOS) { | |
return "<YOUR_IOS_ADMOB_APP_ID>"; | |
} else { | |
throw new UnsupportedError("Unsupported platform"); | |
} | |
} | |
static String get bannerAdUnitId { | |
if (Platform.isAndroid) { | |
return "<YOUR_ANDROID_BANNER_AD_UNIT_ID"; | |
} else if (Platform.isIOS) { | |
return "<YOUR_IOS_BANNER_AD_UNIT_ID>"; | |
} else { | |
throw new UnsupportedError("Unsupported platform"); | |
} | |
} | |
static String get interstitialAdUnitId { | |
if (Platform.isAndroid) { | |
return "<YOUR_ANDROID_INTERSTITIAL_AD_UNIT_ID>"; | |
} else if (Platform.isIOS) { | |
return "<YOUR_IOS_INTERSTITIAL_AD_UNIT_ID>"; | |
} else { | |
throw new UnsupportedError("Unsupported platform"); | |
} | |
} | |
static String get rewardedAdUnitId { | |
if (Platform.isAndroid) { | |
return "<YOUR_ANDROID_REWARDED_AD_UNIT_ID>"; | |
} else if (Platform.isIOS) { | |
return "<YOUR_IOS_REWARDED_AD_UNIT_ID>"; | |
} else { | |
throw new UnsupportedError("Unsupported platform"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment