From 4018f82aa6969748552202498b57d2879b692499 Mon Sep 17 00:00:00 2001 From: florisdh Date: Mon, 7 Oct 2019 16:47:48 +0200 Subject: [PATCH 1/4] Handeling ironsource failure events --- src/Providers/cordova-ironsource.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Providers/cordova-ironsource.ts b/src/Providers/cordova-ironsource.ts index 9c11e5a..fe83f2b 100644 --- a/src/Providers/cordova-ironsource.ts +++ b/src/Providers/cordova-ironsource.ts @@ -25,16 +25,16 @@ export class CordovaIronSource implements IProvider { appKey: appKey }) + const resume: () => void = () => this.resumeGameplay() + // Listen for interstitial - window.addEventListener('interstitialClosed', () => { - this.resumeGameplay() - }) + window.addEventListener('interstitialClosed', resume) + window.addEventListener('interstitialShowFailed', resume) window.addEventListener('interstitialLoaded', () => this.interstitialChanged(true)) // Listen for rewarded - window.addEventListener('rewardedVideoClosed', () => { - this.resumeGameplay() - }) + window.addEventListener('rewardedVideoClosed', resume) + window.addEventListener('rewardedVideoFailed', resume) IronSourceAds.hasRewardedVideo({ onSuccess: this.rewardedChanged.bind(this) }) From 0249d74c25a23f8eaf127e3f35be8021cbf57608 Mon Sep 17 00:00:00 2001 From: florisdh Date: Mon, 7 Oct 2019 16:48:18 +0200 Subject: [PATCH 2/4] Prevent preloading wrong adtype on gd --- src/Providers/gamedistribution.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Providers/gamedistribution.ts b/src/Providers/gamedistribution.ts index 1cae4d4..11dbe11 100644 --- a/src/Providers/gamedistribution.ts +++ b/src/Providers/gamedistribution.ts @@ -106,7 +106,7 @@ export class GameDistribution implements IProvider { //Does nothing, but needed for Provider interface public preloadAd(adType: AdType): void { - if (this.hasRewarded || !this.adsEnabled) { + if (this.hasRewarded || !this.adsEnabled || adType !== AdType.rewarded) { return } console.log('preloading ad') From e1cffcc9e39b4ae4a71a4f3405bd3b17173f97bd Mon Sep 17 00:00:00 2001 From: florisdh Date: Mon, 7 Oct 2019 16:50:54 +0200 Subject: [PATCH 3/4] Version bump to v0.3.3 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9ad00d3..2f7c5f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@azerion/h5-ad-wrapper", - "version": "0.3.2", + "version": "0.3.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index fa83a30..f38ecbf 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@azerion/h5-ad-wrapper", "author": "Azerion", - "version": "0.3.2", + "version": "0.3.3", "description": "Advertisement provider wrapper, similar to @azerion/phaser-ads but not tied into Phaser :)", "contributors": [ { From f9ba42ac8dbf7cf0f96e720d016549a49f465028 Mon Sep 17 00:00:00 2001 From: florisdh Date: Mon, 7 Oct 2019 16:53:42 +0200 Subject: [PATCH 4/4] Updated changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8356a23..55f5b5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.3.3] - 2019-10-19 +### Fixed +- Resume not being called after adv failure in ironsource +- Calling preload ad in gamedistribution with wrong adtype + ## [0.3.2] - 2019-09-11 ### Changed - Stop using GD test url for SDK