How to check Current SDK version of Google AdMob iOS?
Asked Answered
E

4

10

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.

Exclamatory answered 11/1, 2018 at 9:47 Comment(0)
G
9

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

Gaylord answered 11/1, 2018 at 9:53 Comment(0)
K
9

SWIFT:

print(GADMobileAds.sharedInstance().sdkVersion)
Kraul answered 7/1, 2021 at 12:36 Comment(0)
F
4
    NSLog(@"admob version  %@ " ,[[GADMobileAds sharedInstance] sdkVersion]);
Forworn answered 7/5, 2021 at 10:20 Comment(1)
Please remember to include an explanation of your code, instead of just answering with code. Can you edit your answer to include that? In particular, it may be useful to explain why you prefer GADMobileAds over GADRequest, as proposed in the accepted answer.Prognostic
S
1

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]);
Sanguinolent answered 27/3, 2024 at 7:48 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.