Skip to content

Commit 1a791f4

Browse files
Nicholas Ventimigliacopybara-github
authored andcommitted
Updated age treatment snippets.
PiperOrigin-RevId: 940697284
1 parent 2fdb59c commit 1a791f4

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

packages/com.google.ads.mobile/Samples~/HelloWorld/Assets/Snippets/RequestConfigurationSnippets.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Copyright 2026 Google LLC
2+
13
using UnityEngine;
24
using GoogleMobileAds.Api;
35
using System.Collections.Generic;
@@ -28,5 +30,16 @@ private void SetTestDeviceIds()
2830
MobileAds.SetRequestConfiguration(requestConfiguration);
2931
// [END set_request_configuration]
3032
}
33+
34+
private void SetChildAgeTreatment()
35+
{
36+
// [START set_child_age_treatment]
37+
RequestConfiguration requestConfiguration = new RequestConfiguration
38+
{
39+
AgeRestrictedTreatment = AgeRestrictedTreatment.Child
40+
};
41+
MobileAds.SetRequestConfiguration(requestConfiguration);
42+
// [END set_child_age_treatment]
43+
}
3144
}
3245
}

samples/HelloWorld/Assets/Snippets/RequestConfigurationSnippets.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Copyright 2026 Google LLC
2+
13
using UnityEngine;
24
using GoogleMobileAds.Api;
35
using System.Collections.Generic;
@@ -28,5 +30,16 @@ private void SetTestDeviceIds()
2830
MobileAds.SetRequestConfiguration(requestConfiguration);
2931
// [END set_request_configuration]
3032
}
33+
34+
private void SetChildAgeTreatment()
35+
{
36+
// [START set_child_age_treatment]
37+
RequestConfiguration requestConfiguration = new RequestConfiguration
38+
{
39+
AgeRestrictedTreatment = AgeRestrictedTreatment.Child
40+
};
41+
MobileAds.SetRequestConfiguration(requestConfiguration);
42+
// [END set_child_age_treatment]
43+
}
3144
}
3245
}

0 commit comments

Comments
 (0)