getting GMASDK's version number

78 views
Skip to first unread message

Eric Slosser

unread,
May 15, 2023, 4:16:56 PM5/15/23
to Google Mobile Ads SDK Developers
The methods described in this blog don't seem to apply to Swift code using GMA-SDK.

I see that the GMA-SDK has
FOUNDATION_EXPORT const unsigned char GoogleMobileAdsVersionString[];

But when I try to use that in the simplest possible Swift:
let foo = GoogleMobileAdsVersionString

I’m told
Cannot reference invalid declaration 'GoogleMobileAdsVersionString'

I wrote this ObjectiveC
const unsigned char* foo(void) {return GoogleMobileAdsVersionString; }
and can use it from the Swift side with
  if let a = foo() {
     let b = String(cString: a)
   }
  and can get "afma-sdk-i-v10.3.0", but that smacks of the internal version number that the blog referenced.

What am I missing?

Eric Slosser

unread,
May 16, 2023, 10:26:59 AM5/16/23
to Google Mobile Ads SDK Developers
this is now issue 0-5942000034256 on publisher-support

Eric Slosser

unread,
May 17, 2023, 9:56:08 AM5/17/23
to Google Mobile Ads SDK Developers
tracking: this was forwarded to mobileads-...@google.com yesterday at 8pm


Eric Slosser

unread,
May 17, 2023, 1:02:24 PM5/17/23
to Google Mobile Ads SDK Developers
The answer from support: The blog post is Android-specific. For iOS, use "sdkVersion"

In Swift, that's `GADMobileAds.sharedInstance().sdkVersion`. 

It returns "afma-sdk-i-v10.3.0".  Same as my ObjC bridging method, but without the effort.

Question answered.

Mobile Ads SDK Forum Advisor

unread,
May 18, 2023, 3:49:01 AM5/18/23
to google-adm...@googlegroups.com
Hi Eric,

I could see that you already have a discussion on different email thread. With that, we would recommend to continue the discussion there instead for better tracking of the issues.

Regards,
 
Google Logo Mobile Ads SDK Team


ref:_00D1U1174p._5004Q2lIqUL:ref
Reply all
Reply to author
Forward
0 new messages