-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firebase and Segment integration #291
Changes from 23 commits
a6fc40d
077ae85
c87f7cb
3f4049c
8bc62e7
2d2ade2
dfdf6a4
c164495
f9c6813
53f73d5
5a61d28
5d9dd2b
c48416c
59b5be7
78a4f3d
81984f9
70285cc
17b8ee7
1c4939b
5eb6e20
d5d27ae
af25b64
7c67115
f40b7f2
00a6c86
fb22073
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// SegmentConfig.swift | ||
// Core | ||
// | ||
// Created by Anton Yarmolenka on 02/02/2024. | ||
// | ||
|
||
import Foundation | ||
|
||
private enum SegmentKeys: String, RawStringExtractable { | ||
case enabled = "ENABLED" | ||
case writeKey = "SEGMENT_IO_WRITE_KEY" | ||
} | ||
|
||
public final class SegmentConfig: NSObject { | ||
public var enabled: Bool = false | ||
public var writeKey: String = "" | ||
|
||
init(dictionary: [String: AnyObject]) { | ||
super.init() | ||
enabled = dictionary[SegmentKeys.enabled] as? Bool == true | ||
writeKey = dictionary[SegmentKeys.writeKey] as? String ?? "" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's make There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
} | ||
} | ||
|
||
private let segmentKey = "SEGMENT_IO" | ||
extension Config { | ||
public var segment: SegmentConfig { | ||
SegmentConfig(dictionary: self[segmentKey] as? [String: AnyObject] ?? [:]) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about moving the
analytics.identify(.....)
call toshowMainOrWhatsNewScreen
so you don't have to worry about from where the main screen is being shown? At the moment it's being called from multiple places.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really like the idea of passing User variable inside the router. However, we may come back to this question when we work with analytics (this is not part of this PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok