Get foreground app

Hi to all, is possible to get the name of the foreground app? For example, ionic can detect if I open Netflix (or, WhatsApp, facebook, ecc…)