1
votes

I have implemented Google Analytic in my app,I would like to use Display Feature of Google Analytics which is explained here https://developers.google.com/analytics/devguides/collection/ios/v3/display-features#overview

I am using the same code as describe in doc

id tracker = [[GAI sharedInstance] defaultTracker];
tracker.allowIDFACollection = YES;

But its giving me the error Property 'allowIDFACollection' not found on object of type '__strong id'

I have also linked the libAdIdAccess.a and AdSupport.framework, but the error is still there

2

2 Answers

1
votes

The problem is id tracker, specifically the id part, because you aren't telling the compiler what the class type is so it doesn't know what properties are available. Make the class type specific so the compiler knows that what you're asking it to do is actually possible.

1
votes

Was doing a silly mistake..... now after adding both framework (Addsupport and adidaccess)I have update tracker object type too

id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
tracker.allowIDFACollection = YES;

old code

id tracker = [[GAI sharedInstance] defaultTracker];
tracker.allowIDFACollection = YES;