私のアプリケーション用のFirebaseを通じてプッシュ通知を設定しようとしています。 didFinishLaunchingOptions下AppDelegateでSwift 3:引数ラベル 'forTypes :, categories :)が使用可能なオーバーロードと一致しません
3が、私はこの行のエラーに実行していますスウィフト:
引数ラベル '(forTypes :, :)カテゴリ' 使用可能な任意の過負荷を一致していない
let notificationSettings = UIUserNotificationSettings(forTypes: notificationTypes, categories: nil)
コード:
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
FIRApp.configure()
FIRDatabase.database().persistenceEnabled = true
SKCache.sharedCache.imageCache = CustomImageCache()
let notificationTypes : UIUserNotificationType = [UIUserNotificationType.alert, UIUserNotificationType.badge, UIUserNotificationType.sound]
let notificationSettings = UIUserNotificationSettings(forTypes: notificationTypes, categories: nil)
application.registerForRemoteNotifications()
application.registerUserNotificationSettings(notificationSettings)
ありがとう!
作品完全に次の行を使用してコード
の次の行を置き換える必要がありlate.Butされる可能性があります。ありがとうございました! – Miles