Google Mobile Ads SDK iOS Bindings
- marius-bughiu - Plugin.AdMob - AdMob plugin for .NET MAUI
- jcsawyer - Jc.AdMob.Avalonia - AdMob plugin for Avalonia mobile projects
Each major version contains breaking changes according to the Google AdMob SDK. Please refer to the Google AdMob SDK for more information. The headline changes relevant will be listed here.
AdSizeCons
constants were changed to be hardcoded while I try to find a better approach to access the true values.
This means that values will be the same for both iPhone and iPad.
SmartBannerPortrait
, SmartBannerLandscape
, and Fluid
have been removed until a workaround is discovered as these are entirely dependent on the framework or the calling framework (MAUI/Avalonia/etc.)
- The minimum supported version of iOS is now 13.
- Note: SDK 11.0.0 still builds on iOS 12 devices, but ads will not serve.
- armv7 support has been removed from the SDK
More info can be found here
To use Jc.GoogleMobileAds.iOS, you can add the required packages to your project:
dotnet add package Jc.GMA.iOS
dotnet add package Jc.UMP.iOS
To use the latest v11.13.0
, you must add this target to your csproj file to support linking with Swift system libraries
<Target Name="LinkWithSwift" DependsOnTargets="_ParseBundlerArguments;_DetectSdkLocations" BeforeTargets="_LinkNativeExecutable">
<PropertyGroup>
<_SwiftPlatform Condition="$(RuntimeIdentifier.StartsWith('iossimulator-'))">iphonesimulator</_SwiftPlatform>
<_SwiftPlatform Condition="$(RuntimeIdentifier.StartsWith('ios-'))">iphoneos</_SwiftPlatform>
</PropertyGroup>
<ItemGroup>
<_CustomLinkFlags Include="-L" />
<_CustomLinkFlags Include="/usr/lib/swift" />
<_CustomLinkFlags Include="-L" />
<_CustomLinkFlags Include="$(_SdkDevPath)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/$(_SwiftPlatform)" />
<_CustomLinkFlags Include="-Wl,-rpath" />
<_CustomLinkFlags Include="-Wl,/usr/lib/swift" />
</ItemGroup>
</Target>