Skip to content

New iOS service admob, with the user consent (UMP) - #736

Open
kabiri wants to merge 1 commit into
castle-engine:masterfrom
kabiri:ios-admob
Open

kabiri wants to merge 1 commit into
castle-engine:masterfrom
kabiri:ios-admob

Conversation

@kabiri

@kabiri kabiri commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

AdMob banner, interstitial and rewarded ads on iOS, and gathering the user consent (GDPR) with Google's User Messaging Platform. The service handles the same messages as the Android admob service, so the CastleAds unit works the same on both platforms:

  • InitializeAdMobWithConsent: the consent is requested first, and the ads SDK is started only once canRequestAds allows it (or right away with InitializeAdMob);
  • ShowConsentPrivacyOptions, ResetConsent, PrivacyOptionsRequired;
  • RewardedReady (ads-admob-reward-ready);
  • a full-screen ad that fails to present reports closing, so OnFullScreenAdClosed is always called;
  • banner placed in the safe area following the same gravity as on Android.

Uses CocoaPods (Google-Mobile-Ads-SDK 12, GoogleUserMessagingPlatform 3), which require iOS 13, set in the service Podfile for this target. The application id goes to Info.plist from the app_id service parameter.

CastleAds: ShowFullScreenAd now sends the request on iOS too (it was Android-only), and the docs mention iOS.

Note: this iOS service was created with the help of AI. The Objective-C code was only reviewed, it was NOT compiled and NOT tested -- I don't have a Mac or an iOS device. Please test before merging.

AdMob banner, interstitial and rewarded ads on iOS, and gathering the user
consent (GDPR) with Google's User Messaging Platform. The service handles
the same messages as the Android admob service, so the CastleAds unit works
the same on both platforms:

- InitializeAdMobWithConsent: the consent is requested first, and the ads
  SDK is started only once canRequestAds allows it (or right away with
  InitializeAdMob);
- ShowConsentPrivacyOptions, ResetConsent, PrivacyOptionsRequired;
- RewardedReady (ads-admob-reward-ready);
- a full-screen ad that fails to present reports closing, so
  OnFullScreenAdClosed is always called;
- banner placed in the safe area following the same gravity as on Android.

Uses CocoaPods (Google-Mobile-Ads-SDK 12, GoogleUserMessagingPlatform 3),
which require iOS 13, set in the service Podfile for this target.
The application id goes to Info.plist from the app_id service parameter.

CastleAds: ShowFullScreenAd now sends the request on iOS too
(it was Android-only), and the docs mention iOS.

Note: this iOS service was created with the help of AI. The Objective-C code
was only reviewed, it was NOT compiled and NOT tested -- I don't have
a Mac or an iOS device. Please test before merging.
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.

1 participant