Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom targeting #392

Open
JoaquinManeroJazusoft opened this issue Nov 5, 2024 · 1 comment
Open

Custom targeting #392

JoaquinManeroJazusoft opened this issue Nov 5, 2024 · 1 comment

Comments

@JoaquinManeroJazusoft
Copy link

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
Copy link
Author

JoaquinManeroJazusoft commented Nov 15, 2024

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];
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant