diff --git a/PoingGodotAdMob/src/ads/PoingGodotAdMob.mm b/PoingGodotAdMob/src/ads/PoingGodotAdMob.mm index e69d078..086c796 100644 --- a/PoingGodotAdMob/src/ads/PoingGodotAdMob.mm +++ b/PoingGodotAdMob/src/ads/PoingGodotAdMob.mm @@ -55,16 +55,23 @@ GADRequestConfiguration *requestConfiguration = [GADMobileAds sharedInstance].requestConfiguration; - requestConfiguration.maxAdContentRating = [NSString stringWithUTF8String:maxAdContentRating.utf8().get_data()]; - requestConfiguration.tagForChildDirectedTreatment = [NSNumber numberWithInt:tagForChildDirectedTreatment]; + if (!maxAdContentRating.is_empty()) + requestConfiguration.maxAdContentRating = [NSString stringWithUTF8String:maxAdContentRating.utf8().get_data()]; + + if (tagForChildDirectedTreatment >= 0) + requestConfiguration.tagForChildDirectedTreatment = [NSNumber numberWithInt:tagForChildDirectedTreatment]; - requestConfiguration.tagForUnderAgeOfConsent = [NSNumber numberWithInt:tagForUnderAgeOfConsent]; + if (tagForUnderAgeOfConsent >= 0) + requestConfiguration.tagForUnderAgeOfConsent = [NSNumber numberWithInt:tagForUnderAgeOfConsent]; NSMutableArray *testDeviceIdsArray = [NSMutableArray arrayWithCapacity:testDeviceIds.size()]; for (String deviceId : testDeviceIds) { [testDeviceIdsArray addObject:[NSString stringWithUTF8String:deviceId.utf8().get_data()]]; } requestConfiguration.testDeviceIdentifiers = testDeviceIdsArray; + NSLog(@"AdMob requestConfiguration: maxAdContentRating=%@, tagForChildDirectedTreatment=%@, tagForUnderAgeOfConsent=%@", + requestConfiguration.maxAdContentRating, requestConfiguration.tagForChildDirectedTreatment, requestConfiguration.tagForUnderAgeOfConsent + ); } Dictionary PoingGodotAdMob::get_initialization_status() {