超初心者です。
前提・実現したいこと
Firebaseの設定が最後、以下の画面から進みません。
アプリがサーバーと通信したかどうかを確認中です。場合によってはアプリのアンインストールと再インストールが必要です。
バンドルID、doodle.info、pod fileも作りましたし、初期コードなども手順に従い、追加しました。
AppDelegate.swift
swift
1import UIKit 2import CoreData 3import Firebase 4 5 6@UIApplicationMain 7class AppDelegate: UIResponder, UIApplicationDelegate { 8 9 var window: UIWindow? 10 11 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 12 FirebaseApp.configure() 13 return true 14 } 15 16 // MARK: UISceneSession Lifecycle 17 18 func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 19 // Called when a new scene session is being created. 20 // Use this method to select a configuration to create the new scene with. 21 return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 22 } 23 24 func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { 25 // Called when the user discards a scene session. 26 // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 27 // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 28 } 29 30 // MARK: - Core Data stack 31 32 lazy var persistentContainer: NSPersistentContainer = { 33 /* 34 The persistent container for the application. This implementation 35 creates and returns a container, having loaded the store for the 36 application to it. This property is optional since there are legitimate 37 error conditions that could cause the creation of the store to fail. 38 */ 39 let container = NSPersistentContainer(name: "jfcle") 40 container.loadPersistentStores(completionHandler: { (storeDescription, error) in 41 if let error = error as NSError? { 42 // Replace this implementation with code to handle the error appropriately. 43 // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 44 45 /* 46 Typical reasons for an error here include: 47 * The parent directory does not exist, cannot be created, or disallows writing. 48 * The persistent store is not accessible, due to permissions or data protection when the device is locked. 49 * The device is out of space. 50 * The store could not be migrated to the current model version. 51 Check the error message to determine what the actual problem was. 52 */ 53 fatalError("Unresolved error (error), (error.userInfo)") 54 } 55 }) 56 return container 57 }() 58 59 // MARK: - Core Data Saving support 60 61 func saveContext () { 62 let context = persistentContainer.viewContext 63 if context.hasChanges { 64 do { 65 try context.save() 66 } catch { 67 // Replace this implementation with code to handle the error appropriately. 68 // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 69 let nserror = error as NSError 70 fatalError("Unresolved error (nserror), (nserror.userInfo)") 71 } 72 } 73 } 74 75} 76 77
Podfile
Podfile
1 Uncomment the next line to define a global platform for your project 2# platform :ios, '9.0' 3 4target 'jfcle' do 5 # Comment the next line if you don't want to use dynamic frameworks 6 use_frameworks! 7 8 # Pods for jfcle 9 # add the Firebase pod for Google Analytics 10 pod 'Firebase/Analytics' 11 # add pods for any other desired Firebase products 12 pod 'DTGradientButton' 13 pod 'Firebase/Core' 14 pod 'Firebase/Firestore' 15 pod 'Firebase/Storage' 16 pod 'Firebase/Auth' 17 pod 'FirebaseDatabase' 18 # https://firebase.google.com/docs/ios/setup#available-pods 19 20end 21
解決方法を教えていただきたいです。よろしくお願い致します。
回答2件
あなたの回答
tips
プレビュー