Add application foreground and background status JSB support.