I don't think you could actually use this function from services, because they don't have a reference to the app.  It's more for testing or REPL development.