iamanyone
iamanyone

Reputation: 429

iOs: Swift Google Analytics

I am new to iOs development and would like to implement Google Analytics (swift).

It appears there is some missing information on implementing Google Analytics in swift on Google's instruction page:

enter image description here

It seems the import statement above is incorrect, can anyone assist me with the missing/correct statement?

Exta Info:

Upvotes: 3

Views: 785

Answers (2)

Dan
Dan

Reputation: 569

If you look in your Pods folder in Xcode you can see the available pods there. Most of them usually have a file that contains all import statements for any files needed. In this case its the Analytics.h file in Pods/Google/Analytics/

I'm guessing that, to import this file in your bridging header (which I hope you have, if not let me know), you can use #import "Google/Analytics.h".

It also says a little bit lower on the page, to import the <Google/Analytics.h> to the header.

Picture showing text on google page

Upvotes: 1

agy
agy

Reputation: 2854

In your Objective-C bridging header file, You should import GA header files:

#import "GAI.h"
#import "GAIDictionaryBuilder.h"
#import "GAIEcommerceFields.h"
#import "GAIEcommerceProduct.h"
#import "GAIEcommerceProductAction.h"
#import "GAIEcommercePromotion.h"
#import "GAIFields.h"
#import "GAILogger.h"
#import "GAITrackedViewController.h"
#import "GAITracker.h"

I am not sure if I am missing some import.

Upvotes: 4

Related Questions