From 003b8e473bfc469b99828c9dfe548db934f2f8cf Mon Sep 17 00:00:00 2001 From: RyosukeCla Date: Thu, 28 Sep 2023 14:12:56 +0900 Subject: [PATCH] fix --- ios/Nativebrik/Classes/sdk.swift | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/ios/Nativebrik/Classes/sdk.swift b/ios/Nativebrik/Classes/sdk.swift index 051bb20..fdaa0fb 100644 --- a/ios/Nativebrik/Classes/sdk.swift +++ b/ios/Nativebrik/Classes/sdk.swift @@ -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) @@ -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