├── .gitignore ├── FirebaseStarterKit ├── FirebaseStarterKit.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ └── mayilkannan.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── florian.xcuserdatad │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ │ └── mayilkannan.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist ├── FirebaseStarterKit │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── FirebaseStarterKit.entitlements │ ├── GoogleService-Info.plist │ ├── Info.plist │ ├── PushNotifications │ │ ├── PushNotificationManager.swift │ │ └── PushNotificationSender.swift │ └── ViewController.swift └── Podfile └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | FirebaseStarterKit/Pods/ 2 | FirebaseStarterKit/FirebaseStarterKit.xcworkspace/ 3 | Podfile.lock 4 | -------------------------------------------------------------------------------- /FirebaseStarterKit/FirebaseStarterKit.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 17F4913522001A1C0088A2FE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17F4913422001A1C0088A2FE /* AppDelegate.swift */; }; 11 | 17F4913722001A1C0088A2FE /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17F4913622001A1C0088A2FE /* ViewController.swift */; }; 12 | 17F4913A22001A1C0088A2FE /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 17F4913822001A1C0088A2FE /* Main.storyboard */; }; 13 | 17F4913C22001A1E0088A2FE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 17F4913B22001A1E0088A2FE /* Assets.xcassets */; }; 14 | 17F4913F22001A1E0088A2FE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 17F4913D22001A1E0088A2FE /* LaunchScreen.storyboard */; }; 15 | 17F4914822001F5A0088A2FE /* PushNotificationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17F4914722001F5A0088A2FE /* PushNotificationManager.swift */; }; 16 | 17F4914A22001F690088A2FE /* PushNotificationSender.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17F4914922001F690088A2FE /* PushNotificationSender.swift */; }; 17 | 17F4914D22002EDC0088A2FE /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 17F4914C22002EDC0088A2FE /* GoogleService-Info.plist */; }; 18 | 3C343D9C17E238F5C66F9315 /* Pods_FirebaseStarterKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FF4B5EF1B4D9419EB4968D1 /* Pods_FirebaseStarterKit.framework */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXFileReference section */ 22 | 169A5695CFB2973B795E185E /* Pods-FirebaseStarterKit.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FirebaseStarterKit.debug.xcconfig"; path = "Pods/Target Support Files/Pods-FirebaseStarterKit/Pods-FirebaseStarterKit.debug.xcconfig"; sourceTree = ""; }; 23 | 17F4913122001A1C0088A2FE /* FirebaseStarterKit.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FirebaseStarterKit.app; sourceTree = BUILT_PRODUCTS_DIR; }; 24 | 17F4913422001A1C0088A2FE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 25 | 17F4913622001A1C0088A2FE /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 26 | 17F4913922001A1C0088A2FE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 27 | 17F4913B22001A1E0088A2FE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 28 | 17F4913E22001A1E0088A2FE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 29 | 17F4914022001A1E0088A2FE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 30 | 17F4914722001F5A0088A2FE /* PushNotificationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushNotificationManager.swift; sourceTree = ""; }; 31 | 17F4914922001F690088A2FE /* PushNotificationSender.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushNotificationSender.swift; sourceTree = ""; }; 32 | 17F4914B220027110088A2FE /* FirebaseStarterKit.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = FirebaseStarterKit.entitlements; sourceTree = ""; }; 33 | 17F4914C22002EDC0088A2FE /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 34 | 652D7ED39023C45F2A5CA6C1 /* Pods-FirebaseStarterKit.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FirebaseStarterKit.release.xcconfig"; path = "Pods/Target Support Files/Pods-FirebaseStarterKit/Pods-FirebaseStarterKit.release.xcconfig"; sourceTree = ""; }; 35 | 9FF4B5EF1B4D9419EB4968D1 /* Pods_FirebaseStarterKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_FirebaseStarterKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 36 | /* End PBXFileReference section */ 37 | 38 | /* Begin PBXFrameworksBuildPhase section */ 39 | 17F4912E22001A1C0088A2FE /* Frameworks */ = { 40 | isa = PBXFrameworksBuildPhase; 41 | buildActionMask = 2147483647; 42 | files = ( 43 | 3C343D9C17E238F5C66F9315 /* Pods_FirebaseStarterKit.framework in Frameworks */, 44 | ); 45 | runOnlyForDeploymentPostprocessing = 0; 46 | }; 47 | /* End PBXFrameworksBuildPhase section */ 48 | 49 | /* Begin PBXGroup section */ 50 | 17F4912822001A1C0088A2FE = { 51 | isa = PBXGroup; 52 | children = ( 53 | 17F4913322001A1C0088A2FE /* FirebaseStarterKit */, 54 | 17F4913222001A1C0088A2FE /* Products */, 55 | 5DD481AB01BF4C4CC79A765C /* Pods */, 56 | 6562BAE2A83EF6C5B7AE87E1 /* Frameworks */, 57 | ); 58 | sourceTree = ""; 59 | }; 60 | 17F4913222001A1C0088A2FE /* Products */ = { 61 | isa = PBXGroup; 62 | children = ( 63 | 17F4913122001A1C0088A2FE /* FirebaseStarterKit.app */, 64 | ); 65 | name = Products; 66 | sourceTree = ""; 67 | }; 68 | 17F4913322001A1C0088A2FE /* FirebaseStarterKit */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | 17F4914C22002EDC0088A2FE /* GoogleService-Info.plist */, 72 | 17F4914B220027110088A2FE /* FirebaseStarterKit.entitlements */, 73 | 17F4914622001F490088A2FE /* PushNotifications */, 74 | 17F4913422001A1C0088A2FE /* AppDelegate.swift */, 75 | 17F4913622001A1C0088A2FE /* ViewController.swift */, 76 | 17F4913822001A1C0088A2FE /* Main.storyboard */, 77 | 17F4913B22001A1E0088A2FE /* Assets.xcassets */, 78 | 17F4913D22001A1E0088A2FE /* LaunchScreen.storyboard */, 79 | 17F4914022001A1E0088A2FE /* Info.plist */, 80 | ); 81 | path = FirebaseStarterKit; 82 | sourceTree = ""; 83 | }; 84 | 17F4914622001F490088A2FE /* PushNotifications */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | 17F4914722001F5A0088A2FE /* PushNotificationManager.swift */, 88 | 17F4914922001F690088A2FE /* PushNotificationSender.swift */, 89 | ); 90 | path = PushNotifications; 91 | sourceTree = ""; 92 | }; 93 | 5DD481AB01BF4C4CC79A765C /* Pods */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 169A5695CFB2973B795E185E /* Pods-FirebaseStarterKit.debug.xcconfig */, 97 | 652D7ED39023C45F2A5CA6C1 /* Pods-FirebaseStarterKit.release.xcconfig */, 98 | ); 99 | name = Pods; 100 | sourceTree = ""; 101 | }; 102 | 6562BAE2A83EF6C5B7AE87E1 /* Frameworks */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 9FF4B5EF1B4D9419EB4968D1 /* Pods_FirebaseStarterKit.framework */, 106 | ); 107 | name = Frameworks; 108 | sourceTree = ""; 109 | }; 110 | /* End PBXGroup section */ 111 | 112 | /* Begin PBXNativeTarget section */ 113 | 17F4913022001A1C0088A2FE /* FirebaseStarterKit */ = { 114 | isa = PBXNativeTarget; 115 | buildConfigurationList = 17F4914322001A1E0088A2FE /* Build configuration list for PBXNativeTarget "FirebaseStarterKit" */; 116 | buildPhases = ( 117 | 881A91AA871F2A32973890D8 /* [CP] Check Pods Manifest.lock */, 118 | 17F4912D22001A1C0088A2FE /* Sources */, 119 | 17F4912E22001A1C0088A2FE /* Frameworks */, 120 | 17F4912F22001A1C0088A2FE /* Resources */, 121 | 7586A65DC8A122682F012E4E /* [CP] Embed Pods Frameworks */, 122 | ); 123 | buildRules = ( 124 | ); 125 | dependencies = ( 126 | ); 127 | name = FirebaseStarterKit; 128 | productName = FirebaseStarterKit; 129 | productReference = 17F4913122001A1C0088A2FE /* FirebaseStarterKit.app */; 130 | productType = "com.apple.product-type.application"; 131 | }; 132 | /* End PBXNativeTarget section */ 133 | 134 | /* Begin PBXProject section */ 135 | 17F4912922001A1C0088A2FE /* Project object */ = { 136 | isa = PBXProject; 137 | attributes = { 138 | LastSwiftUpdateCheck = 1010; 139 | LastUpgradeCheck = 1010; 140 | ORGANIZATIONNAME = Instamobile; 141 | TargetAttributes = { 142 | 17F4913022001A1C0088A2FE = { 143 | CreatedOnToolsVersion = 10.1; 144 | SystemCapabilities = { 145 | com.apple.Push = { 146 | enabled = 1; 147 | }; 148 | }; 149 | }; 150 | }; 151 | }; 152 | buildConfigurationList = 17F4912C22001A1C0088A2FE /* Build configuration list for PBXProject "FirebaseStarterKit" */; 153 | compatibilityVersion = "Xcode 9.3"; 154 | developmentRegion = en; 155 | hasScannedForEncodings = 0; 156 | knownRegions = ( 157 | en, 158 | Base, 159 | ); 160 | mainGroup = 17F4912822001A1C0088A2FE; 161 | productRefGroup = 17F4913222001A1C0088A2FE /* Products */; 162 | projectDirPath = ""; 163 | projectRoot = ""; 164 | targets = ( 165 | 17F4913022001A1C0088A2FE /* FirebaseStarterKit */, 166 | ); 167 | }; 168 | /* End PBXProject section */ 169 | 170 | /* Begin PBXResourcesBuildPhase section */ 171 | 17F4912F22001A1C0088A2FE /* Resources */ = { 172 | isa = PBXResourcesBuildPhase; 173 | buildActionMask = 2147483647; 174 | files = ( 175 | 17F4913F22001A1E0088A2FE /* LaunchScreen.storyboard in Resources */, 176 | 17F4914D22002EDC0088A2FE /* GoogleService-Info.plist in Resources */, 177 | 17F4913C22001A1E0088A2FE /* Assets.xcassets in Resources */, 178 | 17F4913A22001A1C0088A2FE /* Main.storyboard in Resources */, 179 | ); 180 | runOnlyForDeploymentPostprocessing = 0; 181 | }; 182 | /* End PBXResourcesBuildPhase section */ 183 | 184 | /* Begin PBXShellScriptBuildPhase section */ 185 | 7586A65DC8A122682F012E4E /* [CP] Embed Pods Frameworks */ = { 186 | isa = PBXShellScriptBuildPhase; 187 | buildActionMask = 2147483647; 188 | files = ( 189 | ); 190 | inputFileListPaths = ( 191 | "${PODS_ROOT}/Target Support Files/Pods-FirebaseStarterKit/Pods-FirebaseStarterKit-frameworks-${CONFIGURATION}-input-files.xcfilelist", 192 | ); 193 | name = "[CP] Embed Pods Frameworks"; 194 | outputFileListPaths = ( 195 | "${PODS_ROOT}/Target Support Files/Pods-FirebaseStarterKit/Pods-FirebaseStarterKit-frameworks-${CONFIGURATION}-output-files.xcfilelist", 196 | ); 197 | runOnlyForDeploymentPostprocessing = 0; 198 | shellPath = /bin/sh; 199 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FirebaseStarterKit/Pods-FirebaseStarterKit-frameworks.sh\"\n"; 200 | showEnvVarsInLog = 0; 201 | }; 202 | 881A91AA871F2A32973890D8 /* [CP] Check Pods Manifest.lock */ = { 203 | isa = PBXShellScriptBuildPhase; 204 | buildActionMask = 2147483647; 205 | files = ( 206 | ); 207 | inputPaths = ( 208 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 209 | "${PODS_ROOT}/Manifest.lock", 210 | ); 211 | name = "[CP] Check Pods Manifest.lock"; 212 | outputPaths = ( 213 | "$(DERIVED_FILE_DIR)/Pods-FirebaseStarterKit-checkManifestLockResult.txt", 214 | ); 215 | runOnlyForDeploymentPostprocessing = 0; 216 | shellPath = /bin/sh; 217 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 218 | showEnvVarsInLog = 0; 219 | }; 220 | /* End PBXShellScriptBuildPhase section */ 221 | 222 | /* Begin PBXSourcesBuildPhase section */ 223 | 17F4912D22001A1C0088A2FE /* Sources */ = { 224 | isa = PBXSourcesBuildPhase; 225 | buildActionMask = 2147483647; 226 | files = ( 227 | 17F4914822001F5A0088A2FE /* PushNotificationManager.swift in Sources */, 228 | 17F4913722001A1C0088A2FE /* ViewController.swift in Sources */, 229 | 17F4913522001A1C0088A2FE /* AppDelegate.swift in Sources */, 230 | 17F4914A22001F690088A2FE /* PushNotificationSender.swift in Sources */, 231 | ); 232 | runOnlyForDeploymentPostprocessing = 0; 233 | }; 234 | /* End PBXSourcesBuildPhase section */ 235 | 236 | /* Begin PBXVariantGroup section */ 237 | 17F4913822001A1C0088A2FE /* Main.storyboard */ = { 238 | isa = PBXVariantGroup; 239 | children = ( 240 | 17F4913922001A1C0088A2FE /* Base */, 241 | ); 242 | name = Main.storyboard; 243 | sourceTree = ""; 244 | }; 245 | 17F4913D22001A1E0088A2FE /* LaunchScreen.storyboard */ = { 246 | isa = PBXVariantGroup; 247 | children = ( 248 | 17F4913E22001A1E0088A2FE /* Base */, 249 | ); 250 | name = LaunchScreen.storyboard; 251 | sourceTree = ""; 252 | }; 253 | /* End PBXVariantGroup section */ 254 | 255 | /* Begin XCBuildConfiguration section */ 256 | 17F4914122001A1E0088A2FE /* Debug */ = { 257 | isa = XCBuildConfiguration; 258 | buildSettings = { 259 | ALWAYS_SEARCH_USER_PATHS = NO; 260 | CLANG_ANALYZER_NONNULL = YES; 261 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 262 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 263 | CLANG_CXX_LIBRARY = "libc++"; 264 | CLANG_ENABLE_MODULES = YES; 265 | CLANG_ENABLE_OBJC_ARC = YES; 266 | CLANG_ENABLE_OBJC_WEAK = YES; 267 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 268 | CLANG_WARN_BOOL_CONVERSION = YES; 269 | CLANG_WARN_COMMA = YES; 270 | CLANG_WARN_CONSTANT_CONVERSION = YES; 271 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 272 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 273 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 274 | CLANG_WARN_EMPTY_BODY = YES; 275 | CLANG_WARN_ENUM_CONVERSION = YES; 276 | CLANG_WARN_INFINITE_RECURSION = YES; 277 | CLANG_WARN_INT_CONVERSION = YES; 278 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 279 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 280 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 281 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 282 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 283 | CLANG_WARN_STRICT_PROTOTYPES = YES; 284 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 285 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 286 | CLANG_WARN_UNREACHABLE_CODE = YES; 287 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 288 | CODE_SIGN_IDENTITY = "iPhone Developer"; 289 | COPY_PHASE_STRIP = NO; 290 | DEBUG_INFORMATION_FORMAT = dwarf; 291 | ENABLE_STRICT_OBJC_MSGSEND = YES; 292 | ENABLE_TESTABILITY = YES; 293 | GCC_C_LANGUAGE_STANDARD = gnu11; 294 | GCC_DYNAMIC_NO_PIC = NO; 295 | GCC_NO_COMMON_BLOCKS = YES; 296 | GCC_OPTIMIZATION_LEVEL = 0; 297 | GCC_PREPROCESSOR_DEFINITIONS = ( 298 | "DEBUG=1", 299 | "$(inherited)", 300 | ); 301 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 302 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 303 | GCC_WARN_UNDECLARED_SELECTOR = YES; 304 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 305 | GCC_WARN_UNUSED_FUNCTION = YES; 306 | GCC_WARN_UNUSED_VARIABLE = YES; 307 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 308 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 309 | MTL_FAST_MATH = YES; 310 | ONLY_ACTIVE_ARCH = YES; 311 | SDKROOT = iphoneos; 312 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 313 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 314 | }; 315 | name = Debug; 316 | }; 317 | 17F4914222001A1E0088A2FE /* Release */ = { 318 | isa = XCBuildConfiguration; 319 | buildSettings = { 320 | ALWAYS_SEARCH_USER_PATHS = NO; 321 | CLANG_ANALYZER_NONNULL = YES; 322 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 323 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 324 | CLANG_CXX_LIBRARY = "libc++"; 325 | CLANG_ENABLE_MODULES = YES; 326 | CLANG_ENABLE_OBJC_ARC = YES; 327 | CLANG_ENABLE_OBJC_WEAK = YES; 328 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 329 | CLANG_WARN_BOOL_CONVERSION = YES; 330 | CLANG_WARN_COMMA = YES; 331 | CLANG_WARN_CONSTANT_CONVERSION = YES; 332 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 333 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 334 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 335 | CLANG_WARN_EMPTY_BODY = YES; 336 | CLANG_WARN_ENUM_CONVERSION = YES; 337 | CLANG_WARN_INFINITE_RECURSION = YES; 338 | CLANG_WARN_INT_CONVERSION = YES; 339 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 340 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 341 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 342 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 343 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 344 | CLANG_WARN_STRICT_PROTOTYPES = YES; 345 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 346 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 347 | CLANG_WARN_UNREACHABLE_CODE = YES; 348 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 349 | CODE_SIGN_IDENTITY = "iPhone Developer"; 350 | COPY_PHASE_STRIP = NO; 351 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 352 | ENABLE_NS_ASSERTIONS = NO; 353 | ENABLE_STRICT_OBJC_MSGSEND = YES; 354 | GCC_C_LANGUAGE_STANDARD = gnu11; 355 | GCC_NO_COMMON_BLOCKS = YES; 356 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 357 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 358 | GCC_WARN_UNDECLARED_SELECTOR = YES; 359 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 360 | GCC_WARN_UNUSED_FUNCTION = YES; 361 | GCC_WARN_UNUSED_VARIABLE = YES; 362 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 363 | MTL_ENABLE_DEBUG_INFO = NO; 364 | MTL_FAST_MATH = YES; 365 | SDKROOT = iphoneos; 366 | SWIFT_COMPILATION_MODE = wholemodule; 367 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 368 | VALIDATE_PRODUCT = YES; 369 | }; 370 | name = Release; 371 | }; 372 | 17F4914422001A1E0088A2FE /* Debug */ = { 373 | isa = XCBuildConfiguration; 374 | baseConfigurationReference = 169A5695CFB2973B795E185E /* Pods-FirebaseStarterKit.debug.xcconfig */; 375 | buildSettings = { 376 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 377 | CODE_SIGN_ENTITLEMENTS = FirebaseStarterKit/FirebaseStarterKit.entitlements; 378 | CODE_SIGN_STYLE = Automatic; 379 | DEVELOPMENT_TEAM = JSQ6T9Y6J4; 380 | INFOPLIST_FILE = FirebaseStarterKit/Info.plist; 381 | LD_RUNPATH_SEARCH_PATHS = ( 382 | "$(inherited)", 383 | "@executable_path/Frameworks", 384 | ); 385 | PRODUCT_BUNDLE_IDENTIFIER = io.instamobile.FirebaseStarterKit; 386 | PRODUCT_NAME = "$(TARGET_NAME)"; 387 | SWIFT_VERSION = 4.2; 388 | TARGETED_DEVICE_FAMILY = "1,2"; 389 | }; 390 | name = Debug; 391 | }; 392 | 17F4914522001A1E0088A2FE /* Release */ = { 393 | isa = XCBuildConfiguration; 394 | baseConfigurationReference = 652D7ED39023C45F2A5CA6C1 /* Pods-FirebaseStarterKit.release.xcconfig */; 395 | buildSettings = { 396 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 397 | CODE_SIGN_ENTITLEMENTS = FirebaseStarterKit/FirebaseStarterKit.entitlements; 398 | CODE_SIGN_STYLE = Automatic; 399 | DEVELOPMENT_TEAM = JSQ6T9Y6J4; 400 | INFOPLIST_FILE = FirebaseStarterKit/Info.plist; 401 | LD_RUNPATH_SEARCH_PATHS = ( 402 | "$(inherited)", 403 | "@executable_path/Frameworks", 404 | ); 405 | PRODUCT_BUNDLE_IDENTIFIER = io.instamobile.FirebaseStarterKit; 406 | PRODUCT_NAME = "$(TARGET_NAME)"; 407 | SWIFT_VERSION = 4.2; 408 | TARGETED_DEVICE_FAMILY = "1,2"; 409 | }; 410 | name = Release; 411 | }; 412 | /* End XCBuildConfiguration section */ 413 | 414 | /* Begin XCConfigurationList section */ 415 | 17F4912C22001A1C0088A2FE /* Build configuration list for PBXProject "FirebaseStarterKit" */ = { 416 | isa = XCConfigurationList; 417 | buildConfigurations = ( 418 | 17F4914122001A1E0088A2FE /* Debug */, 419 | 17F4914222001A1E0088A2FE /* Release */, 420 | ); 421 | defaultConfigurationIsVisible = 0; 422 | defaultConfigurationName = Release; 423 | }; 424 | 17F4914322001A1E0088A2FE /* Build configuration list for PBXNativeTarget "FirebaseStarterKit" */ = { 425 | isa = XCConfigurationList; 426 | buildConfigurations = ( 427 | 17F4914422001A1E0088A2FE /* Debug */, 428 | 17F4914522001A1E0088A2FE /* Release */, 429 | ); 430 | defaultConfigurationIsVisible = 0; 431 | defaultConfigurationName = Release; 432 | }; 433 | /* End XCConfigurationList section */ 434 | }; 435 | rootObject = 17F4912922001A1C0088A2FE /* Project object */; 436 | } 437 | -------------------------------------------------------------------------------- /FirebaseStarterKit/FirebaseStarterKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /FirebaseStarterKit/FirebaseStarterKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /FirebaseStarterKit/FirebaseStarterKit.xcodeproj/project.xcworkspace/xcuserdata/mayilkannan.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dopebase/swift-push-notifications-firebase/5ac02c42f19c333750a49ee459f1b8429cfa75f0/FirebaseStarterKit/FirebaseStarterKit.xcodeproj/project.xcworkspace/xcuserdata/mayilkannan.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /FirebaseStarterKit/FirebaseStarterKit.xcodeproj/xcuserdata/florian.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | FirebaseStarterKit.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 27 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /FirebaseStarterKit/FirebaseStarterKit.xcodeproj/xcuserdata/mayilkannan.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | FirebaseStarterKit.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 23 11 | 12 | LoginScreen.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 0 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /FirebaseStarterKit/FirebaseStarterKit/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // FirebaseStarterKit 4 | // 5 | // Created by Florian Marcu on 1/28/23. 6 | // Copyright © 2023 Instamobile. All rights reserved. 7 | // 8 | 9 | import Firebase 10 | import UIKit 11 | 12 | @UIApplicationMain 13 | class AppDelegate: UIResponder, UIApplicationDelegate { 14 | 15 | var window: UIWindow? 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 18 | let pushManager = PushNotificationManager(userID: "currently_logged_in_user_id") 19 | pushManager.registerForPushNotifications() 20 | 21 | FirebaseApp.configure() 22 | 23 | let sender = PushNotificationSender() 24 | sender.sendPushNotification(to: "token", title: "Notification title", body: "Notification body") 25 | 26 | return true 27 | } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /FirebaseStarterKit/FirebaseStarterKit/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /FirebaseStarterKit/FirebaseStarterKit/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /FirebaseStarterKit/FirebaseStarterKit/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /FirebaseStarterKit/FirebaseStarterKit/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /FirebaseStarterKit/FirebaseStarterKit/FirebaseStarterKit.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | aps-environment 6 | development 7 | 8 | 9 | -------------------------------------------------------------------------------- /FirebaseStarterKit/FirebaseStarterKit/GoogleService-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AD_UNIT_ID_FOR_BANNER_TEST 6 | ca-app-pub-3940256099942544/2934735716 7 | AD_UNIT_ID_FOR_INTERSTITIAL_TEST 8 | ca-app-pub-3940256099942544/4411468910 9 | CLIENT_ID 10 | 706061484183-m5j5ovqf8h04t1er8qp41budfnhoif01.apps.googleusercontent.com 11 | REVERSED_CLIENT_ID 12 | com.googleusercontent.apps.706061484183-m5j5ovqf8h04t1er8qp41budfnhoif01 13 | API_KEY 14 | AIzaSyCh_R982LwXQkP9gDxN8Cfmc9NeZfx6z0Y 15 | GCM_SENDER_ID 16 | 706061484183 17 | PLIST_VERSION 18 | 1 19 | BUNDLE_ID 20 | io.instamobile.fcm.starterkit 21 | PROJECT_ID 22 | ios-app-templates 23 | STORAGE_BUCKET 24 | ios-app-templates.appspot.com 25 | IS_ADS_ENABLED 26 | 27 | IS_ANALYTICS_ENABLED 28 | 29 | IS_APPINVITE_ENABLED 30 | 31 | IS_GCM_ENABLED 32 | 33 | IS_SIGNIN_ENABLED 34 | 35 | GOOGLE_APP_ID 36 | 1:706061484183:ios:02b41c70f74fec11 37 | DATABASE_URL 38 | https://ios-app-templates.firebaseio.com 39 | 40 | -------------------------------------------------------------------------------- /FirebaseStarterKit/FirebaseStarterKit/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /FirebaseStarterKit/FirebaseStarterKit/PushNotifications/PushNotificationManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PushNotificationManager.swift 3 | // FirebaseStarterKit 4 | // 5 | // Created by Florian Marcu on 1/28/19. 6 | // Copyright © 2019 Instamobile. All rights reserved. 7 | // 8 | 9 | import Firebase 10 | import FirebaseFirestore 11 | import FirebaseMessaging 12 | import UIKit 13 | import UserNotifications 14 | 15 | class PushNotificationManager: NSObject, MessagingDelegate, UNUserNotificationCenterDelegate { 16 | let userID: String 17 | init(userID: String) { 18 | self.userID = userID 19 | super.init() 20 | } 21 | 22 | func registerForPushNotifications() { 23 | if #available(iOS 10.0, *) { 24 | // For iOS 10 display notification (sent via APNS) 25 | UNUserNotificationCenter.current().delegate = self 26 | let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound] 27 | UNUserNotificationCenter.current().requestAuthorization( 28 | options: authOptions, 29 | completionHandler: {_, _ in }) 30 | // For iOS 10 data message (sent via FCM) 31 | Messaging.messaging().delegate = self 32 | } else { 33 | let settings: UIUserNotificationSettings = 34 | UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil) 35 | UIApplication.shared.registerUserNotificationSettings(settings) 36 | } 37 | 38 | UIApplication.shared.registerForRemoteNotifications() 39 | updateFirestorePushTokenIfNeeded() 40 | } 41 | 42 | func updateFirestorePushTokenIfNeeded() { 43 | if let token = Messaging.messaging().fcmToken { 44 | let usersRef = Firestore.firestore().collection("users_table").document(userID) 45 | usersRef.setData(["fcmToken": token], merge: true) 46 | } 47 | } 48 | 49 | func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) { 50 | updateFirestorePushTokenIfNeeded() 51 | } 52 | 53 | func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { 54 | print(response) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /FirebaseStarterKit/FirebaseStarterKit/PushNotifications/PushNotificationSender.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PushNotificationSender.swift 3 | // FirebaseStarterKit 4 | // 5 | // Created by Florian Marcu on 1/28/19. 6 | // Copyright © 2019 Instamobile. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class PushNotificationSender { 12 | func sendPushNotification(to token: String, title: String, body: String) { 13 | let urlString = "https://fcm.googleapis.com/fcm/send" 14 | let url = NSURL(string: urlString)! 15 | let paramString: [String : Any] = ["to" : token, 16 | "notification" : ["title" : title, "body" : body], 17 | "data" : ["user" : "test_id"] 18 | ] 19 | 20 | let request = NSMutableURLRequest(url: url as URL) 21 | request.httpMethod = "POST" 22 | request.httpBody = try? JSONSerialization.data(withJSONObject:paramString, options: [.prettyPrinted]) 23 | request.setValue("application/json", forHTTPHeaderField: "Content-Type") 24 | request.setValue("key=AAAApGSLQJc:APA91bG-ibWUznAImUmsdmJG6NsZVXy8KgGazESfVwSRXx3xT9Zw060Jdp6wOlB7konATcugJX2Oje1PaELf3HplGf1SsQE-QiAw0Gl4VnPCfwzT0woK3P_RzT3ehGSFbgafJUw-RYG3", forHTTPHeaderField: "Authorization") 25 | 26 | let task = URLSession.shared.dataTask(with: request as URLRequest) { (data, response, error) in 27 | do { 28 | if let jsonData = data { 29 | if let jsonDataDict = try JSONSerialization.jsonObject(with: jsonData, options: JSONSerialization.ReadingOptions.allowFragments) as? [String: AnyObject] { 30 | NSLog("Received data:\n\(jsonDataDict))") 31 | } 32 | } 33 | } catch let err as NSError { 34 | print(err.debugDescription) 35 | } 36 | } 37 | task.resume() 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /FirebaseStarterKit/FirebaseStarterKit/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // FirebaseStarterKit 4 | // 5 | // Created by Florian Marcu on 1/28/19. 6 | // Copyright © 2019 Instamobile. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | // Do any additional setup after loading the view, typically from a nib. 16 | } 17 | 18 | 19 | } 20 | 21 | -------------------------------------------------------------------------------- /FirebaseStarterKit/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '14.0' 2 | 3 | target 'FirebaseStarterKit' do 4 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 5 | use_frameworks! 6 | 7 | # Pods for FirebaseStarterKit 8 | 9 | pod 'Firebase/Core' 10 | pod 'Firebase/Auth' 11 | pod 'Firebase/Database' 12 | pod 'Firebase/Messaging' 13 | pod 'Firebase/Storage' 14 | pod 'Firebase/Firestore' 15 | 16 | end 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Push Notifications with Firebase in Swift 5 - iOS Starter Kit 💥🔥 2 | 3 | Lightweight Swift 5 implementation of Push Notifications with Firebase (Google Cloud Messaging). Download this Swift project and run it in Xcode. Contributions are welcome. 4 | 5 | This Xcode template contains the boilerplate code needed for sending push notifications in iOS apps, via Firebase GCM. If you're starting from scratch, you need to configure your Firebase & Apple Certificates. To do that, check out this detailed tutorial on how to set up Apple Push Notifications with Firebase. 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | ## Supported Features 14 | 15 | - Registering for Notifications (Popping the push notification permissions system dialog) 16 | - Sending push notifications from Firebase UI Dashboard 17 | - Device-to-device push notifications 18 | - Sending push notifications programmatically in Swift 19 | 20 | ## How to run the Xcode project 21 | 22 | 0. Configure Apple & Firebase certificates 23 | 1. Download the source code by cloning this repository 24 | 2. Install the pods by running 25 | 26 | ``` 27 | pod install 28 | ``` 29 | 30 | 3. Open the xcworkspace file with the latest version of Xcode 31 | 4. Replace the GoogleService.plist file with your own (Download it from the Firebase Console) 32 | 5. Run (Cmd + R) the code 33 | 34 | Coded with love and supported by iOS App Templates. This app has been created with UI components provided by Instamobile. 35 | --------------------------------------------------------------------------------