Skip to content

Commit

Permalink
feat(android): Add support for ArrayList
Browse files Browse the repository at this point in the history
  • Loading branch information
ds8k committed May 13, 2024
1 parent cbbffca commit 7303730
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,15 @@ public static AdManagerAdRequest buildAdRequest(ReadableMap adRequestOptions) {

for (Map.Entry<String, Object> entry : customTargeting.entrySet()) {
String key = entry.getKey();
String value = (String) entry.getValue();
builder.addCustomTargeting(key, value);
Object value = entry.getValue();

if (value instanceof String) {
String finalValue = (String) value;
builder.addCustomTargeting(key, finalValue);
} else {
ArrayList finalValue = (ArrayList) value;
builder.addCustomTargeting(key, finalValue);
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/types/RequestOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ export interface RequestOptions {
/**
* key-value pairs used for custom targeting
*
* Takes an array of string key/value pairs.
* Takes an object of keys with values of string or array of strings.
*/
customTargeting?: { [key: string]: string };
customTargeting?: { [key: string]: string | string[] };

/**
* Sets the request agent string to identify the ad request's origin. Third party libraries that reference the Mobile
Expand Down

0 comments on commit 7303730

Please sign in to comment.