I guess there’s no way the app stays expanded on the page load. That can be treated as a feature request. But like you tried, app.activated() will not expand the app rendering page but instead just invokes the execution context when the user clicks and expands the app in the ticket side bar.
@SwethaGanesh,
As @Saif said, Currently it is not possible, but this needs to be requested to the product since the Product owns when the app opens and closes.