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