Skip to content

Commit

Permalink
Updating Unity Ads Rewarded Video adapter
Browse files Browse the repository at this point in the history
Please reference the Supported Mediation Partner page at http://bit.ly/2mqsuFH
for the latest version and ad format certifications.
  • Loading branch information
Andres Ornelas committed Jun 24, 2017
1 parent fc9ec2e commit 74f7bd6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions extras/src/com/mopub/mobileads/UnityRewardedVideo.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

/**
* A custom event for showing Unity rewarded videos.
*
* Please reference the Supported Mediation Partner page at http://bit.ly/2mqsuFH for the
* latest version and ad format certifications.
*/
public class UnityRewardedVideo extends CustomEventRewardedVideo {
private static final String GAME_ID_KEY = "gameId";
Expand Down Expand Up @@ -145,6 +148,7 @@ public void onUnityAdsStart(String placementId) {

@Override
public void onUnityAdsFinish(String placementId, UnityAds.FinishState finishState) {
MoPubLog.d("Unity rewarded video finished with finish state " + finishState);
if (finishState == UnityAds.FinishState.ERROR) {
MoPubRewardedVideoManager.onRewardedVideoPlaybackError(
UnityRewardedVideo.class,
Expand All @@ -157,12 +161,8 @@ public void onUnityAdsFinish(String placementId, UnityAds.FinishState finishStat
sPlacementId,
MoPubReward.success(MoPubReward.NO_REWARD_LABEL, MoPubReward.NO_REWARD_AMOUNT));
MoPubLog.d("Unity rewarded video completed for placement " + placementId);
} else {
MoPubRewardedVideoManager.onRewardedVideoCompleted(
UnityRewardedVideo.class,
placementId,
MoPubReward.failure());
MoPubLog.d("Unity rewarded video skipped for placement " + placementId);
} else if (finishState == UnityAds.FinishState.SKIPPED) {
MoPubLog.d("Unity rewarded video was skipped; no reward will be given");
}
MoPubRewardedVideoManager.onRewardedVideoClosed(UnityRewardedVideo.class, sPlacementId);
UnityAds.setListener(null);
Expand Down

0 comments on commit 74f7bd6

Please sign in to comment.