Monday, October 12, 2026
HomeiOS Developmentios - .ephemeral says that dont exist in UNauthoritazionStatus

ios – .ephemeral says that dont exist in UNauthoritazionStatus

[ad_1]

When i attempt to constructed my app coming from PWABuilder in Xcode in IOS it says Kind ‘UNAuthorizationStatus’ has no member ‘ephemeral’I’ve checked Apple Information and it says it exist. Im not an knowledgeable in IOS so i am form of misplaced proper now

func handlePushPermission() {
    UNUserNotificationCenter.present().getNotificationSettings () { settings in
            change settings.authorizationStatus {
            case .notDetermined:
                let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
                UNUserNotificationCenter.present().requestAuthorization(
                    choices: authOptions,
                    completionHandler: { (success, error) in
                        if error == nil {
                            if success == true {
                                returnPermissionResult(isGranted: true)
                                DispatchQueue.fundamental.async {
                                  UIApplication.shared.registerForRemoteNotifications()
                                }
                            }
                            else {
                                returnPermissionResult(isGranted: false)
                            }
                        }
                        else {
                            returnPermissionResult(isGranted: false)
                        }
                    }
                )
            case .denied:
                returnPermissionResult(isGranted: false)
//Error 1
            case .licensed, .ephemeral, .provisional:
                returnPermissionResult(isGranted: true)
            @unknown default:
                return;
            }
        }
}
func handlePushState() {
    UNUserNotificationCenter.present().getNotificationSettings () { settings in
        change settings.authorizationStatus {
        case .notDetermined:
            returnPermissionState(state: "notDetermined")
        case .denied:
            returnPermissionState(state: "denied")
        case .licensed:
            returnPermissionState(state: "licensed")
//Error 2
        case .ephemeral:
            returnPermissionState(state: "ephemeral")
        case .provisional:
            returnPermissionState(state: "provisional")
        @unknown default:
            returnPermissionState(state: "unknown")
            return;
        }
    }
}

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments