I have struggled once with this … below is a working code … I’m sure it can be much better but at least this is working for me. you can copy paste directly to main.lua to see the results and you can try on simulator with different devices or compile and test on different real devices
Please note that i have anchored the top text Y to 0 and the bottom to 1
@XeduR once posted something much better
topInset, leftInset, bottomInset, rightInset = display.getSafeAreaInsets()
local topArea = display.screenOriginY + topInset
local bottomArea = display.contentHeight - ( topArea + bottomInset )
local topText = display.newText( "Top Text", display.contentCenterX,topArea, native.systemFont, 20 )
topText:setFillColor(1)
topText.anchorY=0
local bottomText = display.newText( "Bottom Text", display.contentCenterX,bottomArea, native.systemFont, 20 )
bottomText:setFillColor(1)
bottomText.anchorY=1