删除非必要代码

This commit is contained in:
zeng 2025-04-27 16:43:01 +08:00
parent 17068cb7e4
commit 24b57a88f6
3 changed files with 0 additions and 93 deletions

View File

@ -1,70 +0,0 @@
//
// SPLoginManager+Apple.swift
// MoviaBox
//
// Created by on 2025/4/25.
//
import UIKit
import AuthenticationServices
extension SPLoginManager {
///
func appleSignLogin(completer: ((_ model: SPThirdSignModel?) -> Void)?) {
// self.signAppleHandle = completer
let appleIDProvider = ASAuthorizationAppleIDProvider()
let request = appleIDProvider.createRequest()
request.requestedScopes = [.fullName, .email]
let authorizationController = ASAuthorizationController(authorizationRequests: [request])
authorizationController.delegate = self
authorizationController.presentationContextProvider = self
authorizationController.performRequests()
}
}
//MARK:-------------- ASAuthorizationControllerDelegate --------------
extension SPLoginManager: ASAuthorizationControllerDelegate {
func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) {
if let appleIDCredential = authorization.credential as? ASAuthorizationAppleIDCredential {
let userIdentifier = appleIDCredential.user
let fullName = appleIDCredential.fullName
let email = appleIDCredential.email
let model = SPThirdSignModel()
model.userID = userIdentifier
model.givenName = fullName?.givenName
model.familyName = fullName?.familyName
model.name = fullName?.nickname
model.email = email
spLog(message: userIdentifier)
spLog(message: fullName)
spLog(message: email)
// if let signAppleHandle = signAppleHandle {
// signAppleHandle(model)
// }
}
}
func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) {
// if let signAppleHandle = signAppleHandle {
// signAppleHandle(nil)
// }
}
}
extension SPLoginManager: ASAuthorizationControllerPresentationContextProviding {
func presentationAnchor(for controller: ASAuthorizationController) -> ASPresentationAnchor {
return SPAPPTool.getKeyWindow()!
}
}

View File

@ -1,15 +0,0 @@
//
// SPLoginManager+Facebook.swift
// MoviaBox
//
// Created by on 2025/4/25.
//
import UIKit
//https://developers.facebook.com/docs/facebook-login/ios?checkpoint_src=any
extension SPLoginManager {
}

View File

@ -36,14 +36,6 @@ class SPLoginManager: NSObject {
/// ///
func thirdLogin(type: LoginType, presentingViewController: UIViewController) { func thirdLogin(type: LoginType, presentingViewController: UIViewController) {
switch type {
case .apple:
appleSignLogin { model in
}
default:
break
}
} }