-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IOS10 voipEnabled = true not work #309
Comments
Confirm, iOS 9 devices receive data normally, but iOS10 data receiving paused after going background. There is any temporary workaround for this? |
Fix it by launch background task in |
I don't think @alphatroya suggestion works, does it? |
FYI, using VOiP Background mode to keep the websocket connection alive goes against Apple TOS/Guidelines. It is a misuse of background modes, which is grounds for rejection from the AppStore. |
Yeah I don't know why iOS 9 -> 10 caused this to stop working. That being said, @Laptopmini is right in general use cases. This was added for a very specific case of in house apps and someone using a WebSocket in a VOIP setup. I will try looking into this as time permits and PRs are welcomed. |
I've recently had an in-depth conversation with Apple DTS on this. Simply, you have to use PushKit/APNS. The "Legacy VOIP API" as they call it (which would hand the socket over to the system to wake up your app if communication arrived) was deprecated in iOS 9 and removed in iOS 10. As such, there's no way to keep a socket connected while in the background and that flag no longer has any effect as OP described. You can buy yourself ~3 min by launching a background task on @daltoniam nothing to look into I'm afraid, you should plan to pull the functionality. |
@nitrag nice write up and thank you for that info! I'll do that next version (and update the documentation accordingly). |
If the app is woken up by the push notification, the socket will be closed after around 40 seconds with this error |
* 'master' of github.com:daltoniam/Starscream: (22 commits) updated podspec the joys of getting all the package manager to play nice Removed Else Clause that would sometimes give a wrong error message updated changelog updated pod spec for compression changes SecTrust object now is conditionally unwrapped spm fix spm fix package manager update fixes daltoniam#309, daltoniam#319, daltoniam#334 make WSResponse values public Add Advanced Delegate and Custom HTTP methods Update README with (trite) grammar changes Include zlib as a module, rather than using `@_silgen_name` and redefinition. This is less verbose and less error-prone. Add information about compression support to README. Other changes based on PR feedback. Avoid unnecessary copying. Confirm Autobahn fuzzing test results are comparable with the autobahn library itself. Fix capture memory leaks in Autobahn tester. Fixes to handle different windowsBits and noContextTakeover. Integrate compression classes. Add compression classes and unit tests. ...
Hi @daltoniam one scenario I discovered is that
Not sure if 4. is expected or not, can you please advise? Thanks. |
when my app enter background , the socket connection is paused, after the app enter foreground again, the request data arrive together.
UIBackgroundModes
voip
audio
fetch
remote-notification
The text was updated successfully, but these errors were encountered: