Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

[Feature request] Able to customize border around native ads (color, radius) #880

Open

Description

@naamapps

Plugin Version

3.0.0

Steps to Reproduce

Just run a native ad on ios and see that it renders with a border around it.

Expected results:
The ad renders without borders.

Actual results:
The ad renders with borders.
See image:

flutter_06 copy

Activity

  1. added
    feature request
    on Jul 6, 2023
  2. added
    in triage
    on Jul 6, 2023
  3. malandr2 commented on Jul 6, 2023

    @malandr2
    Collaborator

    Hi @naamapps,

    The borders you are noticing are working as intended. I have labeled this case as a feature request and escalated to the greater team.

  4. naamapps commented on Jul 6, 2023

    @naamapps
    Author

    Hey @malandr2,
    Thanks for your quick comment.
    Please explain why is this the intended behavior, it seems like a bug to me.
    The borders are really distracting from the main content of the app.

    Also why did you close the issue if it is not resolved?
    Shouldn't it be open until it's resolved?

  5. malandr2 commented on Jul 7, 2023

    @malandr2
    Collaborator

    Hey @naamapps, ticket is re-opened. Will be closed once resolved by engineering.

    The border is part of the UI and it is black by default. @jjliu15 feature request would be to allow customization of the border color.

  6. naamapps commented on Jul 7, 2023

    @naamapps
    Author

    Got it.
    Looking forward to this new feature to control the border color.
    Also if it's possible, maybe add an option to control the border radius? Just suggesting a few customizations.
    Thanks

  7. huycozy commented on Jul 12, 2023

    @huycozy
    Collaborator

    I also see this issue on Android as well. Updating labels corresponding to this. Verified on plugin versions: google_mobile_ads: ^3.0.0

    Demo Android
    Flutter plugin - Android Android native example
  8. added
    native ad
    e2-days
    and removed
    in triage
    on Jul 12, 2023
  9. changed the title [-]iOS: Black borders around native ads[/-] [+][Feature request] Able to customize border around native ads (color, radius)[/+] on Jul 12, 2023
  10. 6 remaining items

  11. added a commit that references this issue on Oct 11, 2023
    1fc28c4
  12. malandr2 commented on Oct 12, 2023

    @malandr2
    Collaborator

    @bcyran, ACK. Thanks for your feedback.

  13. jhlee-danbi commented on Nov 21, 2023

    @jhlee-danbi

    @malandr2
    When will it be updated?
    I am still waiting for the custom design features.

  14. fernandorascon commented on May 4, 2024

    @fernandorascon

    Bump! Native ads have more potential for revenue growth than any other ad type, but it all depends on their ability to mesh well with the whole app's style. Introducing basic customization features shouldn't detract too much from other issues :(

  15. joshuamoreno1 commented on May 19, 2024

    @joshuamoreno1

    Hi there!,

    Some news about it?

    Thanks,

  16. added a commit that references this issue on Jun 7, 2024
    d6e31f6
  17. DanielMartini commented on Aug 11, 2024

    @DanielMartini

    Hi,

    Any new about this? It doesn't make sense to use this kind of ad if it's not fully customizable with the UI

    Thanks

  18. lancelotF commented on Aug 19, 2024

    @lancelotF

    I managed to set the borders transparent by adding these two lines in my
    android/app/src/main/res/values/styles.xml:

    image

  19. ajith-ab commented on Oct 6, 2024

    @ajith-ab

    For IOS Comment following line

    ios/Classes/NativeTemplates/GoogleAdsMobileIosNativeTemplates/GADTTemplateView.m inside the package file

    This helps me change the border and color.

    - (void)applyStyles {
      // self.layer.borderColor =
      //     [GADTTemplateView colorFromHexString:@"E0E0E0"].CGColor;
      // self.layer.borderWidth = 1.0f;
      [self.mediaView sizeToFit];
      if ([self styleForKey:GADTNativeTemplateStyleKeyCornerRadius]) {
        float roundedCornerRadius =
            ((NSNumber *)[self styleForKey:GADTNativeTemplateStyleKeyCornerRadius])
                .floatValue;
    
        // Rounded corners
        self.iconView.layer.cornerRadius = roundedCornerRadius;
        self.iconView.clipsToBounds = YES;
        ((UIButton *)self.callToActionView).layer.cornerRadius =
            roundedCornerRadius;
        ((UIButton *)self.callToActionView).clipsToBounds = YES;
      }
    ...
    
    }

    happy coding!

  20. KiddoV commented on Apr 28, 2025

    @KiddoV

    Related to my issue #1309
    Any updates on this?
    Coming from Expo (React Native), I was surprised that why this third party https://github.com/invertase/react-native-google-mobile-ads lib doing better than a package from Google team? We can really customize anything using this package.
    I hope we have something similar in Flutter side as well.

  21. alihassan143 commented on Apr 29, 2025

    @alihassan143

    For IOS Comment following line

    ios/Classes/NativeTemplates/GoogleAdsMobileIosNativeTemplates/GADTTemplateView.m inside the package file

    This helps me change the border and color.

    • (void)applyStyles {
      // self.layer.borderColor =
      // [GADTTemplateView colorFromHexString:@"E0E0E0"].CGColor;
      // self.layer.borderWidth = 1.0f;
      [self.mediaView sizeToFit];
      if ([self styleForKey:GADTNativeTemplateStyleKeyCornerRadius]) {
      float roundedCornerRadius =
      ((NSNumber *)[self styleForKey:GADTNativeTemplateStyleKeyCornerRadius])
      .floatValue;

      // Rounded corners
      self.iconView.layer.cornerRadius = roundedCornerRadius;
      self.iconView.clipsToBounds = YES;
      ((UIButton *)self.callToActionView).layer.cornerRadius =
      roundedCornerRadius;
      ((UIButton *)self.callToActionView).clipsToBounds = YES;
      }
      ...

    }
    happy coding!

    best workaround is to create custom template for android and ios and you can custom as many things you want

  22. added a commit that references this issue on Aug 2, 2025
    dbf0664
  23. thilojaeggi commented on Apr 29, 2026

    @thilojaeggi

    How is this still not fixed??

  24. thilojaeggi commented on Apr 29, 2026

    @thilojaeggi

    @malandr2 any update? This absolutely ruins the native look and feel and is definitely not intentional given native ads in the normal iOS/Android implementations do not have this border.

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

e2-daysfeature requestnative ad

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions