From 64ed0c8fb22cdbabf267c87f0913a3eed895efc6 Mon Sep 17 00:00:00 2001 From: baegteun Date: Sun, 4 May 2025 19:18:05 +0900 Subject: [PATCH] Firebase init --- .gitignore | 4 + ONMIR.xcodeproj/project.pbxproj | 68 ++++++++++ .../xcshareddata/swiftpm/Package.resolved | 119 +++++++++++++++++- ONMIR/AppDelegate.swift | 58 +++++---- 4 files changed, 224 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index bf7aa47..4f5b62f 100644 --- a/.gitignore +++ b/.gitignore @@ -131,4 +131,8 @@ iOSInjectionProject/ /*.gcno **/xcshareddata/WorkspaceSettings.xcsettings +# Firebase +GoogleService-staging-Info.plist +GoogleService-release-Info.plist + # End of https://www.toptal.com/developers/gitignore/api/swift,xcode,macos diff --git a/ONMIR.xcodeproj/project.pbxproj b/ONMIR.xcodeproj/project.pbxproj index 06c85e5..af762d3 100644 --- a/ONMIR.xcodeproj/project.pbxproj +++ b/ONMIR.xcodeproj/project.pbxproj @@ -7,6 +7,10 @@ objects = { /* Begin PBXBuildFile section */ + 460F8D4C2DC77401003F019A /* FirebaseAnalytics in Frameworks */ = {isa = PBXBuildFile; productRef = 460F8D4B2DC77401003F019A /* FirebaseAnalytics */; }; + 460F8D4E2DC77401003F019A /* FirebaseCore in Frameworks */ = {isa = PBXBuildFile; productRef = 460F8D4D2DC77401003F019A /* FirebaseCore */; }; + 460F8D502DC77401003F019A /* FirebaseCrashlytics in Frameworks */ = {isa = PBXBuildFile; productRef = 460F8D4F2DC77401003F019A /* FirebaseCrashlytics */; }; + 460F8D522DC77402003F019A /* FirebaseRemoteConfig in Frameworks */ = {isa = PBXBuildFile; productRef = 460F8D512DC77402003F019A /* FirebaseRemoteConfig */; }; 46EE698D2DC10341001736D6 /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = 46EE698C2DC10341001736D6 /* SnapKit */; }; 46EE6A232DC196D9001736D6 /* Nuke in Frameworks */ = {isa = PBXBuildFile; productRef = 46EE6A222DC196D9001736D6 /* Nuke */; }; D0FD53152DB4DDC400F2593B /* .gitignore in Resources */ = {isa = PBXBuildFile; fileRef = D0FD53142DB4DDC400F2593B /* .gitignore */; }; @@ -41,6 +45,8 @@ isa = PBXFileSystemSynchronizedBuildFileExceptionSet; membershipExceptions = ( Info.plist, + "Support/Firebase/Production/GoogleService-release-Info.plist", + "Support/Firebase/Staging/GoogleService-staging-Info.plist", ); target = D011D3022DB4DAAB00412C5C /* ONMIR */; }; @@ -74,6 +80,10 @@ files = ( 46EE698D2DC10341001736D6 /* SnapKit in Frameworks */, 46EE6A232DC196D9001736D6 /* Nuke in Frameworks */, + 460F8D502DC77401003F019A /* FirebaseCrashlytics in Frameworks */, + 460F8D522DC77402003F019A /* FirebaseRemoteConfig in Frameworks */, + 460F8D4E2DC77401003F019A /* FirebaseCore in Frameworks */, + 460F8D4C2DC77401003F019A /* FirebaseAnalytics in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -124,6 +134,7 @@ buildPhases = ( D011D2FF2DB4DAAB00412C5C /* Sources */, D011D3002DB4DAAB00412C5C /* Frameworks */, + 460F8D5B2DC77850003F019A /* Firebase Info configure */, D011D3012DB4DAAB00412C5C /* Resources */, ); buildRules = ( @@ -137,6 +148,10 @@ packageProductDependencies = ( 46EE698C2DC10341001736D6 /* SnapKit */, 46EE6A222DC196D9001736D6 /* Nuke */, + 460F8D4B2DC77401003F019A /* FirebaseAnalytics */, + 460F8D4D2DC77401003F019A /* FirebaseCore */, + 460F8D4F2DC77401003F019A /* FirebaseCrashlytics */, + 460F8D512DC77402003F019A /* FirebaseRemoteConfig */, ); productName = ONMIR; productReference = D011D3032DB4DAAB00412C5C /* ONMIR.app */; @@ -223,6 +238,7 @@ packageReferences = ( 46EE698B2DC10341001736D6 /* XCRemoteSwiftPackageReference "SnapKit" */, 46EE6A212DC196D9001736D6 /* XCRemoteSwiftPackageReference "Nuke" */, + 460F8D4A2DC77401003F019A /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */, ); preferredProjectObjectVersion = 77; productRefGroup = D011D3042DB4DAAB00412C5C /* Products */; @@ -261,6 +277,28 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 460F8D5B2DC77850003F019A /* Firebase Info configure */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Firebase Info configure"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\nGOOGLESERVICE_INFO_STAGING=\"${PROJECT_DIR}/${TARGET_NAME}/Support/Firebase/Staging/GoogleService-staging-Info.plist\"\nGOOGLESERVICE_INFO_PROD=\"${PROJECT_DIR}/${TARGET_NAME}/Support/Firebase/Production/GoogleService-release-Info.plist\"\n\necho \"${PROJECT_DIR}\"\n\necho \"${CONFIGURATION}\"\nif [ \"${CONFIGURATION}\" == \"Debug\" ]; then\n cp \"${GOOGLESERVICE_INFO_STAGING}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist\"\nelif [ \"${CONFIGURATION}\" == \"Release\" ]; then\n cp \"${GOOGLESERVICE_INFO_PROD}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist\"\nelse\n echo \"Error: Invalid Build Configuration. Expected 'Debug' or 'Release'.\"\n exit 1\nfi\n\n"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ D011D2FF2DB4DAAB00412C5C /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -306,6 +344,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = ONMIR/Info.plist; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; @@ -333,6 +372,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = ONMIR/Info.plist; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; @@ -582,6 +622,14 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ + 460F8D4A2DC77401003F019A /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/firebase/firebase-ios-sdk.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 11.12.0; + }; + }; 46EE698B2DC10341001736D6 /* XCRemoteSwiftPackageReference "SnapKit" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/SnapKit/SnapKit.git"; @@ -601,6 +649,26 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ + 460F8D4B2DC77401003F019A /* FirebaseAnalytics */ = { + isa = XCSwiftPackageProductDependency; + package = 460F8D4A2DC77401003F019A /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; + productName = FirebaseAnalytics; + }; + 460F8D4D2DC77401003F019A /* FirebaseCore */ = { + isa = XCSwiftPackageProductDependency; + package = 460F8D4A2DC77401003F019A /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; + productName = FirebaseCore; + }; + 460F8D4F2DC77401003F019A /* FirebaseCrashlytics */ = { + isa = XCSwiftPackageProductDependency; + package = 460F8D4A2DC77401003F019A /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; + productName = FirebaseCrashlytics; + }; + 460F8D512DC77402003F019A /* FirebaseRemoteConfig */ = { + isa = XCSwiftPackageProductDependency; + package = 460F8D4A2DC77401003F019A /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; + productName = FirebaseRemoteConfig; + }; 46EE698C2DC10341001736D6 /* SnapKit */ = { isa = XCSwiftPackageProductDependency; package = 46EE698B2DC10341001736D6 /* XCRemoteSwiftPackageReference "SnapKit" */; diff --git a/ONMIR.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ONMIR.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 9b220b6..837c335 100644 --- a/ONMIR.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ONMIR.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,6 +1,105 @@ { - "originHash" : "be6f8f43ae9fcbbd48c12fb9cee2adfa4fdb9650305a8c92a692fd62d3ec851f", + "originHash" : "f2fabd9461aaf5fb8a17712fe2da61b3acfe309f841246f6876104f1e276ab53", "pins" : [ + { + "identity" : "abseil-cpp-binary", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/abseil-cpp-binary.git", + "state" : { + "revision" : "bbe8b69694d7873315fd3a4ad41efe043e1c07c5", + "version" : "1.2024072200.0" + } + }, + { + "identity" : "app-check", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/app-check.git", + "state" : { + "revision" : "61b85103a1aeed8218f17c794687781505fbbef5", + "version" : "11.2.0" + } + }, + { + "identity" : "firebase-ios-sdk", + "kind" : "remoteSourceControl", + "location" : "https://github.com/firebase/firebase-ios-sdk.git", + "state" : { + "revision" : "fbd463894af94d90eb4d6a4e54080459a8179519", + "version" : "11.12.0" + } + }, + { + "identity" : "googleappmeasurement", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/GoogleAppMeasurement.git", + "state" : { + "revision" : "f7460ea630bddf172115c28493ae8b3798d95ce3", + "version" : "11.12.0" + } + }, + { + "identity" : "googledatatransport", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/GoogleDataTransport.git", + "state" : { + "revision" : "617af071af9aa1d6a091d59a202910ac482128f9", + "version" : "10.1.0" + } + }, + { + "identity" : "googleutilities", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/GoogleUtilities.git", + "state" : { + "revision" : "60da361632d0de02786f709bdc0c4df340f7613e", + "version" : "8.1.0" + } + }, + { + "identity" : "grpc-binary", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/grpc-binary.git", + "state" : { + "revision" : "cc0001a0cf963aa40501d9c2b181e7fc9fd8ec71", + "version" : "1.69.0" + } + }, + { + "identity" : "gtm-session-fetcher", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/gtm-session-fetcher.git", + "state" : { + "revision" : "4d70340d55d7d07cc2fdf8e8125c4c126c1d5f35", + "version" : "4.4.0" + } + }, + { + "identity" : "interop-ios-for-google-sdks", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/interop-ios-for-google-sdks.git", + "state" : { + "revision" : "040d087ac2267d2ddd4cca36c757d1c6a05fdbfe", + "version" : "101.0.0" + } + }, + { + "identity" : "leveldb", + "kind" : "remoteSourceControl", + "location" : "https://github.com/firebase/leveldb.git", + "state" : { + "revision" : "a0bc79961d7be727d258d33d5a6b2f1023270ba1", + "version" : "1.22.5" + } + }, + { + "identity" : "nanopb", + "kind" : "remoteSourceControl", + "location" : "https://github.com/firebase/nanopb.git", + "state" : { + "revision" : "b7e1104502eca3a213b46303391ca4d3bc8ddec1", + "version" : "2.30910.0" + } + }, { "identity" : "nuke", "kind" : "remoteSourceControl", @@ -10,6 +109,15 @@ "version" : "12.8.0" } }, + { + "identity" : "promises", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/promises.git", + "state" : { + "revision" : "540318ecedd63d883069ae7f1ed811a2df00b6ac", + "version" : "2.4.0" + } + }, { "identity" : "snapkit", "kind" : "remoteSourceControl", @@ -18,6 +126,15 @@ "revision" : "2842e6e84e82eb9a8dac0100ca90d9444b0307f4", "version" : "5.7.1" } + }, + { + "identity" : "swift-protobuf", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-protobuf.git", + "state" : { + "revision" : "d72aed98f8253ec1aa9ea1141e28150f408cf17f", + "version" : "1.29.0" + } } ], "version" : 3 diff --git a/ONMIR/AppDelegate.swift b/ONMIR/AppDelegate.swift index b41092d..20ef94e 100644 --- a/ONMIR/AppDelegate.swift +++ b/ONMIR/AppDelegate.swift @@ -6,31 +6,41 @@ // import UIKit +import Firebase @main -class AppDelegate: UIResponder, UIApplicationDelegate { - - - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - return true - } - - // MARK: UISceneSession Lifecycle - - func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { - // Called when a new scene session is being created. - // Use this method to select a configuration to create the new scene with. - return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) - } - - func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { - // Called when the user discards a scene session. - // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. - // Use this method to release any resources that were specific to the discarded scenes, as they will not return. - } - +final class AppDelegate: UIResponder, UIApplicationDelegate { + func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication + .LaunchOptionsKey: Any]? + ) -> Bool { + FirebaseApp.configure() + return true + } + + // MARK: UISceneSession Lifecycle + + func application( + _ application: UIApplication, + configurationForConnecting connectingSceneSession: UISceneSession, + options: UIScene.ConnectionOptions + ) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration( + name: "Default Configuration", + sessionRole: connectingSceneSession.role + ) + } + + func application( + _ application: UIApplication, + didDiscardSceneSessions sceneSessions: Set + ) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } } -