- GoogleMobileAds.xcframework (from Firebase.zip/Google-Mobile-Ads-SDK/GoogleMobileAds.xcframework)
- UserMessagingPlatform.xcframework (from Firebase.zip/Google-Mobile-Ads-SDK/UserMessagingPlatform.xcframework)
- GoogleAppMeasurement.xcframework (from FirebaseAnalytics/GoogleAppMeasurement.xcframework)
- GoogleUtilities.xcframework (from Firebase.zip/FirebaseAnalytics/GoogleUtilities.xcframework)
- FBLPromises.xcframework (from Firebase.zip/FirebaseAnalytics/FBLPromises.xcframework)
- nanopb.xcframework (from Firebase.zip/FirebaseAnalytics/nanopb.xcframework)
<config>
...
<frameworkPaths>
<path>libs</path> <!-- path where GoogleMobileAds.framework is located -->
</frameworkPaths>
</config>
Add the following dependency to your build.gradle
:
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
dependencies {
... other dependencies ...
implementation "io.github.dkimitsa.robovm:robopods-firebase-google-mobile-ads-ios:$altpodsVersion"
}
UIApplicationDelegateAdapter:
@Override
public boolean didFinishLaunching(UIApplication application, UIApplicationLaunchOptions launchOptions) {
GADMobileAds.sharedInstance().start(status -> {
GADMobileAds.sharedInstance().getRequestConfiguration().setTestDeviceIdentifiers(new NSArray<>(GADRequest.GADSimulatorID()));
});
GADRewardBasedVideoAd.sharedInstance().setDelegate(new GADRewardBasedVideoAdDelegateAdapter() {
@Override
public void didReceiveAd(GADRewardBasedVideoAd rewardBasedVideoAd) {
if (GADRewardBasedVideoAd.sharedInstance().isReady())
GADRewardBasedVideoAd.sharedInstance().presentFromRootViewController(MyViewController.this);
}
});
// ... other code
}
Any other place to use GAD:
GADRewardBasedVideoAd.sharedInstance().loadRequest(new GADRequest(), "ca-app-pub-3940256099942544/1712485313" );