https://kotlinlang.org logo
Title
h

hisakazu

05/08/2023, 8:06 AM
I would like to incorporate DataDog’s RUM into Apollo kotlin. RUM monitor is provided by okhttp for Android and NSURLSession for iOS. https://docs.datadoghq.com/real_user_monitoring/ios/?tab=swift#initialize-the-rum-monitor-and-ddurlsessiondelegate For Android, there is extension functions that can pass
OkhttpClient
. But on iOS,
NSURLSession
cannot be customized from the outside. https://github.com/apollographql/apollo-kotlin/blob/main/libraries/apollo-runtime/src/appleMain/kotlin/com/apollographql/apollo3/network/http/NSURLSessionHttpEngine.kt 1) I am thinking as above, is it correct? 2) If I want to customize NSURLSession, do I need to provide my own
HttpEngine
? 3) Is there any plan to provide an extension function similar to okhttp in the Apollo roadmap? Translated with www.DeepL.com/Translator (free version)
m

mbonnin

05/08/2023, 8:29 AM
This is correct regarding NSURSession, you need to provide your own HttpEngine. Overall though, I would do this with a MPP HttpInterceptor
the extension for OkHttpClient was mainly done for users coming from V2 but for MPP stuff, I think MPP interfaces make more sense unless you really need something that requires a NSURSession
h

hisakazu

05/09/2023, 9:29 AM
I understand. thank you!