Showing results for 
Search instead for 
Did you mean: 
New Member

OnStart event not firing on mobile apps

I have an app that has a few variables being set in the OnStart for the app. When I launch the app in desktop web browser, it behaves fine, the variables in OnStart are set properly and everything works. When I launch the app from my mobile phone, the OnStart event only fires the very first time the app is started. If you make changes and publish a new version with additional code in the OnStart event, it never executes. Am I doing something wrong here or is this a bug?

I made a simple test app and it is completely repeatable. The test app is simple, two labels and a timer The App OnStart event contains a few lines to set two variables. The top label text is just set to myTestVariable, the second label bit of code to calculate the text. I've attached screenshots of relevant bits from this app, but can also share an msapp file if that would be helpful.

When you run it on the desktop, everything displays fine. Running it on a mobile browser, the very first time it works, but if I change the OnStart code to a different date for either variable, and publish, the new value will not get used. The mobile version will say "there is a new version of the app, please update" when I launch it, but when I start the app, the OnStart code doesn't fire, but any UI changes I make will actually be there proving that it did update the app itself.

Frequent Visitor

So even if you completely restarts the app on mobile, it does not work? As a workaround, can you move the initialization part to the first screen, using the "OnVisible" event?

Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,194)