Skip to content

feat: add neighboringContentUrls request option - #875

Merged
mikehardy merged 4 commits into
invertase:mainfrom
philipheinser:feat/neighboring-content-urls
Aug 18, 2026
Merged

feat: add neighboringContentUrls request option#875
mikehardy merged 4 commits into
invertase:mainfrom
philipheinser:feat/neighboring-content-urls

Conversation

@philipheinser

Copy link
Copy Markdown
Contributor

Description

Google Mobile Ads supports neighboring content URLs for brand safety on both platforms (GADRequest.neighboringContentURLStrings on iOS, AdRequest.Builder.setNeighboringContentUrls on Android). This library already exposes contentUrl, but not the neighboring URLs used when an ad sits next to other web content (for example articles in a feed).

This adds neighboringContentUrls to RequestOptions:

await Interstitial.createForAdRequest(adUnitId, {
  contentUrl: 'https://www.example.com/article-a',
  neighboringContentUrls: [
    'https://www.example.com/article-b',
    'https://www.example.com/article-c',
  ],
});

Validation matches contentUrl: HTTP(S) only, max 512 characters per URL, and a maximum of 4 URLs as documented by Google.

Related issues

None.

Release Summary

feat: add neighboringContentUrls request option for brand-safety targeting

Checklist

  • I read the Contributor Guide
    and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
  • My change includes tests;
    • e2e tests added or updated in __tests__e2e__
    • jest tests added or updated in __tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan

  • Jest coverage in __tests__/requestOptions.test.tsx for type, URL, length, and max-count validation.
  • Native mapping verified against GMA iOS 13.5 (neighboringContentURLStrings) and Android setNeighboringContentUrls.

🔥

@codecov

codecov Bot commented Aug 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 40.88%. Comparing base (a34c7ba) to head (543edab).
⚠️ Report is 247 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #875      +/-   ##
==========================================
- Coverage   43.72%   40.88%   -2.83%     
==========================================
  Files          30       36       +6     
  Lines         549      685     +136     
  Branches      151      175      +24     
==========================================
+ Hits          240      280      +40     
- Misses        309      405      +96     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@CLAassistant

CLAassistant commented Aug 16, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@philipheinser
philipheinser force-pushed the feat/neighboring-content-urls branch from 535c376 to 3922173 Compare August 17, 2026 08:25
philipheinser and others added 4 commits August 17, 2026 18:24
Expose Google Mobile Ads brand-safety neighboring content URLs on
RequestOptions for iOS and Android.
setNeighboringContentUrls expects a List, not a HashSet.
Mirror contentUrl e2e/jest coverage for URL length and add e2e tests
for the neighboringContentUrls request option.
@mikehardy
mikehardy force-pushed the feat/neighboring-content-urls branch from 3922173 to 543edab Compare August 18, 2026 01:38

@mikehardy mikehardy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this is great thanks! I added some docs and tests while in there reviewing but the code was good to go as submitted

@mikehardy
mikehardy merged commit b2ef7b3 into invertase:main Aug 18, 2026
8 of 10 checks passed
@mikehardy

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 16.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants