Dhaval Kakadiya
Dhaval Kakadiya

Reputation: 113

How to check Current SDK version of Google AdMob iOS?

Google has Changed some Policy under which the ads displayed under SDK version 7.0 will not display ads any more, Actually i don't know which version SDK i m using.

Please help me to get out of this.

Upvotes: 10

Views: 3258

Answers (6)

Young Lee
Young Lee

Reputation: 51

Code for the latest version of the Mobile Ads SDK (iOS) as of 26 February 2025 (v 12.1.0) :

print("Admob version:" + string(for: MobileAds.shared.versionNumber))

Upvotes: 0

Hiromu Izuwa
Hiromu Izuwa

Reputation: 16

Get the SDK version:

let version = GADMobileAds.sharedInstance().versionNumber

Convert version number to string and log the output:

let versionString = "Google Mobile Ads SDK Version: \(version.majorVersion).\(version.minorVersion).\(version.patchVersion)"
print(versionString)

Upvotes: 0

Torongo
Torongo

Reputation: 1091

Starting from Google Mobile Ads SDK version 11.0.0 sdkVersion has been removed from GADMobileAds. Changes to logging SDK version

Now you have to use versionNumber that returns GADVersionNumber. If you want to have the string representation of the version number then do this instead:

Swift:

GADGetStringFromVersionNumber(GADMobileAds.sharedInstance().versionNumber)

Objective-C:

GADGetStringFromVersionNumber([[GADMobileAds sharedInstance] versionNumber]);

Upvotes: 2

stackich
stackich

Reputation: 5287

SWIFT:

print(GADMobileAds.sharedInstance().sdkVersion)

Upvotes: 9

Heesung Park
Heesung Park

Reputation: 101

    NSLog(@"admob version  %@ " ,[[GADMobileAds sharedInstance] sdkVersion]);

Upvotes: 4

Mitesh Varu
Mitesh Varu

Reputation: 246

pragma mark GADRequest implementation

- (GADRequest *)request {
GADRequest *request = [GADRequest request];


NSLog(@"Received ad successfully %@ " , [GADRequest sdkVersion] );

request.testDevices = @[
                        kGADSimulatorID
                        ];
return request;
}

Implement the above code in your iOS Project And Check Log

you will get Output something like this

afma-sdk-i-v7.27.0

Upvotes: 9

Related Questions