My below code seems to work fine but I get lots of console slog in a yellow background. I can't exaplain or understand what it is. Can anybody provide an explanation? If no, why it is shown?
import SwiftUI
import os
import Smooch
let logger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "someCategory")
final class AuthDelegate: NSObject, SKTAuthenticationDelegate {
func onInvalidToken(_ error: Error, handler completionHandler: @escaping SKTAuthenticationCompletionBlock) {
// retrieve new token
print("onInvalidToken triggered... nick")
completionHandler("fake token")
}
}
@main
struct TestApp: App {
init() {
let settings = SKTSettings(integrationId: "65031cd01b")
let ad = AuthDelegate()
settings.authenticationDelegate = ad
Smooch.initWith(settings)
logger.log("after Smooch init...")
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
import SwiftUI
import Smooch
struct ContentView: View {
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text("Hello, world!")
Button("Press me") {
print("button pressed")
// 1. login with token
let jwtToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImFwcF82NTA4MDE3ODA0MTAwMGYwNmUyZDJiZDIifQ.eyJzY29wZSI6ImFwcFVzZXIiLCJpYXQiOjE3MDE4MzMxNjYsInVzZXJJZCI6Ijk3ODA1NzQ3LTFkMjAtNGFjMy04MTYyLTQ2NDdiMTg5MmQ0MSIsImV4cCI6MTcwMTgzMzc2Nn0.7ZZ8LHN15UddWlcYnsLXmtaMqYrAHEFc9Y-QqU-vosM"
Smooch.login("97805747-1d20", jwt: jwtToken )
// 2. show
Smooch.show()
}
}
.padding()
}
}
#Preview {
ContentView()
}
Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain
Code=4099 "The connection to service named com.apple.commcenter.coretelephony.xpc
was invalidated: failed at lookup with error 3 - No such process."
UserInfo={NSDebugDescription=The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated:
failed at lookup with error 3 - No such process.}
Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099
"The connection to service named com.apple.commcenter.coretelephony.xpc
was invalidated: failed at lookup with error 3 - No such process."
UserInfo={NSDebugDescription=The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated:
failed at lookup with error 3 - No such process.}