forked from openedx/openedx-app-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: FullStory Integration and Analytics Implementation (openedx#471)
* feat: fullstory SDK integration and analytics implementation * chore: adding new screen events * chore: update user-defined flag to build settings based on config --------- Co-authored-by: Anton Yarmolenko <[email protected]>
- Loading branch information
1 parent
9901340
commit 5d99fba
Showing
36 changed files
with
959 additions
and
38 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,3 +122,4 @@ default_config/ | |
I18N/ | ||
*.lproj/ | ||
!en.lproj/ | ||
/config_script/__pycache__ |
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
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
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
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
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
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
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
95 changes: 95 additions & 0 deletions
95
Authorization/AuthorizationTests/AuthorizationMock.generated.swift
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// FullStoryConfig.swift | ||
// Core | ||
// | ||
// Created by Saeed Bashir on 6/21/24. | ||
// | ||
|
||
import Foundation | ||
|
||
private enum Keys: String, RawStringExtractable { | ||
case enabled = "ENABLED" | ||
case orgID = "ORG_ID" | ||
} | ||
|
||
public final class FullStoryConfig { | ||
public var enabled: Bool = false | ||
public var orgID: String = "" | ||
|
||
init(dictionary: [String: AnyObject]) { | ||
orgID = dictionary[Keys.orgID] as? String ?? "" | ||
enabled = !orgID.isEmpty && dictionary[Keys.enabled] as? Bool ?? false | ||
} | ||
} | ||
|
||
private let configKey = "FULLSTORY" | ||
extension Config { | ||
public var fullStory: FullStoryConfig { | ||
FullStoryConfig(dictionary: self[configKey] as? [String: AnyObject] ?? [:]) | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// | ||
// FullStoryConfigTests.swift | ||
// CoreTests | ||
// | ||
// Created by Saeed Bashir on 6/21/24. | ||
// | ||
|
||
import XCTest | ||
@testable import Core | ||
|
||
class FullStoryConfigTests: XCTestCase { | ||
|
||
func testNoFullStoryConfig() { | ||
let config = Config(properties: [:]) | ||
XCTAssertFalse(config.fullStory.enabled) | ||
} | ||
|
||
func testFullStoryEnabled() { | ||
let configDictionary = [ | ||
"FULLSTORY": [ | ||
"ENABLED": true, | ||
"ORG_ID": "org_id" | ||
] | ||
] | ||
|
||
let config = Config(properties: configDictionary) | ||
|
||
XCTAssertTrue(config.fullStory.enabled) | ||
XCTAssertNotNil(config.fullStory.orgID) | ||
} | ||
|
||
func testFullStoryDisabled() { | ||
let configDictionary = [ | ||
"FULLSTORY": [ | ||
"ENABLED": false, | ||
"ORG_ID": "org_id" | ||
] | ||
] | ||
|
||
let config = Config(properties: configDictionary) | ||
|
||
XCTAssertFalse(config.fullStory.enabled) | ||
XCTAssertNotNil(config.fullStory.orgID) | ||
} | ||
|
||
func testFullStoryMissingORGID() { | ||
let configDictionary = [ | ||
"FULLSTORY": [ | ||
"ENABLED": true | ||
] | ||
] | ||
|
||
let config = Config(properties: configDictionary) | ||
XCTAssertFalse(config.fullStory.enabled) | ||
XCTAssertEqual(config.fullStory.orgID, "") | ||
} | ||
} |
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
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
Oops, something went wrong.