Can't Update Google AdMob in iOS Project
The latest version at the time of your question should be 7.9.1.
Did you try update(verbose)?. I recommend you download the cocoaPods applications, makes managing your pods much easier.
https://cocoapods.org/app
Once installed and you open a pod file, you will have 3 options at the top right (install, install verbose and update verbose). I would try them and see if it pushes to the latest update.
If that doesn't work, maybe try uninstalling the SDK from cocoa pods. Restart your xCode project and try installing the pod again.
If that also doesn't work that I would try installing the AdMob SDK directly via
pod 'Google-Mobile-Ads-SDK'.
I am not sure what the difference is between the regular one and the firebase one, maybe the firebase one slightly different.
Note: As member Eric Lichtenschlag has so kindly pointed out
AdMob sometimes does releases outside of the Firebase release cycle, and updates the Google-Mobile-Ads-SDK pod. However, when Firebase releases, their Firebase/AdMob pod depends on a specific version of Google-Mobile-Ads-SDK so that it's stable and your Firebase experience doesn't change in between Firebase releases. Currently, the latest Firebase release is pointing to Google-Mobile-Ads-SDK 7.8.1. On the next Firebase update, it will point to the latest version of AdMob, which is currently 7.9.1.
Hope this helps.
Firebase admob not taking latest google ad mob SDK from pod or server
Since last night I was struggling with this issue and at last, I found a solution. Though answering my own question to help others who have the same problem.
As CocoaPod
has also cache into our system that's why it's creating problems and not getting the latest library from the CocoaPod
server.
So I made the below step to achieve the latest Google mobile ads SDK 7.16.
Step1: Clear all CocoaPod cache by the below commands.
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
Step2: Setup pod again to get all repo from master POD.
pod setup
Step3: Get Updated Library from POD.
pod update
and finally got below latest library from POD:
Analyzing dependencies
Pre-downloading: `youtube-ios-player-helper` from `https://github.com/youtube/youtube-ios-player-helper`, commit `head`
Removing GoogleUtilities
Downloading dependencies
Using AFNetworking (3.1.0)
Installing Firebase 3.11.1 (was 3.2.0)
Installing FirebaseAnalytics 3.6.0 (was 3.2.0)
Installing FirebaseCore (3.4.7)
Installing FirebaseInstanceID 1.0.8 (was 1.0.6)
Installing Google-Mobile-Ads-SDK 7.16.0 (was 7.8.1)
Installing GoogleInterchangeUtilities 1.2.2 (was 1.2.1)
Installing GoogleSymbolUtilities 1.1.2 (was 1.1.1)
Installing GoogleToolboxForMac (2.1.1)
Installing MBProgressHUD 1.0.0 (was 0.9.2)
Installing SDWebImage 3.8.2 (was 3.7.6)
Installing youtube-ios-player-helper 0.1.6 (was 0.1.6)
Generating Pods project
Integrating client project
so now I got the latest version of SDK in my app:
**Installing Google-Mobile-Ads-SDK 7.16.0 (was 7.8.1)**
Hope this will helps to resolve the CocoaPod
issue to not get the latest library or SDK from Server.
Thanks!
How to upgrade Google Mobile Ads SDK in Xcode when I get this msg: Google:HTML You are currently using version 7.6.0 of the SDK?
It depends on how you have imported the GoogleSDK
in your project.
1) If you have used the .pod
file then you just need to update the pods.
2) If you have imported manually, then just replace the current SDK folder with a new downloaded one.
That's it!
Google AdMob Podfile - Manual vs Auto Version Update?
I am fairly new to CocoaPods myself so I am not 100% what you mean with
"I guess while my app is not 'live', my Podfile is essentially inactive in terms of updating itself automatically."
I believe to update your Pods you need to run the Update command, it does not update itself automatically.
If I were to upload my project today to the App Store with my Podfile updated to the most current Google AdMob SDK version, will it automatically update my project to the most current version thereafter?
I believe no, you need to run podUpdate.
Are the three (3) lines of code in my Podfile sufficient?
Should be
This is how my pod files looks
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'MyGame (iOS)' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'Google-Mobile-Ads-SDK', '~> 7.0'
pod 'ChartboostSDK'
# Pods for MyGame (iOS)
target 'MyGame (iOS) Tests' do
inherit! :search_paths
# Pods for testing
end
end
CocoaPods actually released an app for OSX recently, which makes using it a lot easier
https://cocoapods.org/app
To read more update pod updates vs installs you should read this.
https://guides.cocoapods.org/using/pod-install-vs-update.html
Or a great swift tutorial from ray wenderlich
https://www.raywenderlich.com/97014/use-cocoapods-with-swift
Hope this helps
Google AdMob new SDK setup for iOS : SKAdNetworkItems, NSUserTrackingUsageDescription, ATTrackingManager. Guideline 5.1.2 - Legal - Privacy - Data Use
Updates: Game approved by Apple. Here is game with latest admob ads (GADInterstitialAd, GADRewardedInterstitialAd, GADRewardedAd, GADAppOpenAd):
https://apps.apple.com/us/app/ocean-fishing-master-3d-games/id1550945081
Added Google Admob SKAdNetworkIdentifier values in Info.plist
<key>SKAdNetworkItems</key>
<array>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>cstr6suwn9.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>4fzdc2evr5.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>2fnua5tdw4.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>ydx93a7ass.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>5a6flpkh64.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>p78axxw29g.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>v72qych5uu.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>c6k4g5qg8m.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>s39g8k73mm.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>3qy4746246.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>3sh42y64q3.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>f38h382jlk.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>hs6bdukanm.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>prcb7njmu6.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>wzmmz9fp6w.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>yclnxrl5pm.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>4468km3ulz.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>t38b2kh725.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>7ug5zh24hu.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>9rd848q2bz.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>n6fk4nfna4.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>kbd757ywx3.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>9t245vhmpl.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>2u9pt9hc89.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>8s468mfl3y.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>av6w8kgt66.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>klf5c3l5u5.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>ppxm28t8ap.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>424m5254lk.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>uw77j35x4d.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>e5fvkxwrpn.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>zq492l623r.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>3qcr597p9d.skadnetwork</string>
</dict>
</array>
Added requestIDFA in didFinishLaunchingWithOptions. It opens App Tracking Transparency dialog box.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[GADMobileAds sharedInstance] startWithCompletionHandler:nil];
[self requestIDFA];
.
.
.
}
requestIDFA function:
- (void)requestIDFA
{
if (@available(iOS 14.0, *))
{
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
// Admob Ads
[self requestAppOpenAd];
[self loadAdmob_Ads];
[self loadRewardedInterstitial];
}];
}
else
{
// Admob Ads
[self requestAppOpenAd];
[self loadAdmob_Ads];
[self loadRewardedInterstitial];
}
}
Added AppTrackingTransparency.framework to Xcode.
In info.plist added NSUserTrackingUsageDescription
<key>NSUserTrackingUsageDescription</key>
<string>This identifier will be used to deliver personalized ads to you.</string>
Admob ads related functions:
- (void)requestAppOpenAd {
self.appOpenAd = nil;
[GADAppOpenAd loadWithAdUnitID:ADMOB_APP_OPEN_ID
request:[GADRequest request]
orientation:UIInterfaceOrientationPortrait
completionHandler:^(GADAppOpenAd *_Nullable appOpenAd, NSError *_Nullable error) {
if (error) {
NSLog(@"Failed to load app open ad: %@", error);
return;
}
self.appOpenAd = appOpenAd;
self.appOpenAd.fullScreenContentDelegate = self;
}];
}
- (void)tryToPresentAd
{
if (self.appOpenAd) {
UIViewController *rootController = self.window.rootViewController;
[self.appOpenAd presentFromRootViewController:rootController];
} else {
// If you don't have an ad ready, request one.
[self requestAppOpenAd];
}
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
[self tryToPresentAd];
}
-(void)loadAdmob_Ads
{
GADRequest *request = [GADRequest request];
[GADInterstitialAd loadWithAdUnitID:ADMOB_FULL_SCREEM
request:request
completionHandler:^(GADInterstitialAd *ad, NSError *error)
{
if (error)
{
NSLog(@"\nAdmob Failed to load interstitial ad with error: %@", [error localizedDescription]);
return;
}
self.interstitial = ad;
self.interstitial.fullScreenContentDelegate = self;
}];
}
-(void)showAdmobAdsFullScreen
{
if (self.interstitial) {
[self.interstitial presentFromRootViewController:self.viewController];
}
}
-(void)loadRewardedInterstitial
{
[GADRewardedInterstitialAd
loadWithAdUnitID:ADMOB_REWARDED_INTERSTITIAL
request:[GADRequest request]
completionHandler:^(
GADRewardedInterstitialAd *_Nullable rewardedInterstitialAd,
NSError *_Nullable error) {
if (!error) {
self.rewardedInterstitialAd = rewardedInterstitialAd;
self.rewardedInterstitialAd.fullScreenContentDelegate = self;
}
}];
}
-(void)playRewardedInterstitial
{
[self.rewardedInterstitialAd presentFromRootViewController:self.viewController
userDidEarnRewardHandler:^{
[self rewardInterstitialDoneRewardUser];
[self loadRewardedInterstitial];
}];
}
Google Official Documentation:
SKAdNetworkItems iOS 14 Updates : https://developers.google.com/admob/ios/ios14
GADInterstitialAd : https://developers.google.com/admob/ios/interstitial
GADRewardedInterstitialAd : https://developers.google.com/admob/ios/rewarded-interstitial
GADRewardedAd : https://developers.google.com/admob/ios/rewarded-ads
GADAppOpenAd : https://developers.google.com/admob/ios/app-open-ads
Adaptive Banner ( GADBannerView ) : https://developers.google.com/admob/ios/banner/adaptive
NSAppTransportSecurity : https://developers.google.com/admob/ios/app-transport-security
Related Topics
Dynamic Cell Height with Sdwebimage
Cocoapods Page Redirecting to Github
Strange Custom Background Color on Uipickerview Swift
Can't Build an App for Distribution After Joining Existing Enterprise Developer Program
Uiactivityviewcontroller => Launchservices: Invalidationhandler Called
How to Get Path to a Subfolder in Main Bundle
How to Make One Side of a Div Pointy with CSS
Multiple Lines in UItabbaritem Label
iOS Google Maps Sdk Gmsmarker Positioning
Play Keyboard Click Sound in a Collection View Controller
How to Install Self-Signed Certificates in iOS 11
Submit Watchkit Provisioning Error
Add Udid in Current Provisioning Profile
Filter Array of Custom Objects in Swift
Sprite Frame Animation Cocos2D 3.0
Keep a UIview or UIviewcontroller on Top of All Others
How to Print Out(Nslog) The Properties of a Custom Object Added to a Nsmutablearray