CRITICAL : IOS , Can we determine if the app is front most or not , whats the ruby command for this

Ruby lib 5.0.1
current activity , to recognise wether app is front most or not wouldnt reveal wether the app is front most or not.
seems like Java version works but not ruby, can this be fixed.