File tree Expand file tree Collapse file tree
Objective-C/advanced/APIDemo/APIDemo/Snippets
Swift/advanced/APIDemo/APIDemo/Snippets Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,4 +37,28 @@ - (void)disablePublisherFirstPartyID {
3737 // [END disable_publisher_first_party_id]
3838}
3939
40+ - (void )setChildAgeTreatment {
41+ // [START set_child_age_treatment]
42+ // Indicates that ad requests should have child age treatment.
43+ GADMobileAds.sharedInstance .requestConfiguration .ageRestrictedTreatment =
44+ GADAgeRestrictedTreatmentChild;
45+ // [END set_child_age_treatment]
46+ }
47+
48+ - (void )setTeenAgeTreatment {
49+ // [START set_teen_age_treatment]
50+ // Indicates that ad requests should have teen age treatment.
51+ GADMobileAds.sharedInstance .requestConfiguration .ageRestrictedTreatment =
52+ GADAgeRestrictedTreatmentTeen;
53+ // [END set_teen_age_treatment]
54+ }
55+
56+ - (void )setUnspecifiedAgeTreatment {
57+ // [START set_unspecified_age_treatment]
58+ // Indicates that ad requests should have unspecified age treatment.
59+ GADMobileAds.sharedInstance .requestConfiguration .ageRestrictedTreatment =
60+ GADAgeRestrictedTreatmentUnspecified;
61+ // [END set_unspecified_age_treatment]
62+ }
63+
4064@end
Original file line number Diff line number Diff line change @@ -31,4 +31,25 @@ private class RequestConfigurationSnippets {
3131 MobileAds . shared. requestConfiguration. setPublisherFirstPartyIDEnabled ( false )
3232 // [END disable_publisher_first_party_id]
3333 }
34+
35+ private func setChildAgeTreatment( ) {
36+ // [START set_child_age_treatment]
37+ // Indicates that ad requests should have child age treatment.
38+ MobileAds . shared. requestConfiguration. ageRestrictedTreatment = . child
39+ // [END set_child_age_treatment]
40+ }
41+
42+ private func setTeenAgeTreatment( ) {
43+ // [START set_teen_age_treatment]
44+ // Indicates that ad requests should have teen age treatment.
45+ MobileAds . shared. requestConfiguration. ageRestrictedTreatment = . teen
46+ // [END set_teen_age_treatment]
47+ }
48+
49+ private func setUnspecifiedAgeTreatment( ) {
50+ // [START set_unspecified_age_treatment]
51+ // Indicates that ad requests should have unspecified age treatment.
52+ MobileAds . shared. requestConfiguration. ageRestrictedTreatment = . unspecified
53+ // [END set_unspecified_age_treatment]
54+ }
3455}
You can’t perform that action at this time.
0 commit comments