# การแจ้งเตือนแบบ Push (iOS) > APNs, UNUserNotificationCenter, การแจ้งเตือนระยะไกล, การแจ้งเตือนภายในเครื่อง, เนื้อหาแบบ rich - 18 คำถามสัมภาษณ์ - Mid-Level - [คำถามสัมภาษณ์: iOS](https://sharpskill.dev/th/technologies/ios/interview-questions.md) ## 1. UNUserNotificationCenter คืออะไร? **คำตอบ** UNUserNotificationCenter เป็นคลาสหลักสำหรับจัดการการแจ้งเตือนทั้งแบบภายในเครื่องและระยะไกลทั้งหมดบน iOS 10+ โดยมาแทนที่ API UILocalNotification ที่เลิกใช้แล้ว และมอบอินเทอร์เฟซแบบรวมศูนย์สำหรับการขอสิทธิ์ การกำหนดเวลาการแจ้งเตือน และการจัดการการโต้ตอบของผู้ใช้ การใช้ UNUserNotificationCenter เป็นสิ่งจำเป็นสำหรับการนำกลยุทธ์การแจ้งเตือนที่ทันสมัยและเข้ากันได้มาใช้ ## 2. การอนุญาตการแจ้งเตือนสองประเภทที่มีให้ใช้เมื่อร้องขอครั้งแรกคืออะไร? **คำตอบ** iOS มีโหมดการอนุญาตสองแบบ: การอนุญาตชั่วคราว (provisional) ช่วยให้ส่งการแจ้งเตือนไปยังประวัติการแจ้งเตือนได้โดยตรงโดยไม่แสดงการแจ้งเตือน ในขณะที่การอนุญาตเต็มรูปแบบ (full) จะเรียกใช้คำขอสิทธิ์อย่างชัดเจน การใช้การอนุญาตชั่วคราวมีประโยชน์สำหรับการทดสอบการมีส่วนร่วมก่อนที่จะขอสิทธิ์ที่รบกวน ตัวเลือกขึ้นอยู่กับกลยุทธ์ของแอปพลิเคชัน ## 3. ความแตกต่างหลักระหว่างการแจ้งเตือนภายในเครื่องและการแจ้งเตือนระยะไกลคืออะไร? **คำตอบ** การแจ้งเตือนภายในเครื่องถูกกำหนดเวลาโดยแอปพลิเคชันเองและส่งโดยระบบภายในเครื่อง ในขณะที่การแจ้งเตือนระยะไกล (push) ถูกส่งโดยเซิร์ฟเวอร์ผ่าน APNs และขึ้นอยู่กับการเชื่อมต่อเครือข่าย การแจ้งเตือนภายในเครื่องทำงานได้เสมอแม้ไม่มีการเชื่อมต่อ ใช้การแจ้งเตือนภายในเครื่องสำหรับการเตือนภายในและการแจ้งเตือนระยะไกลสำหรับการสื่อสารระหว่างเซิร์ฟเวอร์กับไคลเอนต์ ## มีอีก 15 คำถาม - จะลงทะเบียนแอปพลิเคชันเพื่อรับการแจ้งเตือนระยะไกลจาก APNs ได้อย่างไร? - ส่วนประกอบหลักของ UNNotificationContent คืออะไร? สมัครฟรี: https://sharpskill.dev/th/login ## หัวข้อสัมภาษณ์ iOS อื่นๆ - [พื้นฐาน Swift](https://sharpskill.dev/th/technologies/ios/interview-questions/swift-basics.md): 25 คำถาม, Junior - [พื้นฐานภาษา Swift](https://sharpskill.dev/th/technologies/ios/interview-questions/swift-language-essentials.md): 15 คำถาม, Junior - [พื้นฐาน UIKit](https://sharpskill.dev/th/technologies/ios/interview-questions/uikit-fundamentals.md): 18 คำถาม, Junior - [วงจรชีวิตของ UIViewController](https://sharpskill.dev/th/technologies/ios/interview-questions/uiviewcontroller-lifecycle.md): 20 คำถาม, Junior - [UserDefaults & Keychain](https://sharpskill.dev/th/technologies/ios/interview-questions/userdefaults-keychain.md): 20 คำถาม, Junior - [วงจรชีวิตของแอปพลิเคชัน](https://sharpskill.dev/th/technologies/ios/interview-questions/app-lifecycle.md): 20 คำถาม, Junior - [Auto Layout & Constraints](https://sharpskill.dev/th/technologies/ios/interview-questions/auto-layout-constraints.md): 24 คำถาม, Mid-Level - [UITableView & UICollectionView](https://sharpskill.dev/th/technologies/ios/interview-questions/uitableview-uicollectionview.md): 25 คำถาม, Mid-Level - [พื้นฐาน SwiftUI](https://sharpskill.dev/th/technologies/ios/interview-questions/swiftui-basics.md): 18 คำถาม, Mid-Level - [การจัดการ State ใน SwiftUI](https://sharpskill.dev/th/technologies/ios/interview-questions/swiftui-state-management.md): 22 คำถาม, Mid-Level - [การนำทาง SwiftUI](https://sharpskill.dev/th/technologies/ios/interview-questions/swiftui-navigation.md): 18 คำถาม, Mid-Level - [Networking & URLSession](https://sharpskill.dev/th/technologies/ios/interview-questions/networking-urlsession.md): 20 คำถาม, Mid-Level - [Codable และการแยกวิเคราะห์ JSON](https://sharpskill.dev/th/technologies/ios/interview-questions/codable-json-parsing.md): 20 คำถาม, Mid-Level - [Core Data](https://sharpskill.dev/th/technologies/ios/interview-questions/core-data.md): 22 คำถาม, Mid-Level - [การเขียนโปรแกรมเชิงโปรโตคอล](https://sharpskill.dev/th/technologies/ios/interview-questions/protocol-oriented-programming.md): 20 คำถาม, Mid-Level - [สถาปัตยกรรม MVVM](https://sharpskill.dev/th/technologies/ios/interview-questions/mvvm-architecture.md): 20 คำถาม, Mid-Level - [Unit Testing และ XCTest](https://sharpskill.dev/th/technologies/ios/interview-questions/unit-testing-xctest.md): 20 คำถาม, Mid-Level - [การทดสอบ UI](https://sharpskill.dev/th/technologies/ios/interview-questions/ui-testing.md): 18 คำถาม, Mid-Level - [Xcode และระบบ Build](https://sharpskill.dev/th/technologies/ios/interview-questions/xcode-build-system.md): 16 คำถาม, Mid-Level - [Swift Package Manager](https://sharpskill.dev/th/technologies/ios/interview-questions/swift-package-manager.md): 16 คำถาม, Mid-Level - [Memory Management & ARC](https://sharpskill.dev/th/technologies/ios/interview-questions/memory-management-arc.md): 22 คำถาม, Senior - [Combine Framework](https://sharpskill.dev/th/technologies/ios/interview-questions/combine-framework.md): 24 คำถาม, Senior - [Concurrency & async/await](https://sharpskill.dev/th/technologies/ios/interview-questions/concurrency-async-await.md): 26 คำถาม, Senior - [iOS Design Patterns](https://sharpskill.dev/th/technologies/ios/interview-questions/ios-design-patterns.md): 24 คำถาม, Senior - [การเพิ่มประสิทธิภาพ](https://sharpskill.dev/th/technologies/ios/interview-questions/performance-optimization.md): 22 คำถาม, Senior - [ความปลอดภัยและการเข้ารหัส](https://sharpskill.dev/th/technologies/ios/interview-questions/security-encryption.md): 20 คำถาม, Senior - [SwiftUI Advanced](https://sharpskill.dev/th/technologies/ios/interview-questions/swiftui-advanced.md): 22 คำถาม, Senior - [สถาปัตยกรรมแอปพลิเคชัน iOS](https://sharpskill.dev/th/technologies/ios/interview-questions/ios-app-architecture.md): 22 คำถาม, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/th/technologies/ios/interview-questions/push-notifications