Jump to content
PortSIP PBX for Unified Communications
Lehel Medves

Does keeping the VoIP client awake work?

Recommended Posts

Hello,

I'm using the startKeepAwake and stopKeepAwake methods to keep the iOS application open for calls when in the background. It does work, however I do get the following warning after 30 seconds:

[BackgroundTask] Background Task 2 ("Called by TestVoIPApp, from _ZN7PortSIP20PortDialogSetFactoryD0Ev"), was created over 30 seconds ago. In applications running in the background, this creates a risk of termination. Remember to call UIApplication.endBackgroundTask(_:) for your task in a timely manner to avoid this.


Has anyone run into this problem before?

Thanks and regards,
Lehel

Share this post


Link to post
Share on other sites
13 hours ago, Lehel Medves said:

Hello,

I'm using the startKeepAwake and stopKeepAwake methods to keep the iOS application open for calls when in the background. It does work, however I do get the following warning after 30 seconds:

[BackgroundTask] Background Task 2 ("Called by TestVoIPApp, from _ZN7PortSIP20PortDialogSetFactoryD0Ev"), was created over 30 seconds ago. In applications running in the background, this creates a risk of termination. Remember to call UIApplication.endBackgroundTask(_:) for your task in a timely manner to avoid this.


Has anyone run into this problem before?

Thanks and regards,
Lehel

Suggest you use the push notifications: https://www.portsip.com/knowledge-base/how-do-push-notifications-work-with-portsip-pbx/

Usually the iOS/Android limited the app running in background.

Share this post


Link to post
Share on other sites

Thank you for your quick input! I am planning on using VoIP pushes as well of course, because I need them anyhow for cases when the application is not even in the background, but I was just wondering if this background mode (keeping alive the registration, which is very nice) is generating the warning shown above - the problem is, that if the background task is not ended, the application will be flagged az a bad citizen by the iOS and most probably not woken up after a time anymore to perform background tasks.

Share this post


Link to post
Share on other sites

This method is effective, but it is not reliable. Keeping the background by playing silent sound files will increase the battery consumption of the APP. And when the sound device is occupied by other apps, APP will can't  keep awake.
Therefore, the best way is to use PUSH

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...