노티플라이 iOS SDK와는 별개로, 앱에서 직접 유저 알림 수신 동의를 구현해야 합니다.
다음 코드는 예시입니다. 실제 알림 요청 타이밍, UI, 문구 등은 앱의 특성에 맞게 구현해 주세요.
복사
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { granted, error in if let error = error { print("Failed to request authorization: \(error)") return } else { guard granted else { print("Notification permission denied") return } DispatchQueue.main.async { UIApplication.shared.registerForRemoteNotifications() } }}
Flutter 푸시 알림 사전 동의노티플라이 Flutter Plugin도 자체적으로 권한을 요청하지 않습니다.FirebaseMessaging의 requestPermission() API를 사용해 직접 권한 요청을 구현해야 합니다.👉 FlutterFire Messaging requestPermission