Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RyosukeCla committed Sep 28, 2023
1 parent e783fee commit 003b8e4
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions ios/Nativebrik/Classes/sdk.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,14 @@ class Config {
}
}

// for internal use
init(projectId: String, url: String) {
self.projectId = projectId
self.url = url
}

func initFrom(onEvent: ((_ event: ComponentEvent) -> Void)?) -> Config {
let config = Config(
projectId: self.projectId,
url: self.url
projectId: self.projectId
)

for listener in eventListeners {
config.eventListeners.append(listener)
}

if let onEvent = onEvent {
config.eventListeners.append(onEvent)
Expand Down Expand Up @@ -142,17 +139,6 @@ public class Nativebrik: ObservableObject {
self.overlayVC = OverlayViewController(user: self.user, config: config, repositories: repositories)
self.experiment = NativebrikExperiment(user: self.user, config: config, repositories: repositories, overlay: self.overlayVC)
}

public init(projectId: String, environment: String) {
self.user = NativebrikUser()
self.config = Config(
projectId: projectId,
url: environment
)
self.repositories = Repositories(config: config, user: self.user)
self.overlayVC = OverlayViewController(user: self.user, config: config, repositories: repositories)
self.experiment = NativebrikExperiment(user: self.user, config: config, repositories: repositories, overlay: self.overlayVC)
}

public func overlayViewController() -> UIViewController {
return self.overlayVC
Expand Down

0 comments on commit 003b8e4

Please sign in to comment.