12
工作,我試圖用Google Analytics與我的雨燕1.2的應用程序使用Xcode的6.3beta。谷歌分析不雨燕1.2和6.3的Xcode
我的橋接頭正常工作,幷包含:
#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"
我嘗試以下斯威夫特代碼來跟蹤頁面:
var tracker2:GAITracker = GAI.sharedInstance().defaultTracker as GAITracker
tracker2.set(kGAIScreenName, value:"Home Screen")
tracker2.send(GAIDictionaryBuilder.createScreenView().build())
但上面的最後一行引發了以下錯誤:
Cannot invoke 'send' with an argument list of type '(NSMutableDictionary!)'
我發現類似的問題,如:Google Analytics not initialising in Swift,Using Google Analytics with Swift on iOS
我有什麼改變,使上面雨燕1.2使用的代碼?
'as [NSObject:AnyObject]'就夠了 –
createScreenView() –