I'm trying to use GA with a Swift project.
I installed the SDK correctly but I can't send Screen Measurements manually because some objects are not found.
Here's the code given by Google:
// May return nil if a tracker has not already been initialized with a
// property ID.
id tracker = [[GAI sharedInstance] defaultTracker];
// This screen name value will remain set on the tracker and sent with
// hits until it is set to a new value or to nil.
[tracker set:kGAIScreenName
value:@"Home Screen"];
// New SDK versions
[tracker send:[[GAIDictionaryBuilder createScreenView] build]];
Here's my code:
let tracker = GAI.sharedInstance()
tracker.setValue(kGai, forKey: "/index")
tracker.send(GAIDictionaryBuilder.createScreenView().build)
And here's the errors I get:
Use of unresolved identifier 'kGAIScreenName'
Use of unresolved identifier 'GAIDictionaryBuilder'
I imported GAI.h in my BridingHeader and added frameworks to the build file, no errors on this side.
Thanks!