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

feat: add ads localize #4113

Merged
merged 4 commits into from
Aug 29, 2024
Merged

Conversation

guyhguy25
Copy link
Contributor

Add a localize for Advertisements.

Summary

Added props to change the ima language settings.

Motivation

I have been asked to make the "skip" and "Read more" in different languages.
I tried to ask in Discord if someone knows how to add it, but I didn't see anyone who asked for this feature, although if someone using this library for production he needs it, so I did it.
I created that for my company so it did not waste my time, if you like it you more than welcome to take it.

Changes

add prop: adLanguage
add docs for it.

Java:

add ImaSdkFactory & ImaSdkSettings to the google ads api

Swift:

see pr diff.

Test plan

add adTagUrl and then add adLanguage for example: "fr".
and that's it.

<Video
    adTagUrl="https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpremidpostoptimizedpodbumper&ciu_szs=300x250&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&cmsid=496&vid=short_onecue&correlator="
    adLanguage="fr"
    source={{
        uri: "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
    }}
/>

@freeboub
Copy link
Collaborator

Looks good !
2 open points:

  • can you document the default value ?
  • does it take sense to change language on runtime ? I wonder if this new prop should be moved into the source object ...

@freeboub
Copy link
Collaborator

And please check why the build without ads is ko ! :)

@guyhguy25
Copy link
Contributor Author

Looks good ! 2 open points:

  • can you document the default value ?
  • does it take sense to change language on runtime ? I wonder if this new prop should be moved into the source object ...
  • I can add the default value, but I am not sure I'm correct on this one.
    its seems like ios using the system language, and Android defaults to English.

  • no the language should not change on runtime. (its a possibility, your choice :D)

And please check why the build without ads is ko ! :)
weird, I ain't receiving an error.

I will add the instance to imaSdkFactory, and the function setImaSdkSettings to imaLoader that's probably it.

@KrzysztofMoch KrzysztofMoch changed the title Feature/ads localize feat: add ads localize Aug 23, 2024
@moskalakamil
Copy link
Member

moskalakamil commented Aug 23, 2024

Thanks for PR! I'm just wondering, is it possible to create a 'adConfig' prop with all customization for ads? maybe it's similar logic and then we can pass all of the settings for ads

@freeboub
Copy link
Collaborator

freeboub commented Aug 26, 2024

Thanks for PR! I'm just wondering, is it possible to create a 'adConfig' prop with all customization for ads? maybe it's similar logic and then we can pass all of the settings for ads

I agree, but we should not block this PR For that point.

@freeboub
Copy link
Collaborator

  • no the language should not change on runtime. (its a possibility, your choice :D)

From IMA doc:
Once the AdsLoader object has been created, using this setter will have no effect.
I have my answer, thank you !

@freeboub
Copy link
Collaborator

I just put one proposal for doc, I let you approve and integrate it.
This is good to me !

@guyhguy25
Copy link
Contributor Author

Thanks for PR! I'm just wondering, is it possible to create a 'adConfig' prop with all customization for ads? maybe it's similar logic and then we can pass all of the settings for ads

I agree, but we should not block this PR For that point.

Hey, I don't mind doing this prop, and move this prop there.
I can open a new PR for it

I already implement that on ios. i need to work on android and I will open pr for it :D

Language correction

Co-authored-by: Olivier Bouillet <62574056+freeboub@users.noreply.github.com>
@freeboub
Copy link
Collaborator

@guyhguy25 up to you, I will wait for @KrzysztofMoch next week to merge it

Copy link
Member

@KrzysztofMoch KrzysztofMoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is Okay to merge for me

@freeboub
Copy link
Collaborator

OK, let's merge as is. Don't hesitate to reopen another PR for refactor ! @guyhguy25

@freeboub freeboub merged commit 703ed43 into TheWidlarzGroup:master Aug 29, 2024
12 checks passed
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

Successfully merging this pull request may close these issues.

4 participants