Skip to content

Commit d2e9062

Browse files
feat: network headers config entry
1 parent 62d0153 commit d2e9062

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

sdk-java/src/main/java/ly/count/sdk/java/Config.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,12 @@ public class Config {
230230
*/
231231
protected boolean unhandledCrashReportingEnabled = true;
232232

233+
/**
234+
* Custom network request headers to be sent with each request.
235+
* If you want to add a header, use {@link #addCustomNetworkRequestHeaders(Map)}.
236+
*/
237+
protected Map<String, String> customNetworkRequestHeaders = null;
238+
233239
public ConfigViews views = new ConfigViews(this);
234240

235241
protected String location = null;
@@ -1330,6 +1336,20 @@ public Config disableLocation() {
13301336
return this;
13311337
}
13321338

1339+
/**
1340+
* Allows you to add custom header key/value pairs to each request
1341+
*
1342+
* @return Returns the same config object for convenient linking
1343+
*/
1344+
public Config addCustomNetworkRequestHeaders(Map<String, String> customHeaderValues) {
1345+
this.customNetworkRequestHeaders = customHeaderValues;
1346+
return this;
1347+
}
1348+
1349+
public Map<String, String> getCustomNetworkRequestHeaders() {
1350+
return customNetworkRequestHeaders;
1351+
}
1352+
13331353
/**
13341354
* Logging level for {@link Log} module
13351355
*/

0 commit comments

Comments
 (0)