Sean Proctor
02/23/2022, 10:43 PMaddHttpInterceptor
doesn't affect WS connections. Is that intentional? Is there an alternative to using an OkHttpClient
with an interceptor for web sockets?mbonnin
02/23/2022, 11:53 PMSean Proctor
02/23/2022, 11:55 PMmbonnin
02/23/2022, 11:56 PMSean Proctor
02/23/2022, 11:59 PMmbonnin
02/24/2022, 12:00 AMSean Proctor
02/24/2022, 12:04 AMmbonnin
02/24/2022, 12:17 AMSean Proctor
02/24/2022, 12:19 AMmbonnin
02/24/2022, 12:19 AMSean Proctor
02/24/2022, 12:23 AMmbonnin
02/24/2022, 12:24 AMI guess you can't just use the http interceptor in there.Not really.
HttpInterceptor
uses a different API that iOS/OkHttp don't understandSean Proctor
02/24/2022, 12:25 AMmbonnin
02/24/2022, 12:25 AMPretty sure I could.If you can, that's the easiest route,
SubscriptionWsProtocol
has a connectionPayload
parameterval apolloClient = ApolloClient.Builder()
.httpServerUrl("<http://localhost:8080/graphql>")
.webSocketServerUrl("<http://localhost:8080/subscriptions>")
.wsProtocol(
SubscriptionWsProtocol.Factory(
connectionPayload = {
mapOf("authorization" to myToken)
}
)
)
Sean Proctor
02/24/2022, 12:30 AMmbonnin
02/24/2022, 12:32 AMSean Proctor
02/24/2022, 12:41 AMmbonnin
02/24/2022, 12:46 AM