react-native-admob-native-ads icon indicating copy to clipboard operation
react-native-admob-native-ads copied to clipboard

Custom targeting

Open JoaquinManeroJazusoft opened this issue 1 year ago • 1 comments

could it be that custom targeting doesn't work? I need to know if it is my problem or the library currently does not work with custom targeting with google ad manager

JoaquinManeroJazusoft avatar Nov 05 '24 21:11 JoaquinManeroJazusoft

After reviewing the native code, I could see that the targetOptions in android worked correctly, but not in iOS. This is because in the native iOS code the order was wrong, so what works for me is the following solution.

if ([allKeys containsObject:@"targets"]) {
        NSArray *array = [targetingOptions objectForKey:@"targets"];
        NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
        for (NSDictionary *object in array) {
            [dic setValue:[object valueForKey:@"value"] forKey:[object valueForKey:@"key"]];
        }
        [adRequest setCustomTargeting:dic];
    }

JoaquinManeroJazusoft avatar Nov 15 '24 13:11 JoaquinManeroJazusoft

this library has been diprecated. and has no support

zoobibackups avatar Aug 29 '25 11:08 zoobibackups