Skip to content

Commit

Permalink
Android: Fix for native exit
Browse files Browse the repository at this point in the history
  • Loading branch information
scottrules44 committed Jan 8, 2023
1 parent 356e52f commit 888039c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Binary file modified plugins/2019.3497/android/plugin.unityads.v4.jar
Binary file not shown.
15 changes: 15 additions & 0 deletions src/Corona/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,16 @@ local loadRewardedButton = widget.newButton {
end
}

local exitButton = widget.newButton {
label = "Exit",
width = 100,
height = 40,
labelColor = { default={ 0, 0, 0 }, over={ 0.7, 0.7, 0.7 } },
onRelease = function(event)
native.requestExit()
end
}

vReady = display.newCircle(10, 10, 6)
vReady.strokeWidth = 2
vReady:setStrokeColor(0)
Expand Down Expand Up @@ -226,6 +236,11 @@ local layoutDisplayObjects = function(orientation)

loadRewardedButton.x = display.contentCenterX-40
loadRewardedButton.y = showRewardedButton.y


exitButton.x = display.contentCenterX
exitButton.y = showRewardedButton.y+40

end

-- initial layout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ public void onExiting(CoronaRuntime runtime) {
CoronaLua.deleteRef(runtime.getLuaState(), coronaListener);
coronaListener = CoronaLua.REFNIL;
coronaRuntimeTaskDispatcher = null;
fInitSuccess = false;
fInitStarted = false;

}

Expand Down Expand Up @@ -305,7 +307,6 @@ public int invoke(final LuaState luaState) {
return 0;
}
fInitStarted = true;

// set function signature for error / warning messages
functionSignature = "unityads.init(listener, options)";

Expand Down

0 comments on commit 888039c

Please sign in to comment.