Sunil Targe Sunil Targe - 8 months ago 74
Swift Question

How to implement Firebase Google Analytics in custom keyboard?

I want to implement Firebase google analytics in my custom keyboard for button click event.

Anyone please tell me how I can do this in swift.


Add firebase sdk and GoogleService-Info.plist file to keyboard extension target. Import firebase and configure it. FIRApp.configure() must be called only once per session:

import Firebase

class FirebaseConfigurator: NSObject {
static var onceToken: dispatch_once_t = 0

static func configure() {
    dispatch_once(&onceToken) {


FIRAnalytics.logEventWithName("button click event", parameters: nil).