Use of undeclared identifier: ASIdentifierManager

20,164

Have you imported headers from the framework?

#import <AdSupport/ASIdentifierManager.h>
Share:
20,164

Related videos on Youtube

StuartM
Author by

StuartM

Web Developer/iOS Developer. Current Apps: Where to Next -https://itunes.apple.com/us/app/where-to-next/id884766874?ls=1&amp;mt=8 Shows business data around your current location.

Updated on July 09, 2022

Comments

  • StuartM
    StuartM almost 2 years

    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.

    • Shmidt
      Shmidt over 11 years
      #import <AdSupport/ASIdentifierManager.h>