is this possible?
Right now I pulled in the files into my SwiftUIapp and I made the LiveChatOverlayController conform to UIViewControllerRepresentable and I also set the LiveChat.windowScene in my Scene Delegate. The view actually loads but it's indefinitely on the spinning loading view. Any way to get this to work?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
// Create the SwiftUI view that provides the window contents.
let mainView = MainView()
let loginView = LoginView()
// Use a UIHostingController as window root view controller.
if let windowScene = scene as? UIWindowScene {
LiveChat.windowScene = windowScene
let window = UIWindow(windowScene: windowScene)
if UserDefaults.standard.string(forKey: "eventId") != nil {
window.rootViewController = UIHostingController(rootView: mainView)
}
else {
window.rootViewController = UIHostingController(rootView: loginView)
}
self.window = window
window.makeKeyAndVisible()
}
}
extension LiveChatOverlayViewController: UIViewControllerRepresentable {
public typealias UIViewControllerType = LiveChatOverlayViewController
public func makeUIViewController(context: UIViewControllerRepresentableContext<LiveChatOverlayViewController>) -> LiveChatOverlayViewController {
return LiveChatOverlayViewController()
}
public func updateUIViewController(_ uiViewController: LiveChatOverlayViewController, context: UIViewControllerRepresentableContext<LiveChatOverlayViewController>) {
//
}
}
is this possible? Right now I pulled in the files into my SwiftUIapp and I made the LiveChatOverlayController conform to UIViewControllerRepresentable and I also set the LiveChat.windowScene in my Scene Delegate. The view actually loads but it's indefinitely on the spinning loading view. Any way to get this to work?