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

Support Native #4759

Merged
merged 32 commits into from
Jan 23, 2020
Merged

Support Native #4759

merged 32 commits into from
Jan 23, 2020

Conversation

bjorn-lw
Copy link
Contributor

Type of change

  • [x ] Feature

Description of change

Support native ads + get banner size from mediaTypes.banner

Make it possible to pass dynamic parameters to adapter
Pass metadata from adapter
@bjorn-lw
Copy link
Contributor Author

Don't think the ci/circleci issue is related to this PR?

options: bid.params.options
};

if (bid.mediaTypes && bid.mediaTypes.banner && bid.mediaTypes.native) {
adRequest.banner = true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why does setting this matter if native is in the mediaTypes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's related to how it works in the backend. It only needs setting if both banner and native is enabled, otherwise (if not native) banner is implied.

Btw. thanks for all the input, I will fix those things for the next PR.

adRequest.banner = true;
}

if (bid.mediaTypes && bid.mediaTypes.native) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I have a personal connection with using the deepAccess util for these kinds of checks.

if(deepAccess(bid, 'mediaTypes.native')

But definitely not necessary, just like to point it out so people are aware of it!

}

function getSizes(bid) {
if (typeof utils.deepAccess(bid, 'mediaTypes.banner.sizes') !== 'undefined') {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see you already are using deepAccess! nice :)

Can probably be changed to leave off the typeof {} !== 'undefined' maybe?

Since if it was not defined it will just return undefined which is falsely.

No big deal though.

@robertrmartinez robertrmartinez merged commit 091db5f into prebid:master Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants