tailieunhanh - iOS App Programming Guide phần 6

Tất cả bạn phải làm là ghi đè lên các phương pháp trong các đối tượng thích hợp để xử lý những sự kiện. Đối với điều khiển, UIKit đơn giản hoá hơn nữa bằng cách xử lý các sự kiện liên lạc cho bạn và gọi mã tùy chỉnh của bạn chỉ | CHAPTER 3 App States and Multitasking To configure a VoIP app you must do the following 1. Add the UIBackgroundModes key to your app s file. Set the value of this key to an array that includes the voip value. 2. Configure one of the app s sockets for VoIP usage. 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. 4. Configure your audio session to handle transitions to and from active use. Including the voip value in the UIBackgroundModes key lets the system know that it should allow the app to run in the background as needed to manage its network sockets. An app with this key is also relaunched in the background immediately after system boot to ensure that the VoIP services are always available. Most VoIP apps also need to be configured as background audio apps to deliver audio while in the background. Therefore you should include both the audio and voip values to the UIBackgroundModes key. If you do not do this your app cannot play audio while it is in the background. For more information about the UIBackgroundModes key see Information Property List Key Reference. For specific information about the steps you must take to implement a VoIP app see Tips for Developing a VoIP App page 95 . Downloading Newsstand Content in the Background A Newsstand app that downloads new magazine or newspaper issues can register to perform those downloads in the background. When your server sends a push notification to indicate that a new issue is available the system checks to see whether your app has the UIBackgroundModes key with the newsstand-content value. If it does the system launches yourapp if it is notalready running so that it can initiate the downloading of the new issue. When you use the Newsstand Kit framework to initiate a download the system handles the download process for your app. The system continues to download

crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.