Use of undeclared identifier: ASIdentifierManager

StuartM picture StuartM · Jan 9, 2013 · Viewed 19.2k times · Source

I am using the following code to show the unique identifier to be used for admob test apps.

This is with my applicationDidFinishLaunching...

// Print IDFA (from AdSupport Framework) for iOS 6 and UDID for iOS < 6.
if (NSClassFromString(@"ASIdentifierManager")) {
    NSLog(@"GoogleAdMobAdsSDK ID for testing: %@" ,
          [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]);
} else {
    NSLog(@"GoogleAdMobAdsSDK ID for testing: %@" ,
          [[UIDevice currentDevice] uniqueIdentifier]);
}

I get an error when building 'Use of undeclared identifier: ASIdentifierManager'

I have the AdSupport framework linked and can access the files the identifier manager is declared in, but it still doesn't recognise that?

I have cleaned build folder, restarted xCode same result.

Answer

Shmidt picture Shmidt · Jan 10, 2013

Have you imported headers from the framework?

#import <AdSupport/ASIdentifierManager.h>