Created
March 6, 2020 09:25
-
-
Save bryanrmq/5fc4cc20cdcef8740c180601cc797641 to your computer and use it in GitHub Desktop.
SpectatorProvider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import UIKit | |
import Spectator | |
import FirebaseCore | |
import FirebaseAnalytics | |
class FirebaseProvider: SpectatorProvider { | |
public var providerType: SpectatorProviderType = .firebase | |
public func initialize(application: UIApplication, launchOptions: [UIApplication.LaunchOptionsKey : Any]?) { | |
guard FirebaseApp.app() != nil else { fatalError("You must do FirebaseApp.configure() before this call.") } | |
} | |
public func fire(_ event: SpectatorEventType, withParameters parameters: [String: String]?) { | |
Analytics.logEvent(event.name, parameters: parameters) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import UIKit | |
public protocol SpectatorProvider { | |
var providerType: SpectatorProviderType { get } | |
func initialize(application: UIApplication, launchOptions: [UIApplication.LaunchOptionsKey: Any]?) | |
func fire(_ event: SpectatorEventType, withParameters parameters: [String: String]?) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment