-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull request #739: Release version 8.11
Merge in MOBILE-SDK/app_mobile-sdk-android from release_branch_v8.11 to master * commit '890fd6f86952004f22d1572eee35dd37fdea3e72': updated release note release version 8.11 Pull request #738: Readme file update for Github Pull request #735: 6273926 [Android] Added DSA Support Pull request #737: Fix HitTestResult for SRC_IMAGE_ANCHOR_TYPE Pull request #736: Jenkins Test Update
- Loading branch information
Showing
17 changed files
with
565 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
Appnexus Android SDK | ||
================== | ||
|
||
> [!CAUTION] | ||
> We no longer release source code updates of Android SDK to Github. This is not a deprecation of our SDK, only an open-source deprecation as we are taking our Android and iOS Mobile SDKs private. | ||
> Future updates starting from SDK v9.0 will be released only as compiled .aar binary file and will be published via MavenCentral or another equivalent service. | ||
> Please contact your account managers or submit a ticket via the Customer Support Portal: https://help.xandr.com/ if you have any questions. | ||
|
||
See our documentation on our wiki at | ||
https://docs.xandr.com/bundle/mobile-sdk/page/xandr-mobile-sdks.html | ||
|
||
Get the latest release notes here: https://github.com/appnexus/mobile-sdk-android/releases | ||
|
||
To file an issue or request an enhancement please visit the AppNexus Customer Support Portal (https://support.appnexus.com). **We do not accept GitHub issues.** | ||
Get the latest release notes here: https://docs.xandr.com/bundle/mobile-sdk/page/android-sdk-release-notes.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
package com.appnexus.opensdk; | ||
|
||
import com.appnexus.opensdk.utils.JsonUtil; | ||
import com.appnexus.opensdk.utils.StringUtil; | ||
import org.json.JSONArray; | ||
import org.json.JSONObject; | ||
import java.util.ArrayList; | ||
|
||
/** | ||
* Represents the response information for Digital Services Act (DSA) related data and transparency information. | ||
* This class includes fields for information such as on whose behalf the ad is displayed, who paid for the ad, | ||
* ad rendering information, and a list of transparency information. | ||
* | ||
* <p>Example Usage:</p> | ||
* <pre>{@code | ||
* ANDSAResponseInfo dsaResponseInfo = getAdResponseInfo().getDSAResponseInfo(); | ||
* String behalf = dsaResponseInfo.getBehalf(); | ||
* String paid = dsaResponseInfo.getPaid(); | ||
* ArrayList<ANDSATransparencyInfo> transparencyList = dsaResponseInfo.getTransparencyList(); | ||
* for(int i = 0; i <= transparencyList.size(); i++) { | ||
* ANDSATransparencyInfo tranparencyInfo = transparencyList.get(i); | ||
* String domain = tranparencyInfo.getDomain(); | ||
* ArrayList<Integer> params = tranparencyInfo.getDSAParams(); | ||
* } | ||
* | ||
* int adRender = dsaResponseInfo.getAdRender(); | ||
* }</pre> | ||
*/ | ||
public class ANDSAResponseInfo { | ||
private String behalf = ""; | ||
private String paid = ""; | ||
int adRender = -1; | ||
private ArrayList<ANDSATransparencyInfo> transparencyList = new ArrayList<>(); | ||
private static final String RESPONSE_KEY_DSA_BEHALF = "behalf"; | ||
private static final String RESPONSE_KEY_DSA_PAID = "paid"; | ||
private static final String RESPONSE_KEY_DSA_TRANSPARENCY = "transparency"; | ||
private static final String RESPONSE_KEY_DSA_DOMAIN = "domain"; | ||
private static final String RESPONSE_KEY_DSA_PARAMS = "dsaparams"; | ||
private static final String RESPONSE_KEY_DSA_AD_RENDER = "adrender"; | ||
|
||
/** | ||
* Process the dsa response from ad object | ||
* | ||
* @param dsaObject JsonObject that contains info of dsa | ||
* @return ANDSAResponseInfo if no issue happened during processing | ||
*/ | ||
public ANDSAResponseInfo create(JSONObject dsaObject) { | ||
if (dsaObject == null) { | ||
return null; | ||
} | ||
|
||
ANDSAResponseInfo dsaResponseInfo = new ANDSAResponseInfo(); | ||
String behalf = JsonUtil.getJSONString(dsaObject, RESPONSE_KEY_DSA_BEHALF); | ||
if (!StringUtil.isEmpty(behalf)) { | ||
dsaResponseInfo.setBehalf(behalf); | ||
} | ||
String paid = JsonUtil.getJSONString(dsaObject, RESPONSE_KEY_DSA_PAID); | ||
if (!StringUtil.isEmpty(paid)) { | ||
dsaResponseInfo.setPaid(paid); | ||
} | ||
JSONArray transparencyArray = JsonUtil.getJSONArray(dsaObject, RESPONSE_KEY_DSA_TRANSPARENCY); | ||
if (transparencyArray != null) { | ||
|
||
ArrayList<ANDSATransparencyInfo> transparencyList = new ArrayList<>(); | ||
for (int j = 0; j < transparencyArray.length(); j++) { | ||
JSONObject transparencyObject = transparencyArray.optJSONObject(j); | ||
if (transparencyObject != null) { | ||
String domain = JsonUtil.getJSONString(transparencyObject, RESPONSE_KEY_DSA_DOMAIN); | ||
JSONArray paramsArray = JsonUtil.getJSONArray(transparencyObject, RESPONSE_KEY_DSA_PARAMS); | ||
|
||
ANDSATransparencyInfo transparencyInfo = new ANDSATransparencyInfo(domain, JsonUtil.getIntegerArrayList(paramsArray)); | ||
transparencyList.add(transparencyInfo); | ||
} | ||
} | ||
dsaResponseInfo.setTransparencyList(transparencyList); | ||
} | ||
int adRender = JsonUtil.getJSONInt(dsaObject, RESPONSE_KEY_DSA_AD_RENDER); | ||
if (adRender >= 0) { | ||
dsaResponseInfo.setAdRender(adRender); | ||
} | ||
return dsaResponseInfo; | ||
} | ||
|
||
/** | ||
* Retrieve on whose behalf the ad is displayed. | ||
* | ||
* @return The behalf, returns an empty string if not set. | ||
*/ | ||
public String getBehalf() { | ||
return behalf; | ||
} | ||
|
||
/** | ||
* Set on whose behalf the ad is displayed. | ||
* | ||
* @param behalf The behalf to be set. | ||
*/ | ||
public void setBehalf(String behalf) { | ||
this.behalf = behalf; | ||
} | ||
|
||
/** | ||
* Retrieve who paid for the ad. | ||
* | ||
* @return The paid, returns an empty string if not set. | ||
*/ | ||
public String getPaid() { | ||
return paid; | ||
} | ||
|
||
/** | ||
* Set who paid for the ad. | ||
* | ||
* @param paid The paid to be set. | ||
*/ | ||
public void setPaid(String paid) { | ||
this.paid = paid; | ||
} | ||
|
||
/** | ||
* Retrieve indicating if the buyer/advertiser will render DSA transparency info. | ||
* 0 = buyer/advertiser will not render | ||
* 1 = buyer/advertiser will render | ||
* | ||
* @return The ad render that this ad belongs to. | ||
*/ | ||
public int getAdRender() { | ||
return adRender; | ||
} | ||
|
||
/** | ||
* Set indicating if the buyer/advertiser will render DSA transparency info. | ||
* | ||
* @param adRender The ad render value to be set. | ||
*/ | ||
public void setAdRender(int adRender) { | ||
this.adRender = adRender; | ||
} | ||
|
||
/** | ||
* Retrieve the transparency user parameters info | ||
*/ | ||
public ArrayList<ANDSATransparencyInfo> getTransparencyList() { | ||
return transparencyList; | ||
} | ||
|
||
/** | ||
* Set the transparency list using the provided list of ANDSATransparencyInfo. | ||
* | ||
* @param transparencyList The list of ANDSATransparencyInfo to be set. | ||
*/ | ||
public void setTransparencyList(ArrayList<ANDSATransparencyInfo> transparencyList) { | ||
this.transparencyList = transparencyList; | ||
} | ||
} |
Oops, something went wrong.