Home How much runtime does an app get when it receives a Pushkit Voip Push?
Reply: 2

How much runtime does an app get when it receives a Pushkit Voip Push?

Gruntcakes
1#
Gruntcakes Published in 2018-01-13 03:28:12Z

If an app is in the background or terminated and it receives a voip push then the OS will launch it and run it.

The documentation says:

"Your app is given runtime to process a push, even if your app is operating in the background."

Does anybody know how long this runtime is and if the app can find out how long there is remaining?

If an an app is in the foreground and moves to the background, then if it uses beginBackgroundTask() etc. it can get 30 seconds of execution time.

I've conducted experiments and found that if a silent push is delivered to the app when it is already in the background then the app can also use beginBackgroundTask() in that situation and it also get 30s seconds in which to execute and do something when it receives the push (and it can use UIApplication.shared.backgroundTimeRemaining to see how much time there is remaining.)

BUT if a Voip push is delivered instead of a silent push then beginBackgroundTask() functionality does not work (and of course therefore UIApplication.shared.backgroundTimeRemaining cannot be used to determine remaining execution time), however the app can run in the background and perform some activity (which is what the documentation quoted above says it can do).

So to repeat the question - is it documented by Apple how much time it does get to run when it receives the Voip push? Can the app find out how much time there is remaining? Or get some waring that execution time is about to expire?

iMHitesh
2#
iMHitesh Reply to 2018-01-18 06:36:37Z

is it documented by Apple how much time it does get to run when it receives the Voip push?

No, There is no official documents available about how much time you have got, When received VoIP Push notification.

As per my personal experience, You will extends time up to 45 Sec using long duration sound file if if needed.

Can the app find out how much time there is remaining? Or get some Waring that execution time is about to expire?

No, There is no official documents or do not available any delegate method to find how much time remaining.

I have faced same issue, I was overcome above issue using multiple VoIP Push with different parameters. You can achieved it as below.

As per my requirement, I have to display notification when user received new incoming call. If user not picked up call then i have to give new notification for missed call. I was achieved it as below.

1) Generate local notification when received first VoIP Push.

2) Cancel already generated notification and generate new missed call notification for user. I am not sure, but you can also use timer if working.

HereTrix
3#
HereTrix Reply to 2018-01-17 12:13:14Z

1) is it documented by Apple how much time it does get to run when it receives the Voip push?

No, Apple doesn't have this information in documentation

2) Can the app find out how much time there is remaining?

No. When app launched it assumed as executed in Background mode. You will have about 30s for perform necessary tasks.

3) Or get some waring that execution time is about to expire?

No. At least there is no docummented way to do this.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.333616 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO