Skip to content

Commit

Permalink
Merge pull request #6 from azerion/adv-failures
Browse files Browse the repository at this point in the history
Fixed adv failures
  • Loading branch information
vdkuipb authored Oct 7, 2019
2 parents e9a7773 + f9ba42a commit 995d2c2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": [
{
Expand Down
12 changes: 6 additions & 6 deletions src/Providers/cordova-ironsource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Expand Down
2 changes: 1 addition & 1 deletion src/Providers/gamedistribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 995d2c2

Please sign in to comment.