We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1207f64 commit 2c926f4Copy full SHA for 2c926f4
1 file changed
src/lib/startAd.js
@@ -27,6 +27,16 @@ export default async function startAd() {
27
28
await admob.start();
29
30
+ const currentHour = new Date().getHours();
31
+ //currentHour >= 22: Covers 10:00 PM to 11:59 PM.
32
+ //currentHour < 4: Covers 12:00 AM to 3:59 AM.
33
+ const isQuietHours = currentHour >= 22 || currentHour < 4;
34
+
35
+ await admob.configure({
36
+ appMuted: isQuietHours,
37
+ appVolume: isQuietHours ? 0.0 : 1.0,
38
+ });
39
40
const banner = new admob.BannerAd({
41
adUnitId: adUnitIdBanner,
42
position: "bottom",
0 commit comments