Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private void onClickIdentify() {
}

private void checkVisitorId() {
String sfx = "na.edge.optable.co/prebidtest/js-sdk";
String sfx = "na.edge.optable.co/prebidtest/android-sdk";
String visitorKey = "OPTABLE_PASS_" + Base64.encodeToString(sfx.getBytes(StandardCharsets.UTF_8), 0);

SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(requireContext());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public void onAdFailedToLoad(@NonNull @NotNull LoadAdError loadAdError) {
private void onClickCachedBanner() {
OptableTargeting targeting = optable.targetingFromCache();
if (targeting != null) {
changeStatusText("Targeting success");
changeStatusText("Targeting from cache success");
appendStatusText("GAM targeting keywords: " + targeting.getGamTargetingKeywords());
appendStatusText("OpenRTB JSON: " + targeting.getOpenRtbJson());
appendStatusText("Targeting data: " + targeting.getTargetingData());
Expand Down Expand Up @@ -155,8 +155,10 @@ private void applyOptableToPrebid(@Nullable OptableTargeting optableResult) {
}

String openRtbJson = optableResult.getOpenRtbJson();
if (openRtbJson != null) {
if (openRtbJson != null && !openRtbJson.trim().isEmpty()) {
TargetingParams.setGlobalOrtbConfig(openRtbJson);
} else {
TargetingParams.setGlobalOrtbConfig(null);
}
}

Expand Down Expand Up @@ -193,7 +195,7 @@ private void witness() {
eventProperties.put("exampleKey2", 123);
eventProperties.put("exampleKey3", false);

optable.witness("GAMBannerFragment.loadAdButtonClicked", eventProperties, result -> {
optable.witness("PrebidBannerFragment.loadAdButtonClicked", eventProperties, result -> {
if (result instanceof OptableResult.Success) {
appendStatusText("Witness Success");
} else if (result instanceof OptableResult.Error<Unit> error) {
Expand Down
3 changes: 0 additions & 3 deletions DemoApp/DemoAppJava/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
<resources>
<string name="app_name">DemoAppJava</string>
<string name="title_home">Home</string>
<string name="title_dashboard">Dashboard</string>
<string name="title_notifications">Notifications</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class MainActivity : AppCompatActivity() {
setOf(
R.id.navigation_identify,
R.id.navigation_gambanner,
R.id.navigation_prebid,
)
)
setupActionBarWithNavController(navController, appBarConfiguration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class TheApplication : Application() {
providedContext = this,
tenant = "prebidtest",
originSlug = "android-sdk",
host = "ca.edge.optable.co",
origin = "https://www.optable.co",
)
optable = OptableSDK(config)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class IdentifyFragment : Fragment() {


private fun checkVisitorId() {
val sfx = "na.edge.optable.co/prebidtest/js-sdk"
val sfx = "na.edge.optable.co/prebidtest/android-sdk"
val visitorKey = "OPTABLE_PASS_" + Base64.encodeToString(sfx.toByteArray(StandardCharsets.UTF_8), 0)

val prefs = PreferenceManager.getDefaultSharedPreferences(requireContext())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ class PrebidBannerFragment : Fragment() {
val openRtbJson = targeting.openRtbJson
if (openRtbJson?.isNotBlank() == true) {
TargetingParams.setGlobalOrtbConfig(openRtbJson)
} else {
TargetingParams.setGlobalOrtbConfig(null)
}
}

Expand Down Expand Up @@ -205,7 +207,7 @@ class PrebidBannerFragment : Fragment() {

private fun witness() {
val properties = hashMapOf<String, Any>("exampleKey" to "exampleValue", "anotherExample" to 123, "foo" to false)
optable.witness("GAMBannerFragment.loadAdButtonClicked", properties) { result ->
optable.witness("PrebidBannerFragment.loadAdButtonClicked", properties) { result ->
when (result) {
is OptableResult.Success -> {
appendStatusText("Witness success")
Expand Down
4 changes: 0 additions & 4 deletions DemoApp/DemoAppKotlin/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
<resources>
<string name="app_name">Android SDK Demo</string>
<string name="title_identify">Identify API</string>
<string name="title_gambanner">GAM Banner</string>
<string name="identify_api">Identify API</string>
<string name="gam_banner">GAM Banner</string>
</resources>
Loading