Instabug / Instabug-iOS

In-app feedback and bug reporting tool for apps.
https://instabug.com/
Other
290 stars 67 forks source link

HTTP requests/responses not added to Instabug logs when using Ktor as HTTP client #331

Closed francos closed 4 years ago

francos commented 5 years ago

Steps to Reproduce the Problem

Use Ktor as HTTP client in a Kotlin Multiplatform project that is used from an iOS app that uses Instabug.

Expected Behavior

HTTP requests and responses processed by Ktor are logged in Instabug when a report is sent by the user.

Actual Behavior

HTTP requests and responses processed by Ktor are not part of the logs when sending a bug report via Instabug.

SDK Version

8.4.1

iOS Version

12.4

Device Model

iPhone 7 Plus

Kmohamed commented 5 years ago

let me check and get back to you very soon.

Kmohamed commented 5 years ago

@FrancoSabadini I checked Ktor site. To be honest I am not aware of kotline 😅 but Since they are mentioned that they are using NSURLSession so you can use enableLoggingForURLSessionConfiguration to send SessionConfiguration to Instabug in order to log network requests.

francos commented 5 years ago

Thanks for the quick response @Kmohamed :).

I tried to do that but I couldn't find a way to add this as seems like Ktor only allows us to add configurations for the requests but not the sessions :/.

I'll add a question on their Github repo to see if they offer some other configuration that I am not finding.

Kmohamed commented 5 years ago

@FrancoSabadini Perfect 👍. Also please tell me if you need any help.

francos commented 5 years ago

Thanks @Kmohamed, I'll update you when I have more info, this is the issue I raised on the Ktor Github project: https://github.com/ktorio/ktor/issues/1289

Kmohamed commented 5 years ago

@FrancoSabadini Thanks 🙏

Kmohamed commented 5 years ago

Hello @FrancoSabadini, Is everything works fine? If you need anything please let me know. I am happy to help.

francos commented 5 years ago

Hi @Kmohamed, seems like the Ktor team has enabled the configuration requested on the ticket I shared above, but the version of the library with that feature is not yet live. Once it is I will test it and let you know if it all works well.

Kmohamed commented 5 years ago

@FrancoSabadini Great till me if you need anything.

Kmohamed commented 4 years ago

@francos Please feel free to open it again if you face any issues or need help.

cloverlai commented 2 years ago

Hello, I'm trying to use NetworkLogger with ktor iOS but can't find any reference. Have you finished it @francos ? I'm working on iOS with shared Kotlin domain but don't have much kotlin knowledge. Hope to find some help here :).