Skip to content

Commit eb6ec4a

Browse files
Make MixpanelService public
1 parent 96440d8 commit eb6ec4a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Sources/SwiftfulLoggingMixpanel/MixpanelService.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import Mixpanel
33
import SwiftfulLogging
44
import SendableDictionary
55

6-
struct MixpanelProvider: LogService {
6+
public struct MixpanelService: LogService {
77

88
private var instance: MixpanelInstance {
99
Mixpanel.mainInstance()
1010
}
1111

12-
init(token: String) {
12+
public init(token: String) {
1313
#if !os(OSX) && !os(watchOS)
1414
Mixpanel.initialize(token: token, trackAutomaticEvents: true)
1515
#else
@@ -18,7 +18,7 @@ struct MixpanelProvider: LogService {
1818
instance.loggingEnabled = false
1919
}
2020

21-
func identifyUser(userId: String, name: String?, email: String?) {
21+
public func identifyUser(userId: String, name: String?, email: String?) {
2222
instance.identify(distinctId: userId)
2323

2424
if let name {
@@ -29,21 +29,21 @@ struct MixpanelProvider: LogService {
2929
}
3030
}
3131

32-
func trackEvent(event: LoggableEvent) {
32+
public func trackEvent(event: LoggableEvent) {
3333
let properties = event.parameters?.mapValues({ $0 as? MixpanelType })
3434
Mixpanel.mainInstance().track(event: event.eventName, properties: properties)
3535
}
3636

37-
func trackScreenView(event: any LoggableEvent) {
37+
public func trackScreenView(event: any LoggableEvent) {
3838
trackEvent(event: event)
3939
}
4040

41-
func addUserProperties(dict: SendableDict) {
41+
public func addUserProperties(dict: SendableDict) {
4242
let properties = dict.dict.mapValues({ $0 as? MixpanelType })
4343
instance.people.set(properties: properties)
4444
}
4545

46-
func deleteUserProfile() {
46+
public func deleteUserProfile() {
4747
instance.people.deleteUser()
4848
}
4949
}

0 commit comments

Comments
 (0)