У меня есть приложение Voip, но она не будет просыпаться из режима ожидания при поступлении вызова в Документах сказать следующее:.Есть ли новые требования для приложения voip в ios 8?
There are several requirements for implementing a VoIP app:
1. Enable the Voice over IP background mode for your app. (Because VoIP
apps involve audio content, it is recommended that you also enable
the Audio and AirPlay background mode.) You enable background modes
in the Capabilities tab of your Xcode project.
// I did this using the "capabilities" tab in the project's settings.
// I have "audio and airplay", "voice over ip",
// "background fetch" and "remote notifications" checked.
2. Configure one of the app’s sockets for VoIP usage.
// I have 2 sockets, one for sending stuff to the server that closes after sending.
// One socket that stays alive all the time, which is used to
// receive stuff from the server.
// The one that stays alive is configured as voip*.
3. Before moving to the background, call the
setKeepAliveTimeout:handler: method to install a handler to be
executed periodically. Your app can use this handler to maintain its
service connection.
// I did this and in the handler I send a login message to the server,
// On the server side it's detected that the account is already logged in so
// it refreshes the connection instead.
4. Configure your audio session to handle transitions to and from active use.
// I did not do this yet, I might in the future.
5. To ensure a better user experience on iPhone, use the Core Telephony
framework to adjust your behavior in relation to cell-based phone
calls; see Core Telephony Framework Reference.
// I did not do this and probably never will (company's decision, not mine).
6. To ensure good performance for your VoIP app, use the System
Configuration framework to detect network changes and allow your app
to sleep as much as possible.
// I don't do this yet, but will implement it once all the basics run fine.
Когда поступает вызов создать локальное уведомление, чтобы позволить пользователь знает о вызове. Когда приложение сведено к минимуму, это работает нормально, но когда устройство находится в режиме ожидания (сна), уведомления нет. Когда я разбужу устройство в режиме ожидания, уведомление появляется через несколько секунд (так что его еще нет, оно действительно появляется после пробуждения устройства).
В прошлом я создал больше приложений voip, и я не помню, чтобы когда-либо возникали проблемы с этим. Теперь я запускаю ios 8, возможно, мне нужно сделать еще немного, чтобы заставить его работать в режиме ожидания? Есть ли больше требований для voip сейчас? Или мне не хватает чего-то глупого?
Примечание: Я знаю о push-уведомлениях. Они являются опцией (на самом деле, я уже тестировал, и они заставляют ее работать), но я предпочел бы не зависеть от apns.
Ваш порт управления VoIP должен быть TCP, а не UDP. Если вы отмечаете UDP-сокет при включенном VoIP, то именно поэтому вы не получаете данные на нем, когда приложение приостановлено. См. Http://stackoverflow.com/a/7393083/624920 –