Skip to content

Commit

Permalink
Android SDK 6.10.4 update (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidKimVungle authored Feb 9, 2022
1 parent a23736d commit 15c20aa
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 112 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Changelog

### VERSION 6.10.4 (February 9, 2022)
* Updated SDK to be fully compliant with [Google Privacy Policies](https://developer.android.com/about/versions/12).
* COPPA API is now generally available.
* Stability Improvements.

### VERSION 6.10.3 (December 9, 2021)
* Added support for Google’s [Android 12](https://developer.android.com/about/versions/12).
* SDK now supports Android [Target API 31](https://developer.android.com/sdk/api_diff/31/changes).
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Please refer to https://support.vungle.com/hc/en-us/articles/360002922871
Vungle SDK for Android
=======================

**Version 6.10.3**
**Version 6.10.4**

Welcome to the Vungle SDK which has been battle-tested to unlock amazing monetization opportunities for you. The Vungle SDK enables the very best creatives in mobile advertising.

Expand Down
17 changes: 9 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,25 @@ dependencies {
// that is getting included
implementation 'androidx.appcompat:appcompat:1.3.0'

implementation 'com.vungle:publisher-sdk-android:6.10.3'
// Vungle SDK
implementation 'com.vungle:publisher-sdk-android:6.10.4'

// Recommended Google Play Services libraries to support app set ID (v6.10.3)
implementation 'com.google.android.gms:play-services-tasks:17.2.1'
implementation 'com.google.android.gms:play-services-appset:16.0.0'
// Recommended Google Play Services libraries to support app set ID (v6.10.3 and above)
implementation 'com.google.android.gms:play-services-tasks:18.0.1'
implementation 'com.google.android.gms:play-services-appset:16.0.2'

// Recommended Google Play Services libraries to support Google Advertising ID
implementation 'com.google.android.gms:play-services-basement:17.6.0'
implementation 'com.google.android.gms:play-services-ads-identifier:17.1.0'
implementation 'com.google.android.gms:play-services-basement:18.0.0'
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'

// AAR Integration
// implementation files('libs/vungle-android-sdk-6.10.3.aar')
// implementation files('libs/vungle-android-sdk-6.10.4.aar')
// implementation files('libs/gson-2.8.6.jar')
// implementation files('libs/okhttp-3.12.12.jar')
// implementation files('libs/okio-1.15.0.jar')

// JAR Integration
// implementation files('libs/vungle-android-sdk-6.10.3.jar')
// implementation files('libs/vungle-android-sdk-6.10.4.jar')
// implementation files('libs/gson-2.8.6.jar')
// implementation files('libs/okhttp-3.12.12.jar')
// implementation files('libs/okio-1.15.0.jar')
Expand Down
Binary file removed app/libs/vungle-android-sdk-6.10.3.aar
Binary file not shown.
Binary file added app/libs/vungle-android-sdk-6.10.4.aar
Binary file not shown.
Binary file not shown.
108 changes: 5 additions & 103 deletions app/src/main/java/com/publisher/sample/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ private void initSDK() {
.setAndroidIdOptOut(false)
.build();

// COPPA example
// Please call updateUserCoppaStatus before SDK initialization
Vungle.updateUserCoppaStatus(true);

// CCPA example (default: OPTED_IN)
// Vungle.updateCCPAStatus(Consent.OPTED_OUT);
// Vungle.getCCPAStatus();
Expand Down Expand Up @@ -395,7 +399,7 @@ private AdConfig getAdConfig() {
AdConfig adConfig = new AdConfig();

adConfig.setAdOrientation(AdConfig.MATCH_VIDEO);
adConfig.setMuted(true);
adConfig.setMuted(false);

return adConfig;
}
Expand Down Expand Up @@ -453,108 +457,6 @@ private void makeToast(String message) {
Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();
}

private class VungleAd {
@NonNull private final String name;
@NonNull private final String placementReferenceId;
@NonNull private final TextView titleTextView;
@NonNull private final Button loadButton;
@NonNull private final Button playButton;
@Nullable private final Button pauseResumeButton;
@Nullable private final Button closeButton;
@Nullable private final Button bannerListButton;
@Nullable private final Button bannerMultipleButton;
@Nullable private final FrameLayout container;
@NonNull private boolean bannerAdPlaying;

private VungleAd(String name) {
this.name = name;
this.placementReferenceId = getPlacementReferenceId();
this.titleTextView = getTextView();
this.loadButton = getLoadButton();
this.playButton = getPlayButton();
this.pauseResumeButton = getPauseResumeButton();
this.closeButton = getCloseButton();
this.bannerListButton = getBannerListButton();
this.bannerMultipleButton = getBannerMultipleButton();
this.container = getContainer();
this.bannerAdPlaying = false;
}

private String getPlacementReferenceId() {
int stringId = getResources().getIdentifier("placement_id_" + name, "string", PACKAGE_NAME);
return getString(stringId);
}

private TextView getTextView() {
int textViewId = getResources().getIdentifier("tv_" + name, "id", PACKAGE_NAME);
String textViewString = getString(getResources().getIdentifier("title_" + name, "string", PACKAGE_NAME));
TextView tv = (TextView) findViewById(textViewId);
tv.setText(textViewString + " - " + placementReferenceId);
return tv;
}

private Button getLoadButton() {
int buttonId = getResources().getIdentifier("btn_load_" + name, "id", PACKAGE_NAME);
Button button = (Button) findViewById(buttonId);
disableButton(button);
return button;
}

private Button getPlayButton() {
int buttonId = getResources().getIdentifier("btn_play_" + name, "id", PACKAGE_NAME);
Button button = (Button) findViewById(buttonId);
disableButton(button);
return button;
}

private Button getPauseResumeButton() {
int buttonId = getResources().getIdentifier("btn_pause_resume_" + name, "id", PACKAGE_NAME);
Button button = (Button) findViewById(buttonId);
if (button != null) {
disableButton(button);
return button;
}
return null;
}

private Button getCloseButton() {
int buttonId = getResources().getIdentifier("btn_close_" + name, "id", PACKAGE_NAME);
Button button = (Button) findViewById(buttonId);
if (button != null) {
disableButton(button);
return button;
}
return null;
}

private FrameLayout getContainer() {
int containerId = getResources().getIdentifier("container_" + name, "id", PACKAGE_NAME);
FrameLayout container = (FrameLayout) findViewById(containerId);
if (container != null) {
return container;
}
return null;
}

private Button getBannerListButton() {
int buttonId = getResources().getIdentifier("btn_list_" + name, "id", PACKAGE_NAME);
Button button = (Button) findViewById(buttonId);
if (button != null) {
return button;
}
return null;
}

private Button getBannerMultipleButton() {
int buttonId = getResources().getIdentifier("btn_multiple_" + name, "id", PACKAGE_NAME);
Button button = (Button) findViewById(buttonId);
if (button != null) {
return button;
}
return null;
}
}

private class VungleAd {
@NonNull private final String name;
@NonNull private final String placementReferenceId;
Expand Down

0 comments on commit 15c20aa

Please sign in to comment.