응용 프로그램이 항상 ios에서 실행되지 않습니다. 푸시 알림에서 도움을 받아야합니다. 하나의 소켓을 사용한다고 할지라도 미리 정의 된 시간 이상 실행될 것이라고 생각하지 않습니다. 모든 VoIP 앱은 푸시 알림을받습니다.
Refer this link
Declaring Your App’s Supported Background Tasks
Support for some types of background execution must be declared in advance by the app that uses them. An app declares support for a service using its Info.plist file. Add the UIBackgroundModes key to your Info.plist file and set its value to an array containing one or more of the following strings:
- audio—The app plays audible content to the user while in the
background. (This content includes streaming audio or video content
using AirPlay.)
- location—The app keeps users informed of their location, even while
it is running in the background.
- voip—The app provides the ability for the user to make phone calls
using an Internet connection.
- newsstand-content—The app is a Newsstand app that downloads and
processes magazine or newspaper content in the background.
- external-accessory—The app works with a hardware accessory that needs
to deliver updates on a regular schedule through the External
Accessory framework.
- bluetooth-central—The app works with a Bluetooth accessory that needs
to deliver updates on a regular schedule through the Core Bluetooth
framework.
- bluetooth-peripheral—The app supports Bluetooth communication in
peripheral mode through the Core Bluetooth framework.
Each of the preceding values lets the system know that your app should be woken up at appropriate times to respond to relevant events. For example, an app that begins playing music and then moves to the background still needs execution time to fill the audio output buffers. Including the audio key tells the system frameworks that they should continue playing and make the necessary callbacks to the app at appropriate intervals. If the app does not include this key, any audio being played by the app stops when the app moves to the background.
참고 : 수신기가 알림을 밀어 응답하는 경우 하나의 MSG를 보내 무효 응용 프로그램의 대부분 사용자처럼 작동 서버가 수신기 푸시 알림을 보냅니다, MSG가 처리됩니다. 트위스트는 사용자가 푸시 알림에 응답하지 않을 때 발생합니다. 앱이 시작되면 처리됩니다. 사용자 앱은 모든 서버에 대해 서버를 쿼리하고 그 메시지를 앱 인터페이스에 표시합니다. 희망이 논리는 당신을 도와줍니다.
시간 내 주셔서 감사합니다. 푸시 알림을 확인합니다 ... 한 가지 더 궁금한 점이 있습니다 ...이 API setKeepAliveTimeout이 도움이 될까요? 600 초마다 다시 시작하고 사용할 수 있습니까? – Newbee
-setKeepAliveTimeout : handler :를 호출하면 모든 작업을 완료하고 일시 중단하는 데 최대 30 초 밖에 걸리지 않습니다. 응용 프로그램을 처음 백그라운드로 전환 할 때 부여되는 것과 동일한 백그라운드 유예 기간이 주어지지 않습니다. 그것은 장기간에 걸친 작업을 마무리하기위한 것입니다. – DivineDesert
짧은 말로하면 도움이되지 않습니다 – DivineDesert