cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Memorable Member
Memorable Member

How to run PowerApps in the background?

Hello,

I'm building an app that will track my walks and such. Unfortunately, when my phone goes to sleep, PowerApps is closed, home button pushed, phone turned off, etc... my GPS tracking ends.

What are some strategies for handling this?

We need a trigger built into the application that can see a "sleep/close" of the application so that we can SaveData/LoadData.

Example:

  • Start Timer
  • If App.Sleep, SaveData()
  • If App.Wake, LoadData()

Any other ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
Power Apps
Power Apps

Hi @seadude,

This is an interesting idea and would be useful for scenarios where other actions could continue if the mobile were in sleep mode.

 

I gave it some thought and I don't think you could detect an event like the phone going to sleep.

 

Here's some of my thoughts:

  • Use a repeating timer to and make it perform an action OnTimerEnd. Problem is how to detect if that action was not performed.

What I would recommend is to save periodically and have an indicator that shows when the last save was so the user can take action to save before the mobile goes to sleep.

View solution in original post

2 REPLIES 2
Power Apps
Power Apps

Hi @seadude,

This is an interesting idea and would be useful for scenarios where other actions could continue if the mobile were in sleep mode.

 

I gave it some thought and I don't think you could detect an event like the phone going to sleep.

 

Here's some of my thoughts:

  • Use a repeating timer to and make it perform an action OnTimerEnd. Problem is how to detect if that action was not performed.

What I would recommend is to save periodically and have an indicator that shows when the last save was so the user can take action to save before the mobile goes to sleep.

View solution in original post

Gotcha. I am using a repeating timer in this particular app. OnTimerEnd, Lat/Long (and a WHOLE bunch of other data) are written to Azure SQL. I'm still testing what happens when the screen goes to sleep/app is closed/home button is pressed/phone is turned off while the timer is running. It appears the writes to SQL just cease. This is the issue.

I really like your idea for showing a "last saved" label.

My iPhone has many signals that show when its is locked/asleep/etc.

For anyone interested in looking at the data their iPhone is capturing:

  • Click Settings
  • Click Privacy
  • Scroll to bottom, click Analytics
  • Click Analytics Data
  • Peruse these logs! Very interesting!

There are parameters like "ScreenIsLocked", "TimeSinceLastLock", "DeviceIsPowered" etc that would be HUGELY beneficial for us to be able to tap with PowerApps. 

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (6,156)