Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions OptimobileCore/Sources/Credentials.swift

This file was deleted.

7 changes: 0 additions & 7 deletions OptimobileCore/Sources/Extensions/Notifications.swift

This file was deleted.

Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import Foundation

public enum AppGroupConfig {
public static var suffix: String = ".optimove"
enum AppGroupConfig {
static var suffix: String = ".optimove"
}

public enum AppGroupsHelper {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import Foundation

public extension Bundle {
extension Bundle {
/// https://stackoverflow.com/a/27849695
static func hostAppBundle() -> Bundle? {
let mainBundle = Bundle.main
Expand Down
12 changes: 0 additions & 12 deletions OptimoveCore/Sources/Classes/Extension/Result+Successful.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import Foundation

public extension utsname {
extension utsname {
var deviceModel: String {
var systemInfo = self
uname(&systemInfo)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import Foundation

public let KS_MESSAGE_TYPE_PUSH = 1

public enum OptimobileHelper {
private static let installIdLock = DispatchSemaphore(value: 1)
public static let userIdLock = DispatchSemaphore(value: 1)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright © 2023 Optimove. All rights reserved.

@testable import OptimobileCore
import OptimoveCore
import XCTest

final class MediaHelperTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright © 2023 Optimove. All rights reserved.

import OptimobileCore
import OptimoveCore
import OptimoveTest
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright © 2022 Optimove. All rights reserved.

import OptimobileCore
import OptimoveCore
import UserNotifications

enum CategoryManager {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © 2022 Optimove. All rights reserved.

import Foundation
import OptimobileCore
import OptimoveCore
import UIKit
import UserNotifications

Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

import Foundation

public final class RuntimeCodingKey: CodingKey {
public var stringValue: String
final class RuntimeCodingKey: CodingKey {
var stringValue: String

public init?(stringValue: String) {
init?(stringValue: String) {
self.stringValue = stringValue
}

public var intValue: Int?
var intValue: Int?

public init?(intValue: Int) {
init?(intValue: Int) {
self.intValue = intValue
stringValue = String(intValue)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ import Foundation
import OptimoveCore
import UIKit

typealias OptistreamEvent = OptimoveCore.OptistreamEvent
typealias OptistreamEventBuilder = OptimoveCore.OptistreamEventBuilder
typealias OptistreamNetworking = OptimoveCore.OptistreamNetworking

final class OptiTrack {
enum Constants {
static let eventBatchLimit = 50
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

import Foundation

public struct Configuration: Codable, TenantInfo, EventInfo {
public let tenantID: Int
public let logger: LoggerConfig
public let realtime: RealtimeConfig
public let optitrack: OptitrackConfig
public let events: [String: EventsConfig]
public let isEnableRealtime: Bool
public let isSupportedAirship: Bool
struct Configuration: Codable, TenantInfo, EventInfo {
let tenantID: Int
let logger: LoggerConfig
let realtime: RealtimeConfig
let optitrack: OptitrackConfig
let events: [String: EventsConfig]
let isEnableRealtime: Bool
let isSupportedAirship: Bool

public init(
init(
tenantID: Int,
logger: LoggerConfig,
realtime: RealtimeConfig,
Expand All @@ -30,12 +30,12 @@ public struct Configuration: Codable, TenantInfo, EventInfo {
}
}

public struct LoggerConfig: Codable, TenantInfo {
public let tenantID: Int
public let logServiceEndpoint: URL
public let isProductionLogsEnabled: Bool
struct LoggerConfig: Codable, TenantInfo {
let tenantID: Int
let logServiceEndpoint: URL
let isProductionLogsEnabled: Bool

public init(
init(
tenantID: Int,
logServiceEndpoint: URL,
isProductionLogsEnabled: Bool
Expand All @@ -46,13 +46,13 @@ public struct LoggerConfig: Codable, TenantInfo {
}
}

public struct RealtimeConfig: Codable, TenantInfo, EventInfo {
public let tenantID: Int
public let realtimeGateway: URL
public let events: [String: EventsConfig]
public let isEnableRealtimeThroughOptistream: Bool
struct RealtimeConfig: Codable, TenantInfo, EventInfo {
let tenantID: Int
let realtimeGateway: URL
let events: [String: EventsConfig]
let isEnableRealtimeThroughOptistream: Bool

public init(
init(
tenantID: Int,
realtimeGateway: URL,
events: [String: EventsConfig],
Expand All @@ -65,15 +65,15 @@ public struct RealtimeConfig: Codable, TenantInfo, EventInfo {
}
}

public struct OptitrackConfig: Codable, TenantInfo, EventInfo {
public let tenantID: Int
public let optitrackEndpoint: URL
public let enableAdvertisingIdReport: Bool
public let eventCategoryName: String
public let events: [String: EventsConfig]
public let isEnableRealtime: Bool
struct OptitrackConfig: Codable, TenantInfo, EventInfo {
let tenantID: Int
let optitrackEndpoint: URL
let enableAdvertisingIdReport: Bool
let eventCategoryName: String
let events: [String: EventsConfig]
let isEnableRealtime: Bool

public init(
init(
tenantID: Int,
optitrackEndpoint: URL,
enableAdvertisingIdReport: Bool,
Expand All @@ -90,10 +90,10 @@ public struct OptitrackConfig: Codable, TenantInfo, EventInfo {
}
}

public protocol TenantInfo {
protocol TenantInfo {
var tenantID: Int { get }
}

public protocol EventInfo {
protocol EventInfo {
var events: [String: EventsConfig] { get }
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import Foundation

public final class ConfigurationBuilder {
private let globalConfig: GlobalConfig
private let tenantConfig: TenantConfig
private let events: [String: EventsConfig]
final class ConfigurationBuilder {
let globalConfig: GlobalConfig
let tenantConfig: TenantConfig
let events: [String: EventsConfig]

public init(globalConfig: GlobalConfig,
tenantConfig: TenantConfig)
init(globalConfig: GlobalConfig,
tenantConfig: TenantConfig)
{
self.globalConfig = globalConfig
self.tenantConfig = tenantConfig
Expand All @@ -18,7 +18,7 @@ public final class ConfigurationBuilder {
)
}

public func build() -> Configuration {
func build() -> Configuration {
return Configuration(
tenantID: tenantConfig.optitrack.siteId,
logger: buildLoggerConfig(),
Expand All @@ -31,7 +31,7 @@ public final class ConfigurationBuilder {
}
}

private extension ConfigurationBuilder {
extension ConfigurationBuilder {
func buildLoggerConfig() -> LoggerConfig {
return LoggerConfig(
tenantID: tenantConfig.optitrack.siteId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import Foundation

// MARK: - GlobalConfig

public struct GlobalConfig: Codable, Equatable {
public let general: GlobalGeneralConfig
public let optitrack: GlobalOptitrackConfig
public let coreEvents: [String: EventsConfig]
struct GlobalConfig: Codable, Equatable {
let general: GlobalGeneralConfig
let optitrack: GlobalOptitrackConfig
let coreEvents: [String: EventsConfig]

public init(general: GlobalGeneralConfig,
optitrack: GlobalOptitrackConfig,
coreEvents: [String: EventsConfig])
init(general: GlobalGeneralConfig,
optitrack: GlobalOptitrackConfig,
coreEvents: [String: EventsConfig])
{
self.general = general
self.optitrack = optitrack
Expand All @@ -24,14 +24,14 @@ public struct GlobalConfig: Codable, Equatable {
case coreEvents = "core_events"
}

public init(from decoder: Decoder) throws {
init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
general = try container.decode(GlobalGeneralConfig.self, forKey: .general)
optitrack = try container.decode(GlobalOptitrackConfig.self, forKey: .optitrack)
coreEvents = try container.decode([String: EventsConfig].self, forKey: .coreEvents)
}

public func encode(to encoder: Encoder) throws {
func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(general, forKey: .general)
try container.encode(optitrack, forKey: .optitrack)
Expand All @@ -41,10 +41,10 @@ public struct GlobalConfig: Codable, Equatable {

// MARK: - General

public struct GlobalGeneralConfig: Codable, Equatable {
public let logsServiceEndpoint: URL
struct GlobalGeneralConfig: Codable, Equatable {
let logsServiceEndpoint: URL

public init(logsServiceEndpoint: URL) {
init(logsServiceEndpoint: URL) {
self.logsServiceEndpoint = logsServiceEndpoint
}

Expand All @@ -55,10 +55,10 @@ public struct GlobalGeneralConfig: Codable, Equatable {

// MARK: - Optitrack

public struct GlobalOptitrackConfig: Codable, Equatable {
public let eventCategoryName: String
struct GlobalOptitrackConfig: Codable, Equatable {
let eventCategoryName: String

public init(eventCategoryName: String) {
init(eventCategoryName: String) {
self.eventCategoryName = eventCategoryName
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import Foundation
import OptimoveCore

public final class RemoteConfigurationRequestBuilder {
final class RemoteConfigurationRequestBuilder {
enum Error: LocalizedError {
case failedToCreateTenantConfigurationRequest(Swift.Error)

Expand All @@ -21,11 +21,11 @@ public final class RemoteConfigurationRequestBuilder {

private let storage: OptimoveStorage

public init(storage: OptimoveStorage) {
init(storage: OptimoveStorage) {
self.storage = storage
}

public func createTenantConfigurationsRequest() throws -> NetworkRequest {
func createTenantConfigurationsRequest() throws -> NetworkRequest {
do {
let tenantToken = try storage.getTenantToken()
let version = try storage.getVersion()
Expand All @@ -41,7 +41,7 @@ public final class RemoteConfigurationRequestBuilder {
}
}

public func createGlobalConfigurationsRequest() -> NetworkRequest {
func createGlobalConfigurationsRequest() -> NetworkRequest {
let url = Endpoints.Remote.GlobalConfig.url
Logger.debug("Connect to \(url.absoluteString) to retreive global file.")
return NetworkRequest(method: .get, baseURL: url, timeoutInterval: Constants.timeout)
Expand Down
Loading