Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

AppLovin bug?
Started by richard11 Jun 13 2018 01:00 AM

2 replies to this topic
applovin bug
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

richard11

[GLOBAL: userInfoPane.html]
richard11
  • Enthusiast

  • 62 posts
  • Corona SDK

Does anybody else experience this one?

 

I've implemented AppLovin on one of our old games. It's just showing an occasional interstitial ad when a new game button is hit, so what I have is the following at the top of main.lua:

 

local applovin = require("plugin.applovin")
local function adListener( event )
end
applovin.init( adListener, { sdkKey="xxxx" } ) -- obviously xxxx is our actual key really
Then, when the game ends:
 
applovin.load("interstitial")
And when a new game starts:
 
if(math.random(1, 2) == 1) then
	if(applovin.isLoaded("interstitial")) then
		applovin.show("interstitial", "center")
	end
end
This seems to work fine in that the adverts actually show, but some of the video ads play and then just give a black screen with a grey bar at the top, instead of closing. Nothing is clickable at this point but if I drag the top of the screen down to show the Android notifications bar, it's apparent that the grey bar that shows is exactly the same size as that. This leads me to believe it might have something to do wiht my use of the following right at the very beginning of the app?
 
display.setStatusBar(display.HiddenStatusBar)
native.setProperty("androidSystemUiVisibility", "immersiveSticky")
Do other people use these settings and AppLovin together? Or know of AppLovin doing this and perhaps a work-around?
 
Android 8 on a Samsung S8. The game doesn't use Composer so this can't be a scenes glitch. The only other plugin it uses is CoronaProvider.native.popup.social but this is triggered elsewhere and requires user-action which I'm not doing in my tests.


[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 23,955 posts
  • Corona Staff

What happens if you don't set immersiveSticky?

 

Rob


  • roaminggamer likes this

[TOPIC: post.html]
#3

richard11

[GLOBAL: userInfoPane.html]
richard11
  • Enthusiast

  • 62 posts
  • Corona SDK

Sorry for the late response Rob. Finally gotten around to testing this again!

 

Removing the immersiveSticky line didn't seem to help, but in testing I noticed that after the first interstitial displays, the Android navigation buttons didn't then hide themselves again, so I've reworked to re-set this again after an ad is closed and oddly, that seems to have done the trick!

 

Code is now as follows:

display.setStatusBar(display.HiddenStatusBar)

if(system.getInfo('platform') == 'android') then
	native.setProperty("androidSystemUiVisibility", "immersiveSticky")
end

-- Ad network
local applovin = require("plugin.applovin")
local function adListener( event )
	if(event.phase == "loaded") then  -- The ad was successfully loaded
		applovin.show("interstitial")
	elseif (event.phase == "hidden" or event.phase == "playbackEnded") then
		if(system.getInfo('platform') == 'android') then
			-- ImmersiveSticky seems to break when some ads are shown, so...
			native.setProperty("androidSystemUiVisibility", "immersiveSticky")
		end
	end
end
applovin.init( adListener, { sdkKey="[key]" } )

And I just call this each time I want an ad to display:

applovin.load("interstitial")

I'm thinking there might somehow be an issue where the plugin causes immersiveSticky to be reversed and this in turn somehow causes the HiddenStatusBar setting to break, but re-instating immersiveSticky then somehow causes HiddenStatusBar to not break?

 

I'm not really sure. Getting somewhat confused after playing with this for a few hours, but the above code either works properly or reduces the likelihood of the original problem occurring enough that it's now stopped happening for me...


  • agramonte likes this


[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: applovin, bug