Skip to content

Special Cases

alex [dot] kramer [at] g_m_a_i_l [dot] com edited this page Aug 3, 2018 · 2 revisions

Custom server host and headers

To point the SDK at a custom host and inject cookies on each request, implement the RequestInterceptorParcelable (see RequestInterceptorParcelableImpl for example), and then initialize the SDK like this:

TradeItConfigurationBuilder configurationBuilder = new TradeItConfigurationBuilder(
    this.getApplicationContext(),
    "tradeit-test-api-key",
    TradeItEnvironment.QA
).withBaseUrl(
    "https://mycustomhost.com/some/path/"
).withRequestCookieProviderParcelable(
    new RequestCookieProviderParcelableImpl()
);

TradeItSDK.configure(configurationBuilder);
Clone this wiki locally