Kandy-IO / kandy-link-android-sdk

Kandy Link Android SDK release repository
4 stars 1 forks source link

It's not possible to inject custom headers while performing subscription #23

Open tommus opened 3 years ago

tommus commented 3 years ago

I'm using Kandy SDK in order to establish and handle audio connections.

A third party backend service which I need to connect to uses a different authentication header (x-token) instead of Authorization header.

Can you please provide a way to inject custom headers so the library will use these while performing REST requests?

I saw RestUtils class and reviewed the source code. It should be quite simple to achieve (eg. by adding a static map of custom headers in Configuration class. Those headers might be added to messageHeader before the RestUtils's method getDefaultHeaders return.

I'm maintaining quite big project for a longer while (two years so far) starting from the original Genband library. Right now, having no possibility to inject SPiDR token via x-token header while performing registration is a blocking issue, forcing me to start considering to drop the Genband / Kandy library entirely.

Any help will be much appreciated. Thank you.

meronelpaz commented 3 years ago

Hi,

We don't support custom headers to the registration/subscription requests. we will discuss this in our future road map planning

tommus commented 3 years ago

You may also consider switching to OkHttp to handle REST calls. This is basically a standard (solely or via Retrofit) for the most of Android applications. OkHttp will take care for all the networking things (including headers) and open a lot of possibilities whenever client has to do something non-usual.