⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

WIP Fix MediaContent-related API not being generated#1356

Open
marius-bughiu wants to merge 1 commit intodotnet:mainfrom
marius-bughiu:fix/mediacontent-api
Open

WIP Fix MediaContent-related API not being generated#1356
marius-bughiu wants to merge 1 commit intodotnet:mainfrom
marius-bughiu:fix/mediacontent-api

Conversation

@marius-bughiu
Copy link

WIP (do not merge)
This is mostly generated with Claude and I need to test it first.
Fixes: #973
Needed for: marius-bughiu/Plugin.AdMob#78

Problem

The IMediaContent interface was not being generated because it contained obfuscated methods (zza(), zzb()) that referenced internal types (com.google.android.gms.internal.ads.zzbfs). This caused the binding generator to skip the entire interface.

As a result, the MediaContent property on NativeAd, MediaView, and related classes was unavailable to .NET developers.

Solution

Added <remove-node> rules to the Metadata.xml transform files to exclude the problematic obfuscated methods from the MediaContent interface:

<remove-node path="/api/package[@name='com.google.android.gms.ads']/interface[@name='MediaContent']/method[@name='zza']" />
<remove-node path="/api/package[@name='com.google.android.gms.ads']/interface[@name='MediaContent']/method[@name='zzb']" />

New API Surface

Android.Gms.Ads.IMediaContent interface with:

  • AspectRatio
  • CurrentTime
  • Duration
  • HasVideoContent
  • MainImage
  • VideoController

MediaContent property now available on:

  • NativeAd
  • MediaView
  • INativeCustomFormatAd

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.

NativeCustomFormatAd and related types missing from Ads/Ads.Lite

1 participant