Firebasae coding


Hi i want help for coding . i m trying but not success.
i need this type of coding
my apk ready is ready but i need some security in my apk . i am making One group apk for earning .
( i am putting banners and inter ads different member my 1st screen . but i need other coding to control firebase . when 1 - 2 members not working than i off 1-2 banner ads by firebase . ) any one can u help me this coding please help