Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use of undeclared identifier: ASIdentifierManager

Tags:

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.

like image 303
StuartM Avatar asked Jan 09 '13 22:01

StuartM


1 Answers

Have you imported headers from the framework?

#import <AdSupport/ASIdentifierManager.h>
like image 96
Shmidt Avatar answered Sep 27 '22 20:09

Shmidt