Sunil Targe Sunil Targe - 1 year ago 121
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.

Answer Source

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).
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download