-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathAnalyticsProvider.swift
More file actions
27 lines (22 loc) · 1.22 KB
/
AnalyticsProvider.swift
File metadata and controls
27 lines (22 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//
// AnalyticsProvider.swift
// FlintCore
//
// Created by Marc Palmer on 04/04/2018.
// Copyright © 2018 Montana Floss Co. Ltd. All rights reserved.
//
import Foundation
/// Conform to this protocol to wire up your chosen Analytics service to receive events
/// when `Action`(s) that have an `analyticsID` set are performed.
///
/// Your implementation will receive the feature and action information, and the analytics properties returned
/// by your `Action` implementations' `analyticsAttributes(for:)` function.
///
/// Read the `analyticsID` for the event from the `action` passeds to the functions.
/// - see: `ConsoleAnalyticsProvider` for a trivial example implementation.
public protocol AnalyticsProvider {
/// Implement and override this for specific action types to marshal the appropriate analytics keys if required
func analyticsEventWillBegin<T>(feature: FeatureDefinition.Type, action: T.Type, context: [String:Any?]?) where T: Action
/// Implement and override this for specific action types to marshal the appropriate analytics keys if required
func analyticsEventDidEnd<T>(feature: FeatureDefinition.Type, action: T.Type, context: [String:Any?]?, outcome: ActionPerformOutcome) where T: Action
}