├── .gitignore ├── .travis.yml ├── CONTRIBUTING.md ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── README.md ├── grow-ios-starter ├── objc-starter │ ├── FriendlyChatObjC.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── FriendlyChatObjC.xcscheme │ ├── FriendlyChatObjC │ │ ├── .clang-format │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Constants.h │ │ ├── Constants.m │ │ ├── FCViewController.h │ │ ├── FCViewController.m │ │ ├── Info.plist │ │ ├── Main.storyboard │ │ ├── MeasurementHelper.h │ │ ├── MeasurementHelper.m │ │ ├── SignInViewController.h │ │ ├── SignInViewController.m │ │ └── main.m │ ├── Podfile │ ├── Podfile.lock │ └── shared │ │ ├── Bladefile │ │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── AppIcon-60-2x.png │ │ │ ├── AppIcon-60-3x.png │ │ │ ├── AppIcon-76-2x.png │ │ │ ├── AppIcon-76.png │ │ │ ├── Contents.json │ │ │ ├── logo1024-ipad-29@1x.png │ │ │ ├── logo1024-ipad-29@2x.png │ │ │ ├── logo1024-ipad-40@1x.png │ │ │ ├── logo1024-ipad-40@2x.png │ │ │ ├── logo1024-ipad-83@2x.png │ │ │ ├── logo1024-iphone-29@2x.png │ │ │ ├── logo1024-iphone-29@3x.png │ │ │ ├── logo1024-iphone-40@2x.png │ │ │ └── logo1024-iphone-40@3x.png │ │ ├── Brand Assets.launchimage │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── LaunchImage.launchimage │ │ │ └── Contents.json │ │ ├── Logo.imageset │ │ │ ├── Contents.json │ │ │ ├── logo1024-universal-341@1x.png │ │ │ ├── logo1024-universal-341@2x.png │ │ │ └── logo1024-universal-341@3x.png │ │ ├── ic_account_circle.imageset │ │ │ ├── Contents.json │ │ │ ├── ic_account_circle.png │ │ │ ├── ic_account_circle_2x.png │ │ │ └── ic_account_circle_3x.png │ │ └── ic_add_a_photo.imageset │ │ │ ├── Contents.json │ │ │ ├── ic_add_a_photo.png │ │ │ ├── ic_add_a_photo_2x.png │ │ │ └── ic_add_a_photo_3x.png │ │ ├── LaunchScreen.xib │ │ └── assets │ │ └── logo1024.png └── swift-starter │ ├── FriendlyChatSwift.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── FriendlyChatSwift.xcscheme │ ├── FriendlyChatSwift │ ├── AppDelegate.swift │ ├── Base.lproj │ │ └── Main.storyboard │ ├── Constants.swift │ ├── FCViewController.swift │ ├── FriendlyChatSwift.entitlements │ ├── Info.plist │ ├── MeasurementHelper.swift │ └── SignInViewController.swift │ ├── Podfile │ ├── Podfile.lock │ └── shared │ ├── Bladefile │ ├── Images.xcassets │ ├── AppIcon.appiconset │ │ ├── AppIcon-60-2x.png │ │ ├── AppIcon-60-3x.png │ │ ├── AppIcon-76-2x.png │ │ ├── AppIcon-76.png │ │ ├── Contents.json │ │ ├── logo1024-ipad-29@1x.png │ │ ├── logo1024-ipad-29@2x.png │ │ ├── logo1024-ipad-40@1x.png │ │ ├── logo1024-ipad-40@2x.png │ │ ├── logo1024-ipad-83@2x.png │ │ ├── logo1024-iphone-29@2x.png │ │ ├── logo1024-iphone-29@3x.png │ │ ├── logo1024-iphone-40@2x.png │ │ └── logo1024-iphone-40@3x.png │ ├── Brand Assets.launchimage │ │ └── Contents.json │ ├── Contents.json │ ├── LaunchImage.launchimage │ │ └── Contents.json │ ├── Logo.imageset │ │ ├── Contents.json │ │ ├── logo1024-universal-341@1x.png │ │ ├── logo1024-universal-341@2x.png │ │ └── logo1024-universal-341@3x.png │ ├── ic_account_circle.imageset │ │ ├── Contents.json │ │ ├── ic_account_circle.png │ │ ├── ic_account_circle_2x.png │ │ └── ic_account_circle_3x.png │ └── ic_add_a_photo.imageset │ │ ├── Contents.json │ │ ├── ic_add_a_photo.png │ │ ├── ic_add_a_photo_2x.png │ │ └── ic_add_a_photo_3x.png │ ├── LaunchScreen.xib │ └── assets │ └── logo1024.png ├── initial_messages.json ├── ios-starter ├── objc-starter │ ├── FriendlyChatObjC.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── FriendlyChatObjC.xcscheme │ ├── FriendlyChatObjC │ │ ├── .clang-format │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Constants.h │ │ ├── Constants.m │ │ ├── FCViewController.h │ │ ├── FCViewController.m │ │ ├── Info.plist │ │ ├── Main.storyboard │ │ ├── MeasurementHelper.h │ │ ├── MeasurementHelper.m │ │ ├── SignInViewController.h │ │ ├── SignInViewController.m │ │ └── main.m │ ├── Podfile │ ├── Podfile.lock │ └── shared │ │ ├── Bladefile │ │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── AppIcon-60-2x.png │ │ │ ├── AppIcon-60-3x.png │ │ │ ├── AppIcon-76-2x.png │ │ │ ├── AppIcon-76.png │ │ │ ├── Contents.json │ │ │ ├── logo1024-ipad-29@1x.png │ │ │ ├── logo1024-ipad-29@2x.png │ │ │ ├── logo1024-ipad-40@1x.png │ │ │ ├── logo1024-ipad-40@2x.png │ │ │ ├── logo1024-ipad-83@2x.png │ │ │ ├── logo1024-iphone-29@2x.png │ │ │ ├── logo1024-iphone-29@3x.png │ │ │ ├── logo1024-iphone-40@2x.png │ │ │ └── logo1024-iphone-40@3x.png │ │ ├── Brand Assets.launchimage │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── LaunchImage.launchimage │ │ │ └── Contents.json │ │ ├── Logo.imageset │ │ │ ├── Contents.json │ │ │ ├── logo1024-universal-341@1x.png │ │ │ ├── logo1024-universal-341@2x.png │ │ │ └── logo1024-universal-341@3x.png │ │ ├── ic_account_circle.imageset │ │ │ ├── Contents.json │ │ │ ├── ic_account_circle.png │ │ │ ├── ic_account_circle_2x.png │ │ │ └── ic_account_circle_3x.png │ │ └── ic_add_a_photo.imageset │ │ │ ├── Contents.json │ │ │ ├── ic_add_a_photo.png │ │ │ ├── ic_add_a_photo_2x.png │ │ │ └── ic_add_a_photo_3x.png │ │ ├── LaunchScreen.xib │ │ └── assets │ │ └── logo1024.png └── swift-starter │ ├── FriendlyChatSwift.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── FriendlyChatSwift.xcscheme │ ├── FriendlyChatSwift │ ├── AppDelegate.swift │ ├── Base.lproj │ │ └── Main.storyboard │ ├── Constants.swift │ ├── FCViewController.swift │ ├── Info.plist │ ├── MeasurementHelper.swift │ └── SignInViewController.swift │ ├── Podfile │ ├── Podfile.lock │ └── shared │ ├── Bladefile │ ├── Images.xcassets │ ├── AppIcon.appiconset │ │ ├── AppIcon-60-2x.png │ │ ├── AppIcon-60-3x.png │ │ ├── AppIcon-76-2x.png │ │ ├── AppIcon-76.png │ │ ├── Contents.json │ │ ├── logo1024-ipad-29@1x.png │ │ ├── logo1024-ipad-29@2x.png │ │ ├── logo1024-ipad-40@1x.png │ │ ├── logo1024-ipad-40@2x.png │ │ ├── logo1024-ipad-83@2x.png │ │ ├── logo1024-iphone-29@2x.png │ │ ├── logo1024-iphone-29@3x.png │ │ ├── logo1024-iphone-40@2x.png │ │ └── logo1024-iphone-40@3x.png │ ├── Brand Assets.launchimage │ │ └── Contents.json │ ├── Contents.json │ ├── LaunchImage.launchimage │ │ └── Contents.json │ ├── Logo.imageset │ │ ├── Contents.json │ │ ├── logo1024-universal-341@1x.png │ │ ├── logo1024-universal-341@2x.png │ │ └── logo1024-universal-341@3x.png │ ├── ic_account_circle.imageset │ │ ├── Contents.json │ │ ├── ic_account_circle.png │ │ ├── ic_account_circle_2x.png │ │ └── ic_account_circle_3x.png │ └── ic_add_a_photo.imageset │ │ ├── Contents.json │ │ ├── ic_add_a_photo.png │ │ ├── ic_add_a_photo_2x.png │ │ └── ic_add_a_photo_3x.png │ ├── LaunchScreen.xib │ └── assets │ └── logo1024.png ├── ios ├── info_script.rb ├── mock-GoogleService-Info.plist ├── objc │ ├── FriendlyChatObjC.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── FriendlyChatObjC.xcscheme │ ├── FriendlyChatObjC │ │ ├── .clang-format │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Constants.h │ │ ├── Constants.m │ │ ├── FCViewController.h │ │ ├── FCViewController.m │ │ ├── FriendlyChatObjC.entitlements │ │ ├── Info.plist │ │ ├── Main.storyboard │ │ ├── MeasurementHelper.h │ │ ├── MeasurementHelper.m │ │ ├── SignInViewController.h │ │ ├── SignInViewController.m │ │ └── main.m │ ├── Podfile │ ├── Podfile.lock │ └── shared │ │ ├── Bladefile │ │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── AppIcon-60-2x.png │ │ │ ├── AppIcon-60-3x.png │ │ │ ├── AppIcon-76-2x.png │ │ │ ├── AppIcon-76.png │ │ │ ├── Contents.json │ │ │ ├── logo1024-ipad-29@1x.png │ │ │ ├── logo1024-ipad-29@2x.png │ │ │ ├── logo1024-ipad-40@1x.png │ │ │ ├── logo1024-ipad-40@2x.png │ │ │ ├── logo1024-ipad-83@2x.png │ │ │ ├── logo1024-iphone-29@2x.png │ │ │ ├── logo1024-iphone-29@3x.png │ │ │ ├── logo1024-iphone-40@2x.png │ │ │ └── logo1024-iphone-40@3x.png │ │ ├── Brand Assets.launchimage │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── LaunchImage.launchimage │ │ │ └── Contents.json │ │ ├── Logo.imageset │ │ │ ├── Contents.json │ │ │ ├── logo1024-universal-341@1x.png │ │ │ ├── logo1024-universal-341@2x.png │ │ │ └── logo1024-universal-341@3x.png │ │ ├── ic_account_circle.imageset │ │ │ ├── Contents.json │ │ │ ├── ic_account_circle.png │ │ │ ├── ic_account_circle_2x.png │ │ │ └── ic_account_circle_3x.png │ │ └── ic_add_a_photo.imageset │ │ │ ├── Contents.json │ │ │ ├── ic_add_a_photo.png │ │ │ ├── ic_add_a_photo_2x.png │ │ │ └── ic_add_a_photo_3x.png │ │ ├── LaunchScreen.xib │ │ └── assets │ │ └── logo1024.png ├── swift │ ├── FriendlyChatSwift.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── FriendlyChatSwift.xcscheme │ ├── FriendlyChatSwift │ │ ├── AppDelegate.swift │ │ ├── Base.lproj │ │ │ └── Main.storyboard │ │ ├── Constants.swift │ │ ├── FCViewController.swift │ │ ├── FriendlyChatSwift.entitlements │ │ ├── Info.plist │ │ ├── MeasurementHelper.swift │ │ └── SignInViewController.swift │ ├── Podfile │ ├── Podfile.lock │ └── shared │ │ ├── Bladefile │ │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── AppIcon-60-2x.png │ │ │ ├── AppIcon-60-3x.png │ │ │ ├── AppIcon-76-2x.png │ │ │ ├── AppIcon-76.png │ │ │ ├── Contents.json │ │ │ ├── logo1024-ipad-29@1x.png │ │ │ ├── logo1024-ipad-29@2x.png │ │ │ ├── logo1024-ipad-40@1x.png │ │ │ ├── logo1024-ipad-40@2x.png │ │ │ ├── logo1024-ipad-83@2x.png │ │ │ ├── logo1024-iphone-29@2x.png │ │ │ ├── logo1024-iphone-29@3x.png │ │ │ ├── logo1024-iphone-40@2x.png │ │ │ └── logo1024-iphone-40@3x.png │ │ ├── Brand Assets.launchimage │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── LaunchImage.launchimage │ │ │ └── Contents.json │ │ ├── Logo.imageset │ │ │ ├── Contents.json │ │ │ ├── logo1024-universal-341@1x.png │ │ │ ├── logo1024-universal-341@2x.png │ │ │ └── logo1024-universal-341@3x.png │ │ ├── ic_account_circle.imageset │ │ │ ├── Contents.json │ │ │ ├── ic_account_circle.png │ │ │ ├── ic_account_circle_2x.png │ │ │ └── ic_account_circle_3x.png │ │ └── ic_add_a_photo.imageset │ │ │ ├── Contents.json │ │ │ ├── ic_add_a_photo.png │ │ │ ├── ic_add_a_photo_2x.png │ │ │ └── ic_add_a_photo_3x.png │ │ ├── LaunchScreen.xib │ │ └── assets │ │ └── logo1024.png └── swiftui │ ├── FriendlyChatSwiftUI.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── FriendlyChatSwiftUI.xcscheme │ ├── FriendlyChatSwiftUI │ ├── Assets.xcassets │ │ ├── AccentColor.colorset │ │ │ └── Contents.json │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ └── firebaseLogo120.png │ │ ├── Contents.json │ │ ├── FirebaseBlue.colorset │ │ │ └── Contents.json │ │ ├── FirebaseGray.colorset │ │ │ └── Contents.json │ │ ├── FirebaseOrange.colorset │ │ │ └── Contents.json │ │ └── FirebaseYellow.colorset │ │ │ └── Contents.json │ ├── FriendlyChatSwiftUIApp.swift │ ├── FriendlyMessage.swift │ ├── FriendlyMessageViewModel.swift │ ├── ImagePicker.swift │ ├── ImageUploader.swift │ ├── Preview Content │ │ └── Preview Assets.xcassets │ │ │ └── Contents.json │ ├── UserViewModel.swift │ └── Views │ │ ├── ContentView.swift │ │ ├── FooterView.swift │ │ ├── FriendlyMessageImageView.swift │ │ ├── FriendlyMessageTextView.swift │ │ ├── FriendlyMessageView.swift │ │ ├── HeaderView.swift │ │ ├── InitialsView.swift │ │ ├── LoginView.swift │ │ ├── ProfileView.swift │ │ └── SignUpView.swift │ ├── Podfile │ ├── Podfile.lock │ └── README.md └── test.sh /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | gen/ 3 | .DS_Store 4 | Pods/ 5 | xcuserdata/ 6 | *.xcworkspace/ 7 | GoogleService-Info.plist 8 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | osx_image: xcode10 2 | language: objective-c 3 | cache: 4 | - bundler 5 | - cocoapods 6 | 7 | matrix: 8 | include: 9 | - podfile: ios/objc/Podfile 10 | env: 11 | - LANGUAGE=ObjC 12 | - DIR=ios/objc 13 | - podfile: ios/swift/Podfile 14 | env: 15 | - LANGUAGE=Swift 16 | - DIR=ios/swift 17 | - podfile: grow-ios-starter/objc-starter/Podfile 18 | env: 19 | - LANGUAGE=ObjC 20 | - DIR=grow-ios-starter/objc-starter 21 | - podfile: grow-ios-starter/swift-starter/Podfile 22 | env: 23 | - LANGUAGE=Swift 24 | - DIR=grow-ios-starter/swift-starter 25 | - podfile: ios-starter/objc-starter/Podfile 26 | env: 27 | - LANGUAGE=ObjC 28 | - DIR=ios-starter/objc-starter 29 | before_install: 30 | - bundle install 31 | - gem install xcpretty 32 | - cd ios-starter/objc-starter 33 | - bundle exec pod install --repo-update 34 | - cd - 35 | - podfile: ios-starter/swift-starter/Podfile 36 | env: 37 | - LANGUAGE=Swift 38 | - DIR=ios-starter/swift-starter 39 | before_install: 40 | - bundle install 41 | - gem install xcpretty 42 | - cd ios-starter/swift-starter 43 | - bundle exec pod install --repo-update 44 | - cd - 45 | 46 | before_install: 47 | - bundle install 48 | - gem install xcpretty 49 | - cd ios/$LANGUAGE 50 | - bundle exec pod install --repo-update 51 | - cp ../mock-GoogleService-Info.plist ./GoogleService-Info.plist 52 | - sed -i '' '/BUNDLE_ID 'https://github.com/CocoaPods/CocoaPods.git' 5 | gem 'cocoapods-core', :git => 'https://github.com/CocoaPods/Core.git' 6 | gem 'xcodeproj', :git => 'https://github.com/CocoaPods/Xcodeproj.git' 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Firebase Codelab: FriendlyChat 2 | 3 | This is the source code for the Firebase FriendlyChat codelab. It includes start and end versions of the 4 | code for Objective-C and Swift. To get started open the codelab instructions: 5 | 6 | - [Firebase Swift Codelab](https://codelabs.developers.google.com/codelabs/firebase-ios-swift/). 7 | - [Firebase Objective-C Codelab](https://codelabs.developers.google.com/codelabs/firebase-ios-objc/). 8 | 9 | 10 | ## How to make contributions? 11 | Please read and follow the steps in the [CONTRIBUTING.md](CONTRIBUTING.md) 12 | 13 | 14 | ## License 15 | See [LICENSE](LICENSE) 16 | -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/FriendlyChatObjC/.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: Google 2 | ColumnLimit: 100 3 | BinPackParameters: false 4 | AllowAllParametersOfDeclarationOnNextLine: true 5 | -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/FriendlyChatObjC/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | @import UIKit; 18 | @import GoogleSignIn; 19 | 20 | @interface AppDelegate : UIResponder 21 | 22 | @property (strong, nonatomic) UIWindow *window; 23 | 24 | 25 | @end 26 | 27 | -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/FriendlyChatObjC/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import "AppDelegate.h" 18 | 19 | @import Firebase; 20 | @import GoogleSignIn; 21 | 22 | @implementation AppDelegate 23 | 24 | - (BOOL)application:(nonnull UIApplication *)application 25 | openURL:(nonnull NSURL *)url 26 | options:(nonnull NSDictionary *)options { 27 | return [self application:application 28 | openURL:url 29 | sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey] 30 | annotation:options[UIApplicationOpenURLOptionsAnnotationKey]]; 31 | } 32 | 33 | - (BOOL)application:(UIApplication *)application 34 | openURL:(NSURL *)url 35 | sourceApplication:(NSString *)sourceApplication 36 | annotation:(id)annotation { 37 | return [[GIDSignIn sharedInstance] handleURL:url]; 38 | } 39 | 40 | - (void)signIn:(GIDSignIn *)signIn 41 | didSignInForUser:(GIDGoogleUser *)user 42 | withError:(NSError *)error { 43 | if (error == nil) { 44 | GIDAuthentication *authentication = user.authentication; 45 | FIRAuthCredential *credential = 46 | [FIRGoogleAuthProvider credentialWithIDToken:authentication.idToken 47 | accessToken:authentication.accessToken]; 48 | [[FIRAuth auth] signInWithCredential:credential completion:^(FIRAuthDataResult * _Nullable authResult, NSError * _Nullable error) { 49 | if (error) { 50 | NSLog(@"Error %@", error.localizedDescription); 51 | } 52 | }]; 53 | } else { 54 | NSLog(@"Error %@", error.localizedDescription); 55 | } 56 | } 57 | 58 | - (BOOL)application:(UIApplication *)application 59 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 60 | [FIRApp configure]; 61 | [GIDSignIn sharedInstance].clientID = [FIRApp defaultApp].options.clientID; 62 | [GIDSignIn sharedInstance].delegate = self; 63 | return YES; 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/FriendlyChatObjC/Constants.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | 19 | @interface Constants : NSObject 20 | 21 | extern NSString *const NotificationKeysSignedIn; 22 | 23 | extern NSString *const SeguesSignInToFp; 24 | extern NSString *const SeguesFpToSignIn; 25 | 26 | extern NSString *const MessageFieldsname; 27 | extern NSString *const MessageFieldstext; 28 | extern NSString *const MessageFieldsphotoURL; 29 | extern NSString *const MessageFieldsimageURL; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/FriendlyChatObjC/Constants.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import "Constants.h" 18 | 19 | @implementation Constants 20 | 21 | NSString *const NotificationKeysSignedIn = @"onSignInCompleted"; 22 | 23 | NSString *const SeguesSignInToFp = @"SignInToFP"; 24 | NSString *const SeguesFpToSignIn = @"FPToSignIn"; 25 | 26 | NSString *const MessageFieldsname = @"name"; 27 | NSString *const MessageFieldstext = @"text"; 28 | NSString *const MessageFieldsphotoURL = @"photoURL"; 29 | NSString *const MessageFieldsimageURL = @"imageURL"; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/FriendlyChatObjC/FCViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | @import UIKit; 18 | 19 | @interface FCViewController : UIViewController 20 | 21 | @end 22 | 23 | -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/FriendlyChatObjC/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSContactsUsageDescription 6 | Used for Firebase Invites 7 | NSCameraUsageDescription 8 | Take and upload photos to Cloud Storage 9 | NSPhotoLibraryUsageDescription 10 | Upload photo to Cloud Storage 11 | CFBundleDevelopmentRegion 12 | en 13 | CFBundleExecutable 14 | $(EXECUTABLE_NAME) 15 | CFBundleIcons 16 | 17 | CFBundleIcons~ipad 18 | 19 | CFBundleIdentifier 20 | $(PRODUCT_BUNDLE_IDENTIFIER) 21 | CFBundleInfoDictionaryVersion 22 | 6.0 23 | CFBundleName 24 | $(PRODUCT_NAME) 25 | CFBundlePackageType 26 | APPL 27 | CFBundleShortVersionString 28 | 1.0 29 | CFBundleSignature 30 | ???? 31 | CFBundleURLTypes 32 | 33 | 34 | CFBundleTypeRole 35 | Editor 36 | CFBundleURLSchemes 37 | 38 | REVERSED_CLIENT_ID 39 | 40 | 41 | 42 | CFBundleVersion 43 | 1 44 | LSRequiresIPhoneOS 45 | 46 | UIBackgroundModes 47 | 48 | remote-notification 49 | 50 | UILaunchStoryboardName 51 | LaunchScreen 52 | UIMainStoryboardFile 53 | Main 54 | UIRequiredDeviceCapabilities 55 | 56 | armv7 57 | 58 | UISupportedInterfaceOrientations 59 | 60 | UIInterfaceOrientationPortrait 61 | UIInterfaceOrientationLandscapeLeft 62 | UIInterfaceOrientationLandscapeRight 63 | 64 | UISupportedInterfaceOrientations~ipad 65 | 66 | UIInterfaceOrientationPortrait 67 | UIInterfaceOrientationPortraitUpsideDown 68 | UIInterfaceOrientationLandscapeLeft 69 | UIInterfaceOrientationLandscapeRight 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/FriendlyChatObjC/MeasurementHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | 19 | @interface MeasurementHelper : NSObject 20 | 21 | + (void)sendLoginEvent; 22 | + (void)sendLogoutEvent; 23 | + (void)sendMessageEvent; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/FriendlyChatObjC/MeasurementHelper.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import "MeasurementHelper.h" 18 | 19 | @import Firebase; 20 | 21 | @implementation MeasurementHelper 22 | 23 | + (void)sendLoginEvent { 24 | } 25 | 26 | + (void)sendLogoutEvent { 27 | } 28 | 29 | + (void)sendMessageEvent{ 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/FriendlyChatObjC/SignInViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | @import UIKit; 18 | @import GoogleSignIn; 19 | 20 | @interface SignInViewController : UIViewController 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/FriendlyChatObjC/SignInViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import "Constants.h" 18 | #import "MeasurementHelper.h" 19 | #import "SignInViewController.h" 20 | 21 | @import Firebase; 22 | 23 | @interface SignInViewController () 24 | @property(weak, nonatomic) IBOutlet GIDSignInButton *signInButton; 25 | @property(strong, nonatomic) FIRAuthStateDidChangeListenerHandle handle; 26 | @end 27 | 28 | @implementation SignInViewController 29 | 30 | - (void)viewDidLoad { 31 | [super viewDidLoad]; 32 | [GIDSignIn sharedInstance].presentingViewController = self; 33 | [[GIDSignIn sharedInstance] restorePreviousSignIn]; 34 | self.handle = [[FIRAuth auth] 35 | addAuthStateDidChangeListener:^(FIRAuth *_Nonnull auth, FIRUser *_Nullable user) { 36 | if (user) { 37 | [MeasurementHelper sendLoginEvent]; 38 | [self performSegueWithIdentifier:SeguesSignInToFp sender:nil]; 39 | } 40 | }]; 41 | } 42 | 43 | - (void)dealloc { 44 | [[FIRAuth auth] removeAuthStateDidChangeListener:_handle]; 45 | } 46 | 47 | - (IBAction)signOut:(UIButton *)sender { 48 | FIRAuth *firebaseAuth = [FIRAuth auth]; 49 | NSError *signOutError; 50 | BOOL status = [firebaseAuth signOut:&signOutError]; 51 | if (!status) { 52 | NSLog(@"Error signing out: %@", signOutError); 53 | return; 54 | } 55 | [self dismissViewControllerAnimated:YES completion:nil]; 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/FriendlyChatObjC/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | #import "AppDelegate.h" 19 | 20 | int main(int argc, char * argv[]) { 21 | @autoreleasepool { 22 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/Podfile: -------------------------------------------------------------------------------- 1 | # FriendlyChat Codelab 2 | 3 | platform :ios, '8.0' 4 | 5 | pod 'GoogleSignIn' 6 | pod 'Firebase/Core' 7 | pod 'Firebase/Auth' 8 | pod 'Firebase/Crashlytics' 9 | pod 'Firebase/Database' 10 | pod 'Firebase/InAppMessagingDisplay' 11 | pod 'Firebase/RemoteConfig' 12 | pod 'Firebase/Storage' 13 | 14 | target 'FriendlyChatObjC' do 15 | end 16 | -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Bladefile: -------------------------------------------------------------------------------- 1 | # 2 | # Uncomment below to specify your own resources. 3 | # See https://github.com/jondot/blade for more information. 4 | # 5 | 6 | blades: 7 | - source: assets/logo1024.png 8 | mount: Images.xcassets/AppIcon.appiconset 9 | contents: true 10 | - source: assets/logo1024.png 11 | mount: Images.xcassets/Logo.imageset 12 | -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-60-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-60-2x.png -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-60-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-60-3x.png -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-76-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-76-2x.png -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-76.png -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "logo1024-iphone-29@2x.png", 5 | "idiom": "iphone", 6 | "scale": "2x", 7 | "size": "29x29" 8 | }, 9 | { 10 | "filename": "logo1024-iphone-29@3x.png", 11 | "idiom": "iphone", 12 | "scale": "3x", 13 | "size": "29x29" 14 | }, 15 | { 16 | "filename": "logo1024-iphone-40@2x.png", 17 | "idiom": "iphone", 18 | "scale": "2x", 19 | "size": "40x40" 20 | }, 21 | { 22 | "filename": "logo1024-iphone-40@3x.png", 23 | "idiom": "iphone", 24 | "scale": "3x", 25 | "size": "40x40" 26 | }, 27 | { 28 | "filename": "AppIcon-60-2x.png", 29 | "idiom": "iphone", 30 | "scale": "2x", 31 | "size": "60x60" 32 | }, 33 | { 34 | "filename": "AppIcon-60-3x.png", 35 | "idiom": "iphone", 36 | "scale": "3x", 37 | "size": "60x60" 38 | }, 39 | { 40 | "filename": "logo1024-ipad-29@1x.png", 41 | "idiom": "ipad", 42 | "scale": "1x", 43 | "size": "29x29" 44 | }, 45 | { 46 | "filename": "logo1024-ipad-29@2x.png", 47 | "idiom": "ipad", 48 | "scale": "2x", 49 | "size": "29x29" 50 | }, 51 | { 52 | "filename": "logo1024-ipad-40@1x.png", 53 | "idiom": "ipad", 54 | "scale": "1x", 55 | "size": "40x40" 56 | }, 57 | { 58 | "filename": "logo1024-ipad-40@2x.png", 59 | "idiom": "ipad", 60 | "scale": "2x", 61 | "size": "40x40" 62 | }, 63 | { 64 | "filename": "AppIcon-76.png", 65 | "idiom": "ipad", 66 | "scale": "1x", 67 | "size": "76x76" 68 | }, 69 | { 70 | "filename": "AppIcon-76-2x.png", 71 | "idiom": "ipad", 72 | "scale": "2x", 73 | "size": "76x76" 74 | }, 75 | { 76 | "filename": "logo1024-ipad-83@2x.png", 77 | "idiom": "ipad", 78 | "scale": "2x", 79 | "size": "83.5x83.5" 80 | } 81 | ], 82 | "info": { 83 | "author": "xcode", 84 | "version": 1 85 | } 86 | } -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-29@1x.png -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-29@2x.png -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-40@1x.png -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-40@2x.png -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-83@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-83@2x.png -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-29@2x.png -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-29@3x.png -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-40@2x.png -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-40@3x.png -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/Brand Assets.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "ipad", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "1x" 9 | }, 10 | { 11 | "orientation" : "landscape", 12 | "idiom" : "ipad", 13 | "extent" : "full-screen", 14 | "minimum-system-version" : "7.0", 15 | "scale" : "1x" 16 | }, 17 | { 18 | "orientation" : "portrait", 19 | "idiom" : "ipad", 20 | "extent" : "full-screen", 21 | "minimum-system-version" : "7.0", 22 | "scale" : "2x" 23 | }, 24 | { 25 | "orientation" : "landscape", 26 | "idiom" : "ipad", 27 | "extent" : "full-screen", 28 | "minimum-system-version" : "7.0", 29 | "scale" : "2x" 30 | } 31 | ], 32 | "info" : { 33 | "version" : 1, 34 | "author" : "xcode" 35 | } 36 | } -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/Logo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "logo1024-universal-341@1x.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "logo1024-universal-341@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "logo1024-universal-341@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/objc-starter/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@1x.png -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/objc-starter/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@2x.png -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/objc-starter/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@3x.png -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/ic_account_circle.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "ic_account_circle.png", 5 | "idiom": "universal", 6 | "scale": "1x" 7 | }, 8 | { 9 | "filename": "ic_account_circle_2x.png", 10 | "idiom": "universal", 11 | "scale": "2x" 12 | }, 13 | { 14 | "filename": "ic_account_circle_3x.png", 15 | "idiom": "universal", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "author": "xcode", 21 | "version": 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/objc-starter/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle.png -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/objc-starter/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle_2x.png -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/objc-starter/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle_3x.png -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/ic_add_a_photo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "ic_add_a_photo.png", 5 | "idiom": "universal", 6 | "scale": "1x" 7 | }, 8 | { 9 | "filename": "ic_add_a_photo_2x.png", 10 | "idiom": "universal", 11 | "scale": "2x" 12 | }, 13 | { 14 | "filename": "ic_add_a_photo_3x.png", 15 | "idiom": "universal", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "author": "xcode", 21 | "version": 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/objc-starter/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo.png -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/objc-starter/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo_2x.png -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/objc-starter/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo_3x.png -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/LaunchScreen.xib: -------------------------------------------------------------------------------- 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 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /grow-ios-starter/objc-starter/shared/assets/logo1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/objc-starter/shared/assets/logo1024.png -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/FriendlyChatSwift/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2015 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | import UIKit 18 | 19 | import Firebase 20 | import GoogleSignIn 21 | 22 | @UIApplicationMain 23 | class AppDelegate: UIResponder, UIApplicationDelegate, GIDSignInDelegate { 24 | 25 | var window: UIWindow? 26 | 27 | @available(iOS 9.0, *) 28 | func application(_ application: UIApplication, 29 | open url: URL, 30 | options: [UIApplication.OpenURLOptionsKey : Any]) 31 | -> Bool { 32 | if let dynamicLink = DynamicLinks.dynamicLinks().dynamicLink(fromCustomSchemeURL: url) { 33 | // Handle the deep link. For example, show the deep-linked content or 34 | // apply a promotional offer to the user's account. 35 | // ... 36 | print(dynamicLink.url) 37 | return true 38 | } 39 | return GIDSignIn.sharedInstance().handle(url) 40 | } 41 | 42 | func application(_ application: UIApplication, continue userActivity: NSUserActivity, 43 | restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { 44 | let handled = DynamicLinks.dynamicLinks().handleUniversalLink(userActivity.webpageURL!) { (dynamiclink, error) in 45 | print(dynamiclink?.url ?? "no dynamic url found") 46 | } 47 | return handled 48 | } 49 | 50 | func application(_ application: UIApplication, didFinishLaunchingWithOptions 51 | launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 52 | FirebaseApp.configure() 53 | GIDSignIn.sharedInstance().clientID = FirebaseApp.app()?.options.clientID 54 | GIDSignIn.sharedInstance().delegate = self 55 | return true 56 | } 57 | 58 | func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error?) { 59 | if let error = error { 60 | print("Error \(error)") 61 | return 62 | } 63 | guard let authentication = user.authentication else { return } 64 | let credential = GoogleAuthProvider.credential(withIDToken: authentication.idToken, 65 | accessToken: authentication.accessToken) 66 | Auth.auth().signIn(with: credential) { (user, error) in 67 | if let error = error { 68 | print("Error \(error)") 69 | return 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/FriendlyChatSwift/Constants.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2015 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | struct Constants { 18 | 19 | struct NotificationKeys { 20 | static let SignedIn = "onSignInCompleted" 21 | } 22 | 23 | struct Segues { 24 | static let SignInToFp = "SignInToFP" 25 | static let FpToSignIn = "FPToSignIn" 26 | } 27 | 28 | struct MessageFields { 29 | static let name = "name" 30 | static let text = "text" 31 | static let photoURL = "photoURL" 32 | static let imageURL = "imageURL" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/FriendlyChatSwift/FriendlyChatSwift.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.developer.associated-domains 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/FriendlyChatSwift/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIcons 10 | 11 | CFBundleIcons~ipad 12 | 13 | CFBundleIdentifier 14 | $(PRODUCT_BUNDLE_IDENTIFIER) 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | $(PRODUCT_NAME) 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleURLTypes 26 | 27 | CFBundleVersion 28 | 1 29 | LSRequiresIPhoneOS 30 | 31 | NSCameraUsageDescription 32 | Take and upload photos to Cloud Storage 33 | NSContactsUsageDescription 34 | Used for Firebase Invites 35 | NSPhotoLibraryUsageDescription 36 | Upload photo to Cloud Storage 37 | UILaunchStoryboardName 38 | LaunchScreen 39 | UIMainStoryboardFile 40 | Main 41 | UIRequiredDeviceCapabilities 42 | 43 | armv7 44 | 45 | UISupportedInterfaceOrientations 46 | 47 | UIInterfaceOrientationPortrait 48 | UIInterfaceOrientationLandscapeLeft 49 | UIInterfaceOrientationLandscapeRight 50 | 51 | UISupportedInterfaceOrientations~ipad 52 | 53 | UIInterfaceOrientationPortrait 54 | UIInterfaceOrientationPortraitUpsideDown 55 | UIInterfaceOrientationLandscapeLeft 56 | UIInterfaceOrientationLandscapeRight 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/FriendlyChatSwift/MeasurementHelper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2015 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | import Firebase 18 | 19 | class MeasurementHelper: NSObject { 20 | 21 | static func sendLoginEvent() { 22 | } 23 | 24 | static func sendLogoutEvent() { 25 | } 26 | 27 | static func sendMessageEvent() { 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/FriendlyChatSwift/SignInViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2015 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | import UIKit 18 | 19 | import Firebase 20 | import GoogleSignIn 21 | 22 | @objc(SignInViewController) 23 | class SignInViewController: UIViewController { 24 | @IBOutlet weak var signInButton: GIDSignInButton! 25 | var handle: AuthStateDidChangeListenerHandle? 26 | 27 | override func viewDidLoad() { 28 | super.viewDidLoad() 29 | GIDSignIn.sharedInstance()?.presentingViewController = self 30 | GIDSignIn.sharedInstance()?.restorePreviousSignIn() 31 | handle = Auth.auth().addStateDidChangeListener() { (auth, user) in 32 | if user != nil { 33 | MeasurementHelper.sendLoginEvent() 34 | self.performSegue(withIdentifier: Constants.Segues.SignInToFp, sender: nil) 35 | } 36 | } 37 | } 38 | 39 | deinit { 40 | if let handle = handle { 41 | Auth.auth().removeStateDidChangeListener(handle) 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/Podfile: -------------------------------------------------------------------------------- 1 | # FriendlyChat Codelab 2 | 3 | use_frameworks! 4 | platform :ios, '8.0' 5 | 6 | pod 'GoogleSignIn' 7 | pod 'Firebase/Core' 8 | pod 'Firebase/DynamicLinks' 9 | pod 'Firebase/Crashlytics' 10 | pod 'Firebase/AdMob' 11 | pod 'Firebase/Auth' 12 | pod 'Firebase/Database' 13 | pod 'Firebase/InAppMessagingDisplay' 14 | pod 'Firebase/RemoteConfig' 15 | pod 'Firebase/Storage' 16 | 17 | target 'FriendlyChatSwift' do 18 | end 19 | -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Bladefile: -------------------------------------------------------------------------------- 1 | # 2 | # Uncomment below to specify your own resources. 3 | # See https://github.com/jondot/blade for more information. 4 | # 5 | 6 | blades: 7 | - source: assets/logo1024.png 8 | mount: Images.xcassets/AppIcon.appiconset 9 | contents: true 10 | - source: assets/logo1024.png 11 | mount: Images.xcassets/Logo.imageset 12 | -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-60-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-60-2x.png -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-60-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-60-3x.png -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-76-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-76-2x.png -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-76.png -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.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 | "size" : "29x29", 15 | "idiom" : "iphone", 16 | "filename" : "logo1024-iphone-29@2x.png", 17 | "scale" : "2x" 18 | }, 19 | { 20 | "size" : "29x29", 21 | "idiom" : "iphone", 22 | "filename" : "logo1024-iphone-29@3x.png", 23 | "scale" : "3x" 24 | }, 25 | { 26 | "size" : "40x40", 27 | "idiom" : "iphone", 28 | "filename" : "logo1024-iphone-40@2x.png", 29 | "scale" : "2x" 30 | }, 31 | { 32 | "size" : "40x40", 33 | "idiom" : "iphone", 34 | "filename" : "logo1024-iphone-40@3x.png", 35 | "scale" : "3x" 36 | }, 37 | { 38 | "size" : "60x60", 39 | "idiom" : "iphone", 40 | "filename" : "AppIcon-60-2x.png", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "size" : "60x60", 45 | "idiom" : "iphone", 46 | "filename" : "AppIcon-60-3x.png", 47 | "scale" : "3x" 48 | }, 49 | { 50 | "idiom" : "ipad", 51 | "size" : "20x20", 52 | "scale" : "1x" 53 | }, 54 | { 55 | "idiom" : "ipad", 56 | "size" : "20x20", 57 | "scale" : "2x" 58 | }, 59 | { 60 | "size" : "29x29", 61 | "idiom" : "ipad", 62 | "filename" : "logo1024-ipad-29@1x.png", 63 | "scale" : "1x" 64 | }, 65 | { 66 | "size" : "29x29", 67 | "idiom" : "ipad", 68 | "filename" : "logo1024-ipad-29@2x.png", 69 | "scale" : "2x" 70 | }, 71 | { 72 | "size" : "40x40", 73 | "idiom" : "ipad", 74 | "filename" : "logo1024-ipad-40@1x.png", 75 | "scale" : "1x" 76 | }, 77 | { 78 | "size" : "40x40", 79 | "idiom" : "ipad", 80 | "filename" : "logo1024-ipad-40@2x.png", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "size" : "76x76", 85 | "idiom" : "ipad", 86 | "filename" : "AppIcon-76.png", 87 | "scale" : "1x" 88 | }, 89 | { 90 | "size" : "76x76", 91 | "idiom" : "ipad", 92 | "filename" : "AppIcon-76-2x.png", 93 | "scale" : "2x" 94 | }, 95 | { 96 | "size" : "83.5x83.5", 97 | "idiom" : "ipad", 98 | "filename" : "logo1024-ipad-83@2x.png", 99 | "scale" : "2x" 100 | }, 101 | { 102 | "idiom" : "ios-marketing", 103 | "size" : "1024x1024", 104 | "scale" : "1x" 105 | } 106 | ], 107 | "info" : { 108 | "version" : 1, 109 | "author" : "xcode" 110 | } 111 | } -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-29@1x.png -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-29@2x.png -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-40@1x.png -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-40@2x.png -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-83@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-83@2x.png -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-29@2x.png -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-29@3x.png -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-40@2x.png -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-40@3x.png -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/Brand Assets.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "ipad", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "1x" 9 | }, 10 | { 11 | "orientation" : "landscape", 12 | "idiom" : "ipad", 13 | "extent" : "full-screen", 14 | "minimum-system-version" : "7.0", 15 | "scale" : "1x" 16 | }, 17 | { 18 | "orientation" : "portrait", 19 | "idiom" : "ipad", 20 | "extent" : "full-screen", 21 | "minimum-system-version" : "7.0", 22 | "scale" : "2x" 23 | }, 24 | { 25 | "orientation" : "landscape", 26 | "idiom" : "ipad", 27 | "extent" : "full-screen", 28 | "minimum-system-version" : "7.0", 29 | "scale" : "2x" 30 | } 31 | ], 32 | "info" : { 33 | "version" : 1, 34 | "author" : "xcode" 35 | } 36 | } -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/Logo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "logo1024-universal-341@1x.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "logo1024-universal-341@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "logo1024-universal-341@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/swift-starter/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@1x.png -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/swift-starter/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@2x.png -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/swift-starter/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@3x.png -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/ic_account_circle.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "ic_account_circle.png", 5 | "idiom": "universal", 6 | "scale": "1x" 7 | }, 8 | { 9 | "filename": "ic_account_circle_2x.png", 10 | "idiom": "universal", 11 | "scale": "2x" 12 | }, 13 | { 14 | "filename": "ic_account_circle_3x.png", 15 | "idiom": "universal", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "author": "xcode", 21 | "version": 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/swift-starter/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle.png -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/swift-starter/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle_2x.png -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/swift-starter/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle_3x.png -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/ic_add_a_photo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "ic_add_a_photo.png", 5 | "idiom": "universal", 6 | "scale": "1x" 7 | }, 8 | { 9 | "filename": "ic_add_a_photo_2x.png", 10 | "idiom": "universal", 11 | "scale": "2x" 12 | }, 13 | { 14 | "filename": "ic_add_a_photo_3x.png", 15 | "idiom": "universal", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "author": "xcode", 21 | "version": 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/swift-starter/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo.png -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/swift-starter/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo_2x.png -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/swift-starter/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo_3x.png -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/LaunchScreen.xib: -------------------------------------------------------------------------------- 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 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /grow-ios-starter/swift-starter/shared/assets/logo1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/grow-ios-starter/swift-starter/shared/assets/logo1024.png -------------------------------------------------------------------------------- /initial_messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "messages" : { 3 | "-K2ib4H77rj0LYewF7dP" : { 4 | "text" : "Hello", 5 | "name" : "anonymous" 6 | }, 7 | "-K2ib5JHRbbL0NrztUfO" : { 8 | "text" : "How are you", 9 | "name" : "anonymous" 10 | }, 11 | "-K2ib62mjHh34CAUbide" : { 12 | "text" : "I am fine", 13 | "name" : "anonymous" 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ios-starter/objc-starter/FriendlyChatObjC/.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: Google 2 | ColumnLimit: 100 3 | BinPackParameters: false 4 | AllowAllParametersOfDeclarationOnNextLine: true 5 | -------------------------------------------------------------------------------- /ios-starter/objc-starter/FriendlyChatObjC/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | @import UIKit; 18 | @import GoogleSignIn; 19 | 20 | @interface AppDelegate : UIResponder 21 | 22 | @property (strong, nonatomic) UIWindow *window; 23 | 24 | 25 | @end 26 | 27 | -------------------------------------------------------------------------------- /ios-starter/objc-starter/FriendlyChatObjC/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import "AppDelegate.h" 18 | 19 | @import Firebase; 20 | @import GoogleSignIn; 21 | 22 | @implementation AppDelegate 23 | 24 | - (BOOL)application:(nonnull UIApplication *)application 25 | openURL:(nonnull NSURL *)url 26 | options:(nonnull NSDictionary *)options { 27 | return [self application:application 28 | openURL:url 29 | sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey] 30 | annotation:options[UIApplicationOpenURLOptionsAnnotationKey]]; 31 | } 32 | 33 | - (BOOL)application:(UIApplication *)application 34 | openURL:(NSURL *)url 35 | sourceApplication:(NSString *)sourceApplication 36 | annotation:(id)annotation { 37 | return [[GIDSignIn sharedInstance] handleURL:url]; 38 | } 39 | 40 | - (void)signIn:(GIDSignIn *)signIn 41 | didSignInForUser:(GIDGoogleUser *)user 42 | withError:(NSError *)error { 43 | if (error == nil) { 44 | } else { 45 | NSLog(@"Error %@", error.localizedDescription); 46 | } 47 | } 48 | 49 | - (BOOL)application:(UIApplication *)application 50 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 51 | [GIDSignIn sharedInstance].delegate = self; 52 | return YES; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /ios-starter/objc-starter/FriendlyChatObjC/Constants.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | 19 | @interface Constants : NSObject 20 | 21 | extern NSString *const NotificationKeysSignedIn; 22 | 23 | extern NSString *const SeguesSignInToFp; 24 | extern NSString *const SeguesFpToSignIn; 25 | 26 | extern NSString *const MessageFieldsname; 27 | extern NSString *const MessageFieldstext; 28 | extern NSString *const MessageFieldsphotoURL; 29 | extern NSString *const MessageFieldsimageURL; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /ios-starter/objc-starter/FriendlyChatObjC/Constants.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import "Constants.h" 18 | 19 | @implementation Constants 20 | 21 | NSString *const NotificationKeysSignedIn = @"onSignInCompleted"; 22 | 23 | NSString *const SeguesSignInToFp = @"SignInToFP"; 24 | NSString *const SeguesFpToSignIn = @"FPToSignIn"; 25 | 26 | NSString *const MessageFieldsname = @"name"; 27 | NSString *const MessageFieldstext = @"text"; 28 | NSString *const MessageFieldsphotoURL = @"photoUrl"; 29 | NSString *const MessageFieldsimageURL = @"imageUrl"; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /ios-starter/objc-starter/FriendlyChatObjC/FCViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | @import UIKit; 18 | 19 | @interface FCViewController : UIViewController 20 | 21 | @end 22 | 23 | -------------------------------------------------------------------------------- /ios-starter/objc-starter/FriendlyChatObjC/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | GADIsAdManagerApp 6 | 7 | NSContactsUsageDescription 8 | Used for Firebase Invites 9 | NSCameraUsageDescription 10 | Take and upload photos to Cloud Storage 11 | NSPhotoLibraryUsageDescription 12 | Upload photo to Cloud Storage 13 | CFBundleDevelopmentRegion 14 | en 15 | CFBundleExecutable 16 | $(EXECUTABLE_NAME) 17 | CFBundleIcons 18 | 19 | CFBundleIcons~ipad 20 | 21 | CFBundleIdentifier 22 | $(PRODUCT_BUNDLE_IDENTIFIER) 23 | CFBundleInfoDictionaryVersion 24 | 6.0 25 | CFBundleName 26 | $(PRODUCT_NAME) 27 | CFBundlePackageType 28 | APPL 29 | CFBundleShortVersionString 30 | 1.0 31 | CFBundleSignature 32 | ???? 33 | CFBundleURLTypes 34 | 35 | 36 | CFBundleTypeRole 37 | Editor 38 | CFBundleURLSchemes 39 | 40 | REVERSED_CLIENT_ID 41 | 42 | 43 | 44 | CFBundleVersion 45 | 1 46 | LSRequiresIPhoneOS 47 | 48 | UIBackgroundModes 49 | 50 | remote-notification 51 | 52 | UILaunchStoryboardName 53 | LaunchScreen 54 | UIMainStoryboardFile 55 | Main 56 | UIRequiredDeviceCapabilities 57 | 58 | armv7 59 | 60 | UISupportedInterfaceOrientations 61 | 62 | UIInterfaceOrientationPortrait 63 | UIInterfaceOrientationLandscapeLeft 64 | UIInterfaceOrientationLandscapeRight 65 | 66 | UISupportedInterfaceOrientations~ipad 67 | 68 | UIInterfaceOrientationPortrait 69 | UIInterfaceOrientationPortraitUpsideDown 70 | UIInterfaceOrientationLandscapeLeft 71 | UIInterfaceOrientationLandscapeRight 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /ios-starter/objc-starter/FriendlyChatObjC/MeasurementHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | 19 | @interface MeasurementHelper : NSObject 20 | 21 | + (void)sendLoginEvent; 22 | + (void)sendLogoutEvent; 23 | + (void)sendMessageEvent; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /ios-starter/objc-starter/FriendlyChatObjC/MeasurementHelper.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import "MeasurementHelper.h" 18 | 19 | @import Firebase; 20 | 21 | @implementation MeasurementHelper 22 | 23 | + (void)sendLoginEvent { 24 | } 25 | 26 | + (void)sendLogoutEvent { 27 | } 28 | 29 | + (void)sendMessageEvent{ 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /ios-starter/objc-starter/FriendlyChatObjC/SignInViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | @import UIKit; 18 | @import GoogleSignIn; 19 | 20 | @interface SignInViewController : UIViewController 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /ios-starter/objc-starter/FriendlyChatObjC/SignInViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import "Constants.h" 18 | #import "MeasurementHelper.h" 19 | #import "SignInViewController.h" 20 | 21 | @import Firebase; 22 | 23 | @interface SignInViewController () 24 | @property(weak, nonatomic) IBOutlet GIDSignInButton *signInButton; 25 | @property(strong, nonatomic) FIRAuthStateDidChangeListenerHandle handle; 26 | @end 27 | 28 | @implementation SignInViewController 29 | 30 | - (void)viewDidLoad { 31 | [super viewDidLoad]; 32 | [GIDSignIn sharedInstance].presentingViewController = self; 33 | } 34 | 35 | - (void)dealloc { 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /ios-starter/objc-starter/FriendlyChatObjC/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | #import "AppDelegate.h" 19 | 20 | int main(int argc, char * argv[]) { 21 | @autoreleasepool { 22 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ios-starter/objc-starter/Podfile: -------------------------------------------------------------------------------- 1 | # FriendlyChat Codelab 2 | use_frameworks! 3 | 4 | platform :ios, '9.0' 5 | 6 | pod 'Firebase/AdMob' 7 | pod 'Firebase/Analytics' 8 | pod 'Firebase/Auth' 9 | pod 'Firebase/Database' 10 | pod 'Firebase/RemoteConfig' 11 | pod 'Firebase/Storage' 12 | pod 'Firebase/Crashlytics' 13 | pod 'GoogleSignIn' 14 | 15 | target 'FriendlyChatObjC' do 16 | end 17 | -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Bladefile: -------------------------------------------------------------------------------- 1 | # 2 | # Uncomment below to specify your own resources. 3 | # See https://github.com/jondot/blade for more information. 4 | # 5 | 6 | blades: 7 | - source: assets/logo1024.png 8 | mount: Images.xcassets/AppIcon.appiconset 9 | contents: true 10 | - source: assets/logo1024.png 11 | mount: Images.xcassets/Logo.imageset 12 | -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-60-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-60-2x.png -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-60-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-60-3x.png -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-76-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-76-2x.png -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-76.png -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "logo1024-iphone-29@2x.png", 5 | "idiom": "iphone", 6 | "scale": "2x", 7 | "size": "29x29" 8 | }, 9 | { 10 | "filename": "logo1024-iphone-29@3x.png", 11 | "idiom": "iphone", 12 | "scale": "3x", 13 | "size": "29x29" 14 | }, 15 | { 16 | "filename": "logo1024-iphone-40@2x.png", 17 | "idiom": "iphone", 18 | "scale": "2x", 19 | "size": "40x40" 20 | }, 21 | { 22 | "filename": "logo1024-iphone-40@3x.png", 23 | "idiom": "iphone", 24 | "scale": "3x", 25 | "size": "40x40" 26 | }, 27 | { 28 | "filename": "AppIcon-60-2x.png", 29 | "idiom": "iphone", 30 | "scale": "2x", 31 | "size": "60x60" 32 | }, 33 | { 34 | "filename": "AppIcon-60-3x.png", 35 | "idiom": "iphone", 36 | "scale": "3x", 37 | "size": "60x60" 38 | }, 39 | { 40 | "filename": "logo1024-ipad-29@1x.png", 41 | "idiom": "ipad", 42 | "scale": "1x", 43 | "size": "29x29" 44 | }, 45 | { 46 | "filename": "logo1024-ipad-29@2x.png", 47 | "idiom": "ipad", 48 | "scale": "2x", 49 | "size": "29x29" 50 | }, 51 | { 52 | "filename": "logo1024-ipad-40@1x.png", 53 | "idiom": "ipad", 54 | "scale": "1x", 55 | "size": "40x40" 56 | }, 57 | { 58 | "filename": "logo1024-ipad-40@2x.png", 59 | "idiom": "ipad", 60 | "scale": "2x", 61 | "size": "40x40" 62 | }, 63 | { 64 | "filename": "AppIcon-76.png", 65 | "idiom": "ipad", 66 | "scale": "1x", 67 | "size": "76x76" 68 | }, 69 | { 70 | "filename": "AppIcon-76-2x.png", 71 | "idiom": "ipad", 72 | "scale": "2x", 73 | "size": "76x76" 74 | }, 75 | { 76 | "filename": "logo1024-ipad-83@2x.png", 77 | "idiom": "ipad", 78 | "scale": "2x", 79 | "size": "83.5x83.5" 80 | } 81 | ], 82 | "info": { 83 | "author": "xcode", 84 | "version": 1 85 | } 86 | } -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-29@1x.png -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-29@2x.png -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-40@1x.png -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-40@2x.png -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-83@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-83@2x.png -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-29@2x.png -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-29@3x.png -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-40@2x.png -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/objc-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-40@3x.png -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/Brand Assets.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "ipad", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "1x" 9 | }, 10 | { 11 | "orientation" : "landscape", 12 | "idiom" : "ipad", 13 | "extent" : "full-screen", 14 | "minimum-system-version" : "7.0", 15 | "scale" : "1x" 16 | }, 17 | { 18 | "orientation" : "portrait", 19 | "idiom" : "ipad", 20 | "extent" : "full-screen", 21 | "minimum-system-version" : "7.0", 22 | "scale" : "2x" 23 | }, 24 | { 25 | "orientation" : "landscape", 26 | "idiom" : "ipad", 27 | "extent" : "full-screen", 28 | "minimum-system-version" : "7.0", 29 | "scale" : "2x" 30 | } 31 | ], 32 | "info" : { 33 | "version" : 1, 34 | "author" : "xcode" 35 | } 36 | } -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/Logo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "logo1024-universal-341@1x.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "logo1024-universal-341@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "logo1024-universal-341@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/objc-starter/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@1x.png -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/objc-starter/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@2x.png -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/objc-starter/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@3x.png -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/ic_account_circle.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "ic_account_circle.png", 5 | "idiom": "universal", 6 | "scale": "1x" 7 | }, 8 | { 9 | "filename": "ic_account_circle_2x.png", 10 | "idiom": "universal", 11 | "scale": "2x" 12 | }, 13 | { 14 | "filename": "ic_account_circle_3x.png", 15 | "idiom": "universal", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "author": "xcode", 21 | "version": 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/objc-starter/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle.png -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/objc-starter/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle_2x.png -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/objc-starter/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle_3x.png -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/ic_add_a_photo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "ic_add_a_photo.png", 5 | "idiom": "universal", 6 | "scale": "1x" 7 | }, 8 | { 9 | "filename": "ic_add_a_photo_2x.png", 10 | "idiom": "universal", 11 | "scale": "2x" 12 | }, 13 | { 14 | "filename": "ic_add_a_photo_3x.png", 15 | "idiom": "universal", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "author": "xcode", 21 | "version": 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/objc-starter/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo.png -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/objc-starter/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo_2x.png -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/objc-starter/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo_3x.png -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/LaunchScreen.xib: -------------------------------------------------------------------------------- 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 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /ios-starter/objc-starter/shared/assets/logo1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/objc-starter/shared/assets/logo1024.png -------------------------------------------------------------------------------- /ios-starter/swift-starter/FriendlyChatSwift/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2015 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | import UIKit 18 | 19 | import Firebase 20 | import GoogleSignIn 21 | 22 | @UIApplicationMain 23 | class AppDelegate: UIResponder, UIApplicationDelegate, GIDSignInDelegate { 24 | 25 | var window: UIWindow? 26 | 27 | @available(iOS 9.0, *) 28 | func application(_ application: UIApplication, 29 | open url: URL, 30 | options: [UIApplication.OpenURLOptionsKey : Any]) 31 | -> Bool { 32 | return GIDSignIn.sharedInstance().handle(url) 33 | } 34 | 35 | func application(_ application: UIApplication, 36 | open url: URL, 37 | sourceApplication: String?, 38 | annotation: Any) -> Bool { 39 | return GIDSignIn.sharedInstance().handle(url) 40 | } 41 | 42 | func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error?) { 43 | if let error = error { 44 | print("Error \(error)") 45 | return 46 | } 47 | } 48 | 49 | func application(_ application: UIApplication, didFinishLaunchingWithOptions 50 | launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 51 | GIDSignIn.sharedInstance().delegate = self 52 | return true 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /ios-starter/swift-starter/FriendlyChatSwift/Constants.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2015 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | struct Constants { 18 | 19 | struct NotificationKeys { 20 | static let SignedIn = "onSignInCompleted" 21 | } 22 | 23 | struct Segues { 24 | static let SignInToFp = "SignInToFP" 25 | static let FpToSignIn = "FPToSignIn" 26 | } 27 | 28 | struct MessageFields { 29 | static let name = "name" 30 | static let text = "text" 31 | static let photoURL = "photoUrl" 32 | static let imageURL = "imageUrl" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ios-starter/swift-starter/FriendlyChatSwift/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | GADIsAdManagerApp 6 | 7 | NSContactsUsageDescription 8 | Used for Firebase Invites 9 | NSCameraUsageDescription 10 | Take and upload photos to Cloud Storage 11 | NSPhotoLibraryUsageDescription 12 | Upload photo to Cloud Storage 13 | CFBundleDevelopmentRegion 14 | en 15 | CFBundleExecutable 16 | $(EXECUTABLE_NAME) 17 | CFBundleIcons 18 | 19 | CFBundleIcons~ipad 20 | 21 | CFBundleIdentifier 22 | $(PRODUCT_BUNDLE_IDENTIFIER) 23 | CFBundleInfoDictionaryVersion 24 | 6.0 25 | CFBundleName 26 | $(PRODUCT_NAME) 27 | CFBundlePackageType 28 | APPL 29 | CFBundleShortVersionString 30 | 1.0 31 | CFBundleSignature 32 | ???? 33 | CFBundleVersion 34 | 1 35 | LSRequiresIPhoneOS 36 | 37 | UIBackgroundModes 38 | 39 | remote-notification 40 | 41 | UILaunchStoryboardName 42 | LaunchScreen 43 | UIMainStoryboardFile 44 | Main 45 | UIRequiredDeviceCapabilities 46 | 47 | armv7 48 | 49 | UISupportedInterfaceOrientations 50 | 51 | UIInterfaceOrientationPortrait 52 | UIInterfaceOrientationLandscapeLeft 53 | UIInterfaceOrientationLandscapeRight 54 | 55 | UISupportedInterfaceOrientations~ipad 56 | 57 | UIInterfaceOrientationPortrait 58 | UIInterfaceOrientationPortraitUpsideDown 59 | UIInterfaceOrientationLandscapeLeft 60 | UIInterfaceOrientationLandscapeRight 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /ios-starter/swift-starter/FriendlyChatSwift/MeasurementHelper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2015 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | import Firebase 18 | 19 | class MeasurementHelper: NSObject { 20 | 21 | static func sendLoginEvent() { 22 | } 23 | 24 | static func sendLogoutEvent() { 25 | } 26 | 27 | static func sendMessageEvent() { 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ios-starter/swift-starter/FriendlyChatSwift/SignInViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2015 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | import UIKit 18 | 19 | import Firebase 20 | import GoogleSignIn 21 | 22 | @objc(SignInViewController) 23 | class SignInViewController: UIViewController { 24 | @IBOutlet weak var signInButton: GIDSignInButton! 25 | var handle: AuthStateDidChangeListenerHandle? 26 | 27 | override func viewDidLoad() { 28 | super.viewDidLoad() 29 | GIDSignIn.sharedInstance()?.presentingViewController = self 30 | } 31 | 32 | deinit { 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ios-starter/swift-starter/Podfile: -------------------------------------------------------------------------------- 1 | # FriendlyChat Codelab 2 | 3 | use_frameworks! 4 | platform :ios, '9.0' 5 | 6 | pod 'Firebase/AdMob' 7 | pod 'Firebase/Analytics' 8 | pod 'Firebase/Auth' 9 | pod 'Firebase/Database' 10 | pod 'Firebase/RemoteConfig' 11 | pod 'Firebase/Storage' 12 | pod 'Firebase/Crashlytics' 13 | pod 'GoogleSignIn' 14 | 15 | target 'FriendlyChatSwift' do 16 | end 17 | -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Bladefile: -------------------------------------------------------------------------------- 1 | # 2 | # Uncomment below to specify your own resources. 3 | # See https://github.com/jondot/blade for more information. 4 | # 5 | 6 | blades: 7 | - source: assets/logo1024.png 8 | mount: Images.xcassets/AppIcon.appiconset 9 | contents: true 10 | - source: assets/logo1024.png 11 | mount: Images.xcassets/Logo.imageset 12 | -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-60-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-60-2x.png -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-60-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-60-3x.png -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-76-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-76-2x.png -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/AppIcon-76.png -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "logo1024-iphone-29@2x.png", 5 | "idiom": "iphone", 6 | "scale": "2x", 7 | "size": "29x29" 8 | }, 9 | { 10 | "filename": "logo1024-iphone-29@3x.png", 11 | "idiom": "iphone", 12 | "scale": "3x", 13 | "size": "29x29" 14 | }, 15 | { 16 | "filename": "logo1024-iphone-40@2x.png", 17 | "idiom": "iphone", 18 | "scale": "2x", 19 | "size": "40x40" 20 | }, 21 | { 22 | "filename": "logo1024-iphone-40@3x.png", 23 | "idiom": "iphone", 24 | "scale": "3x", 25 | "size": "40x40" 26 | }, 27 | { 28 | "filename": "AppIcon-60-2x.png", 29 | "idiom": "iphone", 30 | "scale": "2x", 31 | "size": "60x60" 32 | }, 33 | { 34 | "filename": "AppIcon-60-3x.png", 35 | "idiom": "iphone", 36 | "scale": "3x", 37 | "size": "60x60" 38 | }, 39 | { 40 | "filename": "logo1024-ipad-29@1x.png", 41 | "idiom": "ipad", 42 | "scale": "1x", 43 | "size": "29x29" 44 | }, 45 | { 46 | "filename": "logo1024-ipad-29@2x.png", 47 | "idiom": "ipad", 48 | "scale": "2x", 49 | "size": "29x29" 50 | }, 51 | { 52 | "filename": "logo1024-ipad-40@1x.png", 53 | "idiom": "ipad", 54 | "scale": "1x", 55 | "size": "40x40" 56 | }, 57 | { 58 | "filename": "logo1024-ipad-40@2x.png", 59 | "idiom": "ipad", 60 | "scale": "2x", 61 | "size": "40x40" 62 | }, 63 | { 64 | "filename": "AppIcon-76.png", 65 | "idiom": "ipad", 66 | "scale": "1x", 67 | "size": "76x76" 68 | }, 69 | { 70 | "filename": "AppIcon-76-2x.png", 71 | "idiom": "ipad", 72 | "scale": "2x", 73 | "size": "76x76" 74 | }, 75 | { 76 | "filename": "logo1024-ipad-83@2x.png", 77 | "idiom": "ipad", 78 | "scale": "2x", 79 | "size": "83.5x83.5" 80 | } 81 | ], 82 | "info": { 83 | "author": "xcode", 84 | "version": 1 85 | } 86 | } -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-29@1x.png -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-29@2x.png -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-40@1x.png -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-40@2x.png -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-83@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-83@2x.png -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-29@2x.png -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-29@3x.png -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-40@2x.png -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/swift-starter/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-40@3x.png -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/Brand Assets.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "ipad", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "1x" 9 | }, 10 | { 11 | "orientation" : "landscape", 12 | "idiom" : "ipad", 13 | "extent" : "full-screen", 14 | "minimum-system-version" : "7.0", 15 | "scale" : "1x" 16 | }, 17 | { 18 | "orientation" : "portrait", 19 | "idiom" : "ipad", 20 | "extent" : "full-screen", 21 | "minimum-system-version" : "7.0", 22 | "scale" : "2x" 23 | }, 24 | { 25 | "orientation" : "landscape", 26 | "idiom" : "ipad", 27 | "extent" : "full-screen", 28 | "minimum-system-version" : "7.0", 29 | "scale" : "2x" 30 | } 31 | ], 32 | "info" : { 33 | "version" : 1, 34 | "author" : "xcode" 35 | } 36 | } -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/Logo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "logo1024-universal-341@1x.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "logo1024-universal-341@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "logo1024-universal-341@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/swift-starter/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@1x.png -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/swift-starter/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@2x.png -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/swift-starter/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@3x.png -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/ic_account_circle.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "ic_account_circle.png", 5 | "idiom": "universal", 6 | "scale": "1x" 7 | }, 8 | { 9 | "filename": "ic_account_circle_2x.png", 10 | "idiom": "universal", 11 | "scale": "2x" 12 | }, 13 | { 14 | "filename": "ic_account_circle_3x.png", 15 | "idiom": "universal", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "author": "xcode", 21 | "version": 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/swift-starter/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle.png -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/swift-starter/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle_2x.png -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/swift-starter/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle_3x.png -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/ic_add_a_photo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "ic_add_a_photo.png", 5 | "idiom": "universal", 6 | "scale": "1x" 7 | }, 8 | { 9 | "filename": "ic_add_a_photo_2x.png", 10 | "idiom": "universal", 11 | "scale": "2x" 12 | }, 13 | { 14 | "filename": "ic_add_a_photo_3x.png", 15 | "idiom": "universal", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "author": "xcode", 21 | "version": 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/swift-starter/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo.png -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/swift-starter/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo_2x.png -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/swift-starter/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo_3x.png -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/LaunchScreen.xib: -------------------------------------------------------------------------------- 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 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /ios-starter/swift-starter/shared/assets/logo1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios-starter/swift-starter/shared/assets/logo1024.png -------------------------------------------------------------------------------- /ios/info_script.rb: -------------------------------------------------------------------------------- 1 | require 'xcodeproj' 2 | language = ARGV[0] 3 | project_path = "FriendlyChat#{language}.xcodeproj" 4 | project = Xcodeproj::Project.open(project_path) 5 | 6 | # Add a file to the project in the main group 7 | file_name = 'GoogleService-Info.plist' 8 | file = project.new_file(file_name) 9 | 10 | # Add the file to the all targets 11 | project.targets.each do |target| 12 | target.add_file_references([file]) 13 | end 14 | 15 | #save project 16 | project.save() 17 | -------------------------------------------------------------------------------- /ios/mock-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 | API_KEY 10 | AIzaSyAzlj4APqi5S58nFtE52Da-fYBOHA2MhaY 11 | BUNDLE_ID 12 | id 13 | CLIENT_ID 14 | 123456789000-hjugbg6ud799v4c49dim8ce2usclthar.apps.googleusercontent.com 15 | DATABASE_URL 16 | https://mockproject-1234.firebaseio.com 17 | GCM_SENDER_ID 18 | 123456789000 19 | GOOGLE_APP_ID 20 | 1:123456789000:ios:f1bf012572b04063 21 | IS_ADS_ENABLED 22 | 23 | IS_ANALYTICS_ENABLED 24 | 25 | IS_APPINVITE_ENABLED 26 | 27 | IS_GCM_ENABLED 28 | 29 | IS_SIGNIN_ENABLED 30 | 31 | PLIST_VERSION 32 | 1 33 | PROJECT_ID 34 | mockproject-1234 35 | REVERSED_CLIENT_ID 36 | com.googleusercontent.apps.123456789000-hjugbg6ud799v4c49dim8ce2usclthar 37 | STORAGE_BUCKET 38 | mockproject-1234.appspot.com 39 | 40 | 41 | -------------------------------------------------------------------------------- /ios/objc/FriendlyChatObjC/.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: Google 2 | ColumnLimit: 100 3 | BinPackParameters: false 4 | AllowAllParametersOfDeclarationOnNextLine: true 5 | -------------------------------------------------------------------------------- /ios/objc/FriendlyChatObjC/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | @import UIKit; 18 | @import GoogleSignIn; 19 | 20 | @interface AppDelegate : UIResponder 21 | 22 | @property (strong, nonatomic) UIWindow *window; 23 | 24 | @end 25 | 26 | -------------------------------------------------------------------------------- /ios/objc/FriendlyChatObjC/Constants.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | 19 | @interface Constants : NSObject 20 | 21 | extern NSString *const NotificationKeysSignedIn; 22 | 23 | extern NSString *const SeguesSignInToFp; 24 | extern NSString *const SeguesFpToSignIn; 25 | 26 | extern NSString *const MessageFieldsname; 27 | extern NSString *const MessageFieldstext; 28 | extern NSString *const MessageFieldsphotoURL; 29 | extern NSString *const MessageFieldsimageURL; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /ios/objc/FriendlyChatObjC/Constants.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import "Constants.h" 18 | 19 | @implementation Constants 20 | 21 | NSString *const NotificationKeysSignedIn = @"onSignInCompleted"; 22 | 23 | NSString *const SeguesSignInToFp = @"SignInToFP"; 24 | NSString *const SeguesFpToSignIn = @"FPToSignIn"; 25 | 26 | NSString *const MessageFieldsname = @"name"; 27 | NSString *const MessageFieldstext = @"text"; 28 | NSString *const MessageFieldsphotoURL = @"photoUrl"; 29 | NSString *const MessageFieldsimageURL = @"imageUrl"; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /ios/objc/FriendlyChatObjC/FCViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | @import UIKit; 18 | 19 | @interface FCViewController : UIViewController 20 | 21 | @end 22 | 23 | -------------------------------------------------------------------------------- /ios/objc/FriendlyChatObjC/FriendlyChatObjC.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | aps-environment 6 | development 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/objc/FriendlyChatObjC/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | GADIsAdManagerApp 6 | 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIcons 12 | 13 | CFBundleIcons~ipad 14 | 15 | CFBundleIdentifier 16 | $(PRODUCT_BUNDLE_IDENTIFIER) 17 | CFBundleInfoDictionaryVersion 18 | 6.0 19 | CFBundleName 20 | $(PRODUCT_NAME) 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | 1.0 25 | CFBundleSignature 26 | ???? 27 | CFBundleURLTypes 28 | 29 | 30 | CFBundleTypeRole 31 | Editor 32 | CFBundleURLSchemes 33 | 34 | REVERSED_CLIENT_ID 35 | 36 | 37 | 38 | CFBundleVersion 39 | 1 40 | LSRequiresIPhoneOS 41 | 42 | NSCameraUsageDescription 43 | Take and upload photos to Firebase Storage 44 | NSContactsUsageDescription 45 | Used for Firebase Invites 46 | NSPhotoLibraryUsageDescription 47 | Upload photo to Firebase Storage 48 | UIBackgroundModes 49 | 50 | remote-notification 51 | 52 | UILaunchStoryboardName 53 | LaunchScreen 54 | UIMainStoryboardFile 55 | Main 56 | UIRequiredDeviceCapabilities 57 | 58 | armv7 59 | 60 | UISupportedInterfaceOrientations 61 | 62 | UIInterfaceOrientationPortrait 63 | UIInterfaceOrientationLandscapeLeft 64 | UIInterfaceOrientationLandscapeRight 65 | 66 | UISupportedInterfaceOrientations~ipad 67 | 68 | UIInterfaceOrientationPortrait 69 | UIInterfaceOrientationPortraitUpsideDown 70 | UIInterfaceOrientationLandscapeLeft 71 | UIInterfaceOrientationLandscapeRight 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /ios/objc/FriendlyChatObjC/MeasurementHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | 19 | @interface MeasurementHelper : NSObject 20 | 21 | + (void)sendLoginEvent; 22 | + (void)sendLogoutEvent; 23 | + (void)sendMessageEvent; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /ios/objc/FriendlyChatObjC/MeasurementHelper.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import "MeasurementHelper.h" 18 | 19 | @import Firebase; 20 | 21 | @implementation MeasurementHelper 22 | 23 | + (void)sendLoginEvent { 24 | [FIRAnalytics logEventWithName:kFIREventLogin parameters:nil]; 25 | } 26 | 27 | + (void)sendLogoutEvent { 28 | [FIRAnalytics logEventWithName:@"logout" parameters:nil]; 29 | } 30 | 31 | + (void)sendMessageEvent{ 32 | [FIRAnalytics logEventWithName:@"message" parameters:nil]; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /ios/objc/FriendlyChatObjC/SignInViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | @import UIKit; 18 | @import GoogleSignIn; 19 | 20 | @interface SignInViewController : UIViewController 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /ios/objc/FriendlyChatObjC/SignInViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import "Constants.h" 18 | #import "MeasurementHelper.h" 19 | #import "SignInViewController.h" 20 | 21 | @import Firebase; 22 | 23 | @interface SignInViewController () 24 | @property(weak, nonatomic) IBOutlet GIDSignInButton *signInButton; 25 | @property(strong, nonatomic) FIRAuthStateDidChangeListenerHandle handle; 26 | @end 27 | 28 | @implementation SignInViewController 29 | 30 | - (void)viewDidLoad { 31 | [super viewDidLoad]; 32 | [GIDSignIn sharedInstance].presentingViewController = self; 33 | [[GIDSignIn sharedInstance] restorePreviousSignIn]; 34 | self.handle = [[FIRAuth auth] 35 | addAuthStateDidChangeListener:^(FIRAuth *_Nonnull auth, FIRUser *_Nullable user) { 36 | if (user) { 37 | [MeasurementHelper sendLoginEvent]; 38 | [self performSegueWithIdentifier:SeguesSignInToFp sender:nil]; 39 | } 40 | }]; 41 | } 42 | 43 | - (void)dealloc { 44 | [[FIRAuth auth] removeAuthStateDidChangeListener:_handle]; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /ios/objc/FriendlyChatObjC/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | #import "AppDelegate.h" 19 | 20 | int main(int argc, char * argv[]) { 21 | @autoreleasepool { 22 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ios/objc/Podfile: -------------------------------------------------------------------------------- 1 | # FriendlyChat Codelab 2 | 3 | platform :ios, '9.0' 4 | use_frameworks! 5 | 6 | pod 'Firebase/AdMob' 7 | pod 'Firebase/Analytics' 8 | pod 'Firebase/Auth' 9 | pod 'Firebase/Database' 10 | pod 'Firebase/Messaging' 11 | pod 'Firebase/RemoteConfig' 12 | pod 'Firebase/Storage' 13 | pod 'Firebase/Crashlytics' 14 | pod 'GoogleSignIn' 15 | 16 | target 'FriendlyChatObjC' do 17 | end 18 | -------------------------------------------------------------------------------- /ios/objc/shared/Bladefile: -------------------------------------------------------------------------------- 1 | # 2 | # Uncomment below to specify your own resources. 3 | # See https://github.com/jondot/blade for more information. 4 | # 5 | 6 | blades: 7 | - source: assets/logo1024.png 8 | mount: Images.xcassets/AppIcon.appiconset 9 | contents: true 10 | - source: assets/logo1024.png 11 | mount: Images.xcassets/Logo.imageset 12 | -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/AppIcon.appiconset/AppIcon-60-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/objc/shared/Images.xcassets/AppIcon.appiconset/AppIcon-60-2x.png -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/AppIcon.appiconset/AppIcon-60-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/objc/shared/Images.xcassets/AppIcon.appiconset/AppIcon-60-3x.png -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/AppIcon.appiconset/AppIcon-76-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/objc/shared/Images.xcassets/AppIcon.appiconset/AppIcon-76-2x.png -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/AppIcon.appiconset/AppIcon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/objc/shared/Images.xcassets/AppIcon.appiconset/AppIcon-76.png -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "logo1024-iphone-29@2x.png", 5 | "idiom": "iphone", 6 | "scale": "2x", 7 | "size": "29x29" 8 | }, 9 | { 10 | "filename": "logo1024-iphone-29@3x.png", 11 | "idiom": "iphone", 12 | "scale": "3x", 13 | "size": "29x29" 14 | }, 15 | { 16 | "filename": "logo1024-iphone-40@2x.png", 17 | "idiom": "iphone", 18 | "scale": "2x", 19 | "size": "40x40" 20 | }, 21 | { 22 | "filename": "logo1024-iphone-40@3x.png", 23 | "idiom": "iphone", 24 | "scale": "3x", 25 | "size": "40x40" 26 | }, 27 | { 28 | "filename": "AppIcon-60-2x.png", 29 | "idiom": "iphone", 30 | "scale": "2x", 31 | "size": "60x60" 32 | }, 33 | { 34 | "filename": "AppIcon-60-3x.png", 35 | "idiom": "iphone", 36 | "scale": "3x", 37 | "size": "60x60" 38 | }, 39 | { 40 | "filename": "logo1024-ipad-29@1x.png", 41 | "idiom": "ipad", 42 | "scale": "1x", 43 | "size": "29x29" 44 | }, 45 | { 46 | "filename": "logo1024-ipad-29@2x.png", 47 | "idiom": "ipad", 48 | "scale": "2x", 49 | "size": "29x29" 50 | }, 51 | { 52 | "filename": "logo1024-ipad-40@1x.png", 53 | "idiom": "ipad", 54 | "scale": "1x", 55 | "size": "40x40" 56 | }, 57 | { 58 | "filename": "logo1024-ipad-40@2x.png", 59 | "idiom": "ipad", 60 | "scale": "2x", 61 | "size": "40x40" 62 | }, 63 | { 64 | "filename": "AppIcon-76.png", 65 | "idiom": "ipad", 66 | "scale": "1x", 67 | "size": "76x76" 68 | }, 69 | { 70 | "filename": "AppIcon-76-2x.png", 71 | "idiom": "ipad", 72 | "scale": "2x", 73 | "size": "76x76" 74 | }, 75 | { 76 | "filename": "logo1024-ipad-83@2x.png", 77 | "idiom": "ipad", 78 | "scale": "2x", 79 | "size": "83.5x83.5" 80 | } 81 | ], 82 | "info": { 83 | "author": "xcode", 84 | "version": 1 85 | } 86 | } -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/objc/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-29@1x.png -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/objc/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-29@2x.png -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/objc/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-40@1x.png -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/objc/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-40@2x.png -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-83@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/objc/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-83@2x.png -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/objc/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-29@2x.png -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/objc/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-29@3x.png -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/objc/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-40@2x.png -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/objc/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-40@3x.png -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/Brand Assets.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "ipad", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "1x" 9 | }, 10 | { 11 | "orientation" : "landscape", 12 | "idiom" : "ipad", 13 | "extent" : "full-screen", 14 | "minimum-system-version" : "7.0", 15 | "scale" : "1x" 16 | }, 17 | { 18 | "orientation" : "portrait", 19 | "idiom" : "ipad", 20 | "extent" : "full-screen", 21 | "minimum-system-version" : "7.0", 22 | "scale" : "2x" 23 | }, 24 | { 25 | "orientation" : "landscape", 26 | "idiom" : "ipad", 27 | "extent" : "full-screen", 28 | "minimum-system-version" : "7.0", 29 | "scale" : "2x" 30 | } 31 | ], 32 | "info" : { 33 | "version" : 1, 34 | "author" : "xcode" 35 | } 36 | } -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/Logo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "logo1024-universal-341@1x.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "logo1024-universal-341@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "logo1024-universal-341@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/objc/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@1x.png -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/objc/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@2x.png -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/objc/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@3x.png -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/ic_account_circle.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "ic_account_circle.png", 5 | "idiom": "universal", 6 | "scale": "1x" 7 | }, 8 | { 9 | "filename": "ic_account_circle_2x.png", 10 | "idiom": "universal", 11 | "scale": "2x" 12 | }, 13 | { 14 | "filename": "ic_account_circle_3x.png", 15 | "idiom": "universal", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "author": "xcode", 21 | "version": 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/objc/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle.png -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/objc/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle_2x.png -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/objc/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle_3x.png -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/ic_add_a_photo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "ic_add_a_photo.png", 5 | "idiom": "universal", 6 | "scale": "1x" 7 | }, 8 | { 9 | "filename": "ic_add_a_photo_2x.png", 10 | "idiom": "universal", 11 | "scale": "2x" 12 | }, 13 | { 14 | "filename": "ic_add_a_photo_3x.png", 15 | "idiom": "universal", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "author": "xcode", 21 | "version": 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/objc/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo.png -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/objc/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo_2x.png -------------------------------------------------------------------------------- /ios/objc/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/objc/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo_3x.png -------------------------------------------------------------------------------- /ios/objc/shared/LaunchScreen.xib: -------------------------------------------------------------------------------- 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 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /ios/objc/shared/assets/logo1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/objc/shared/assets/logo1024.png -------------------------------------------------------------------------------- /ios/swift/FriendlyChatSwift/Constants.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2015 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | struct Constants { 18 | 19 | struct NotificationKeys { 20 | static let SignedIn = "onSignInCompleted" 21 | } 22 | 23 | struct Segues { 24 | static let SignInToFp = "SignInToFP" 25 | static let FpToSignIn = "FPToSignIn" 26 | } 27 | 28 | struct MessageFields { 29 | static let name = "name" 30 | static let text = "text" 31 | static let photoURL = "photoUrl" 32 | static let imageURL = "imageUrl" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ios/swift/FriendlyChatSwift/FriendlyChatSwift.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | aps-environment 6 | development 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/swift/FriendlyChatSwift/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | GADIsAdManagerApp 6 | 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIcons 12 | 13 | CFBundleIcons~ipad 14 | 15 | CFBundleIdentifier 16 | $(PRODUCT_BUNDLE_IDENTIFIER) 17 | CFBundleInfoDictionaryVersion 18 | 6.0 19 | CFBundleName 20 | $(PRODUCT_NAME) 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | 1.0 25 | CFBundleSignature 26 | ???? 27 | CFBundleURLTypes 28 | 29 | 30 | CFBundleTypeRole 31 | Editor 32 | CFBundleURLSchemes 33 | 34 | REVERSED_CLIENT_ID 35 | 36 | 37 | 38 | CFBundleVersion 39 | 1 40 | LSRequiresIPhoneOS 41 | 42 | NSCameraUsageDescription 43 | Take and upload photos to Cloud Storage 44 | NSContactsUsageDescription 45 | Used for Firebase Invites 46 | NSPhotoLibraryUsageDescription 47 | Upload photo to Cloud Storage 48 | UIBackgroundModes 49 | 50 | remote-notification 51 | 52 | UILaunchStoryboardName 53 | LaunchScreen 54 | UIMainStoryboardFile 55 | Main 56 | UIRequiredDeviceCapabilities 57 | 58 | armv7 59 | 60 | UISupportedInterfaceOrientations 61 | 62 | UIInterfaceOrientationPortrait 63 | UIInterfaceOrientationLandscapeLeft 64 | UIInterfaceOrientationLandscapeRight 65 | 66 | UISupportedInterfaceOrientations~ipad 67 | 68 | UIInterfaceOrientationPortrait 69 | UIInterfaceOrientationPortraitUpsideDown 70 | UIInterfaceOrientationLandscapeLeft 71 | UIInterfaceOrientationLandscapeRight 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /ios/swift/FriendlyChatSwift/MeasurementHelper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2015 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | import Firebase 18 | 19 | class MeasurementHelper: NSObject { 20 | 21 | static func sendLoginEvent() { 22 | Analytics.logEvent(AnalyticsEventLogin, parameters: nil) 23 | } 24 | 25 | static func sendLogoutEvent() { 26 | Analytics.logEvent("logout", parameters: nil) 27 | } 28 | 29 | static func sendMessageEvent() { 30 | Analytics.logEvent("message", parameters: nil) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ios/swift/FriendlyChatSwift/SignInViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2015 Google Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | import UIKit 18 | 19 | import Firebase 20 | import GoogleSignIn 21 | 22 | @objc(SignInViewController) 23 | class SignInViewController: UIViewController { 24 | 25 | @IBOutlet weak var signInButton: GIDSignInButton! 26 | var handle: AuthStateDidChangeListenerHandle? 27 | 28 | override func viewDidLoad() { 29 | super.viewDidLoad() 30 | GIDSignIn.sharedInstance()?.presentingViewController = self 31 | GIDSignIn.sharedInstance()?.restorePreviousSignIn() 32 | handle = Auth.auth().addStateDidChangeListener() { (auth, user) in 33 | if user != nil { 34 | MeasurementHelper.sendLoginEvent() 35 | self.performSegue(withIdentifier: Constants.Segues.SignInToFp, sender: nil) 36 | } 37 | } 38 | } 39 | 40 | deinit { 41 | if let handle = handle { 42 | Auth.auth().removeStateDidChangeListener(handle) 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /ios/swift/Podfile: -------------------------------------------------------------------------------- 1 | # FriendlyChat Codelab 2 | 3 | use_frameworks! 4 | platform :ios, '9.0' 5 | 6 | pod 'Firebase/AdMob' 7 | pod 'Firebase/Analytics' 8 | pod 'Firebase/Auth' 9 | pod 'Firebase/Database' 10 | pod 'Firebase/Messaging' 11 | pod 'Firebase/RemoteConfig' 12 | pod 'Firebase/Storage' 13 | pod 'Firebase/Crashlytics' 14 | pod 'GoogleSignIn' 15 | 16 | target 'FriendlyChatSwift' do 17 | end 18 | -------------------------------------------------------------------------------- /ios/swift/shared/Bladefile: -------------------------------------------------------------------------------- 1 | # 2 | # Uncomment below to specify your own resources. 3 | # See https://github.com/jondot/blade for more information. 4 | # 5 | 6 | blades: 7 | - source: assets/logo1024.png 8 | mount: Images.xcassets/AppIcon.appiconset 9 | contents: true 10 | - source: assets/logo1024.png 11 | mount: Images.xcassets/Logo.imageset 12 | -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/AppIcon.appiconset/AppIcon-60-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/swift/shared/Images.xcassets/AppIcon.appiconset/AppIcon-60-2x.png -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/AppIcon.appiconset/AppIcon-60-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/swift/shared/Images.xcassets/AppIcon.appiconset/AppIcon-60-3x.png -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/AppIcon.appiconset/AppIcon-76-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/swift/shared/Images.xcassets/AppIcon.appiconset/AppIcon-76-2x.png -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/AppIcon.appiconset/AppIcon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/swift/shared/Images.xcassets/AppIcon.appiconset/AppIcon-76.png -------------------------------------------------------------------------------- /ios/swift/shared/Images.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 | "size" : "29x29", 15 | "idiom" : "iphone", 16 | "filename" : "logo1024-iphone-29@2x.png", 17 | "scale" : "2x" 18 | }, 19 | { 20 | "size" : "29x29", 21 | "idiom" : "iphone", 22 | "filename" : "logo1024-iphone-29@3x.png", 23 | "scale" : "3x" 24 | }, 25 | { 26 | "size" : "40x40", 27 | "idiom" : "iphone", 28 | "filename" : "logo1024-iphone-40@2x.png", 29 | "scale" : "2x" 30 | }, 31 | { 32 | "size" : "40x40", 33 | "idiom" : "iphone", 34 | "filename" : "logo1024-iphone-40@3x.png", 35 | "scale" : "3x" 36 | }, 37 | { 38 | "size" : "60x60", 39 | "idiom" : "iphone", 40 | "filename" : "AppIcon-60-2x.png", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "size" : "60x60", 45 | "idiom" : "iphone", 46 | "filename" : "AppIcon-60-3x.png", 47 | "scale" : "3x" 48 | }, 49 | { 50 | "idiom" : "ipad", 51 | "size" : "20x20", 52 | "scale" : "1x" 53 | }, 54 | { 55 | "idiom" : "ipad", 56 | "size" : "20x20", 57 | "scale" : "2x" 58 | }, 59 | { 60 | "size" : "29x29", 61 | "idiom" : "ipad", 62 | "filename" : "logo1024-ipad-29@1x.png", 63 | "scale" : "1x" 64 | }, 65 | { 66 | "size" : "29x29", 67 | "idiom" : "ipad", 68 | "filename" : "logo1024-ipad-29@2x.png", 69 | "scale" : "2x" 70 | }, 71 | { 72 | "size" : "40x40", 73 | "idiom" : "ipad", 74 | "filename" : "logo1024-ipad-40@1x.png", 75 | "scale" : "1x" 76 | }, 77 | { 78 | "size" : "40x40", 79 | "idiom" : "ipad", 80 | "filename" : "logo1024-ipad-40@2x.png", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "size" : "76x76", 85 | "idiom" : "ipad", 86 | "filename" : "AppIcon-76.png", 87 | "scale" : "1x" 88 | }, 89 | { 90 | "size" : "76x76", 91 | "idiom" : "ipad", 92 | "filename" : "AppIcon-76-2x.png", 93 | "scale" : "2x" 94 | }, 95 | { 96 | "size" : "83.5x83.5", 97 | "idiom" : "ipad", 98 | "filename" : "logo1024-ipad-83@2x.png", 99 | "scale" : "2x" 100 | } 101 | ], 102 | "info" : { 103 | "version" : 1, 104 | "author" : "xcode" 105 | } 106 | } -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/swift/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-29@1x.png -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/swift/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-29@2x.png -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/swift/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-40@1x.png -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/swift/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-40@2x.png -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-83@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/swift/shared/Images.xcassets/AppIcon.appiconset/logo1024-ipad-83@2x.png -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/swift/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-29@2x.png -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/swift/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-29@3x.png -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/swift/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-40@2x.png -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/swift/shared/Images.xcassets/AppIcon.appiconset/logo1024-iphone-40@3x.png -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/Brand Assets.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "ipad", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "1x" 9 | }, 10 | { 11 | "orientation" : "landscape", 12 | "idiom" : "ipad", 13 | "extent" : "full-screen", 14 | "minimum-system-version" : "7.0", 15 | "scale" : "1x" 16 | }, 17 | { 18 | "orientation" : "portrait", 19 | "idiom" : "ipad", 20 | "extent" : "full-screen", 21 | "minimum-system-version" : "7.0", 22 | "scale" : "2x" 23 | }, 24 | { 25 | "orientation" : "landscape", 26 | "idiom" : "ipad", 27 | "extent" : "full-screen", 28 | "minimum-system-version" : "7.0", 29 | "scale" : "2x" 30 | } 31 | ], 32 | "info" : { 33 | "version" : 1, 34 | "author" : "xcode" 35 | } 36 | } -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/Logo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "logo1024-universal-341@1x.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "logo1024-universal-341@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "logo1024-universal-341@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/swift/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@1x.png -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/swift/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@2x.png -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/swift/shared/Images.xcassets/Logo.imageset/logo1024-universal-341@3x.png -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/ic_account_circle.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "ic_account_circle.png", 5 | "idiom": "universal", 6 | "scale": "1x" 7 | }, 8 | { 9 | "filename": "ic_account_circle_2x.png", 10 | "idiom": "universal", 11 | "scale": "2x" 12 | }, 13 | { 14 | "filename": "ic_account_circle_3x.png", 15 | "idiom": "universal", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "author": "xcode", 21 | "version": 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/swift/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle.png -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/swift/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle_2x.png -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/swift/shared/Images.xcassets/ic_account_circle.imageset/ic_account_circle_3x.png -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/ic_add_a_photo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "ic_add_a_photo.png", 5 | "idiom": "universal", 6 | "scale": "1x" 7 | }, 8 | { 9 | "filename": "ic_add_a_photo_2x.png", 10 | "idiom": "universal", 11 | "scale": "2x" 12 | }, 13 | { 14 | "filename": "ic_add_a_photo_3x.png", 15 | "idiom": "universal", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "author": "xcode", 21 | "version": 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/swift/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo.png -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/swift/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo_2x.png -------------------------------------------------------------------------------- /ios/swift/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/swift/shared/Images.xcassets/ic_add_a_photo.imageset/ic_add_a_photo_3x.png -------------------------------------------------------------------------------- /ios/swift/shared/LaunchScreen.xib: -------------------------------------------------------------------------------- 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 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /ios/swift/shared/assets/logo1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/swift/shared/assets/logo1024.png -------------------------------------------------------------------------------- /ios/swiftui/FriendlyChatSwiftUI/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0", 9 | "green" : "124", 10 | "red" : "245" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ios/swiftui/FriendlyChatSwiftUI/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "filename" : "firebaseLogo120.png", 35 | "idiom" : "iphone", 36 | "scale" : "2x", 37 | "size" : "60x60" 38 | }, 39 | { 40 | "idiom" : "iphone", 41 | "scale" : "3x", 42 | "size" : "60x60" 43 | }, 44 | { 45 | "idiom" : "ipad", 46 | "scale" : "1x", 47 | "size" : "20x20" 48 | }, 49 | { 50 | "idiom" : "ipad", 51 | "scale" : "2x", 52 | "size" : "20x20" 53 | }, 54 | { 55 | "idiom" : "ipad", 56 | "scale" : "1x", 57 | "size" : "29x29" 58 | }, 59 | { 60 | "idiom" : "ipad", 61 | "scale" : "2x", 62 | "size" : "29x29" 63 | }, 64 | { 65 | "idiom" : "ipad", 66 | "scale" : "1x", 67 | "size" : "40x40" 68 | }, 69 | { 70 | "idiom" : "ipad", 71 | "scale" : "2x", 72 | "size" : "40x40" 73 | }, 74 | { 75 | "idiom" : "ipad", 76 | "scale" : "1x", 77 | "size" : "76x76" 78 | }, 79 | { 80 | "idiom" : "ipad", 81 | "scale" : "2x", 82 | "size" : "76x76" 83 | }, 84 | { 85 | "idiom" : "ipad", 86 | "scale" : "2x", 87 | "size" : "83.5x83.5" 88 | }, 89 | { 90 | "idiom" : "ios-marketing", 91 | "scale" : "1x", 92 | "size" : "1024x1024" 93 | } 94 | ], 95 | "info" : { 96 | "author" : "xcode", 97 | "version" : 1 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /ios/swiftui/FriendlyChatSwiftUI/Assets.xcassets/AppIcon.appiconset/firebaseLogo120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firebase/codelab-friendlychat-ios/09a987633325044abbae63dfd3a74de95c66e0b0/ios/swiftui/FriendlyChatSwiftUI/Assets.xcassets/AppIcon.appiconset/firebaseLogo120.png -------------------------------------------------------------------------------- /ios/swiftui/FriendlyChatSwiftUI/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ios/swiftui/FriendlyChatSwiftUI/Assets.xcassets/FirebaseBlue.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "229", 9 | "green" : "155", 10 | "red" : "3" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ios/swiftui/FriendlyChatSwiftUI/Assets.xcassets/FirebaseGray.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "241", 9 | "green" : "239", 10 | "red" : "236" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ios/swiftui/FriendlyChatSwiftUI/Assets.xcassets/FirebaseOrange.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0", 9 | "green" : "124", 10 | "red" : "245" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ios/swiftui/FriendlyChatSwiftUI/Assets.xcassets/FirebaseYellow.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "40", 9 | "green" : "202", 10 | "red" : "255" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ios/swiftui/FriendlyChatSwiftUI/FriendlyChatSwiftUIApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FriendlyChatSwiftUIApp.swift 3 | // FriendlyChatSwiftUI 4 | // 5 | // Copyright (c) 2022 Google Inc. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import SwiftUI 21 | import FirebaseCore 22 | 23 | @main 24 | struct FriendlyChatSwiftUIApp: App { 25 | init() { 26 | FirebaseApp.configure() 27 | } 28 | 29 | var body: some Scene { 30 | WindowGroup { 31 | ContentView() 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ios/swiftui/FriendlyChatSwiftUI/FriendlyMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FriendlyMessage.swift 3 | // FriendlyChatSwiftUI 4 | // 5 | // Copyright (c) 2022 Google Inc. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import Foundation 21 | 22 | struct FriendlyMessage: Identifiable, Codable { 23 | var id: String 24 | let text: String? 25 | let displayName: String? 26 | let imageUrl: String? 27 | } 28 | -------------------------------------------------------------------------------- /ios/swiftui/FriendlyChatSwiftUI/FriendlyMessageViewModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FriendlyMessageViewModel.swift 3 | // FriendlyChatSwiftUI 4 | // 5 | // Copyright (c) 2022 Google Inc. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import Foundation 21 | import FirebaseDatabase 22 | 23 | final class FriendlyMessageViewModel: ObservableObject { 24 | @Published var messages: [FriendlyMessage] = [] 25 | 26 | private lazy var dbPath: DatabaseReference? = { 27 | return Database.database().reference().child("messages") 28 | }() 29 | 30 | private let encoder = JSONEncoder() 31 | private let decoder = JSONDecoder() 32 | 33 | func listen() { 34 | guard let dbPath = dbPath else { 35 | return 36 | } 37 | dbPath 38 | .observe(.childAdded) { [weak self] snapshot in 39 | guard 40 | let self = self, 41 | var json = snapshot.value as? [String: Any] 42 | else { 43 | return 44 | } 45 | json["id"] = snapshot.key 46 | do { 47 | let messageData = try JSONSerialization.data(withJSONObject: json) 48 | let message = try self.decoder.decode(FriendlyMessage.self, from: messageData) 49 | self.messages.append(message) 50 | } catch { 51 | print("Error retrieving messages: \(error)") 52 | } 53 | } 54 | } 55 | 56 | func stopListen() { 57 | messages = [] 58 | dbPath?.removeAllObservers() 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /ios/swiftui/FriendlyChatSwiftUI/ImagePicker.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImagePicker.swift 3 | // FriendlyChatSwiftUI 4 | // 5 | // Copyright (c) 2022 Google Inc. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import SwiftUI 21 | 22 | struct ImagePicker: UIViewControllerRepresentable { 23 | @Environment(\.presentationMode) private var presentationMode 24 | @Binding var selectedImage: UIImage 25 | 26 | func makeUIViewController(context: UIViewControllerRepresentableContext) -> UIImagePickerController { 27 | let imagePicker = UIImagePickerController() 28 | imagePicker.allowsEditing = false 29 | imagePicker.sourceType = .photoLibrary 30 | imagePicker.delegate = context.coordinator 31 | 32 | return imagePicker 33 | } 34 | 35 | func updateUIViewController(_ uiViewController: UIImagePickerController, context: UIViewControllerRepresentableContext) {} 36 | 37 | func makeCoordinator() -> Coordinator { 38 | Coordinator(self) 39 | } 40 | 41 | final class Coordinator: NSObject, UIImagePickerControllerDelegate, UINavigationControllerDelegate { 42 | var parent: ImagePicker 43 | 44 | init(_ parent: ImagePicker) { 45 | self.parent = parent 46 | } 47 | 48 | func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { 49 | if let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage { 50 | parent.selectedImage = image 51 | 52 | ImageUploader().uploadImage(image: image) 53 | } 54 | 55 | parent.presentationMode.wrappedValue.dismiss() 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /ios/swiftui/FriendlyChatSwiftUI/ImageUploader.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImageUploader.swift 3 | // FriendlyChatSwiftUI 4 | // 5 | // Copyright (c) 2022 Google Inc. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import SwiftUI 21 | import FirebaseStorage 22 | import FirebaseAuth 23 | import FirebaseDatabase 24 | 25 | class ImageUploader: ObservableObject { 26 | let storage = Storage.storage() 27 | let user = Auth.auth().currentUser 28 | let db = Database.database() 29 | 30 | func uploadImage(image: UIImage) { 31 | let storageRef = storage.reference().child(user!.uid).child("images").child(image.description) 32 | let imageData = image.jpegData(compressionQuality: 0.5) 33 | let dbRef = db.reference() 34 | 35 | // Upload the file and send as message to db 36 | if let imageData = imageData { 37 | storageRef.putData(imageData, metadata: nil).observe(.success) { snapshot in 38 | // Upload completed successfully 39 | dbRef.child("messages").childByAutoId().setValue(["imageUrl": storageRef.fullPath, "displayName": Auth.auth().currentUser!.displayName]) 40 | } 41 | } 42 | } 43 | } 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /ios/swiftui/FriendlyChatSwiftUI/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ios/swiftui/FriendlyChatSwiftUI/UserViewModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UserViewModel.swift 3 | // FriendlyChatSwiftUI 4 | // 5 | // Copyright (c) 2022 Google Inc. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import SwiftUI 21 | import FirebaseAuth 22 | 23 | class UserViewModel: ObservableObject { 24 | @AppStorage("isSignedIn") var isSignedIn = false 25 | @Published var email = "" 26 | @Published var password = "" 27 | @Published var displayName = "" 28 | @Published var alert = false 29 | @Published var alertMessage = "" 30 | 31 | private func showAlertMessage(message: String) { 32 | alertMessage = message 33 | alert.toggle() 34 | } 35 | 36 | func login() { 37 | // check if all fields are inputted correctly 38 | if email.isEmpty || password.isEmpty { 39 | showAlertMessage(message: "Neither email nor password can be empty.") 40 | return 41 | } 42 | // Sign in with email and password 43 | Auth.auth().signIn(withEmail: email, password: password) { result, err in 44 | if let err = err { 45 | self.alertMessage = err.localizedDescription 46 | self.alert.toggle() 47 | } else { 48 | self.isSignedIn = true 49 | } 50 | } 51 | } 52 | 53 | func signUp() { 54 | // Check if all fields are inputted correctly 55 | if email.isEmpty || password.isEmpty { 56 | showAlertMessage(message: "Neither email nor password can be empty.") 57 | return 58 | } 59 | // Sign up with email and password 60 | Auth.auth().createUser(withEmail: email, password: password) { result, err in 61 | if let err = err { 62 | self.alertMessage = err.localizedDescription 63 | self.alert.toggle() 64 | } else { 65 | self.login() 66 | } 67 | } 68 | } 69 | 70 | func updateDisplayName() { 71 | print("signing up user and setting display name to: \(self.displayName)") 72 | // On creation of new user, set display name 73 | let changeRequest = Auth.auth().currentUser!.createProfileChangeRequest() 74 | changeRequest.displayName = self.displayName 75 | changeRequest.commitChanges { error in 76 | if let error = error { 77 | print("got some sort of error in display name") 78 | self.alertMessage = error.localizedDescription 79 | self.alert.toggle() 80 | } else { 81 | print("display was supposedly a success...") 82 | } 83 | } 84 | } 85 | 86 | func logout() { 87 | do { 88 | try Auth.auth().signOut() 89 | isSignedIn = false 90 | email = "" 91 | password = "" 92 | } catch { 93 | print("Error signing out: \(error)") 94 | } 95 | } 96 | } 97 | 98 | let user = UserViewModel() 99 | -------------------------------------------------------------------------------- /ios/swiftui/FriendlyChatSwiftUI/Views/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // FriendlyChatSwiftUI 4 | // 5 | // Copyright (c) 2022 Google Inc. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | 20 | import SwiftUI 21 | 22 | struct ContentView: View { 23 | @AppStorage("isSignedIn") var isSignedIn = false 24 | @State private var newMessageText = "" 25 | @StateObject private var friendlyMessageVM = FriendlyMessageViewModel() 26 | @State private var profileViewPresented = false 27 | 28 | var body: some View { 29 | if isSignedIn { 30 | VStack { 31 | HeaderView() 32 | Menu { 33 | Button("Profile", action: { 34 | profileViewPresented = true 35 | }) 36 | Button("Logout", action: user.logout) 37 | } label: { 38 | Image(systemName: "list.bullet.circle.fill") 39 | .font(.system(size: 30.0)) 40 | } 41 | .frame(maxWidth: .infinity, alignment: .topTrailing) 42 | .padding(.horizontal) 43 | .sheet(isPresented: $profileViewPresented) { 44 | ProfileView(isPresented: $profileViewPresented, user: user) 45 | } 46 | ScrollViewReader { scrollViewReader in 47 | ScrollView { 48 | ForEach(0.. 6.10) 4 | - GoogleUtilities/AppDelegateSwizzler (~> 6.7) 5 | - GoogleUtilities/Environment (~> 6.7) 6 | - GTMSessionFetcher/Core (~> 1.1) 7 | - FirebaseCore (6.10.4): 8 | - FirebaseCoreDiagnostics (~> 1.6) 9 | - GoogleUtilities/Environment (~> 6.7) 10 | - GoogleUtilities/Logger (~> 6.7) 11 | - FirebaseCoreDiagnostics (1.7.0): 12 | - GoogleDataTransport (~> 7.4) 13 | - GoogleUtilities/Environment (~> 6.7) 14 | - GoogleUtilities/Logger (~> 6.7) 15 | - nanopb (~> 1.30906.0) 16 | - FirebaseDatabase (6.6.0): 17 | - FirebaseCore (~> 6.10) 18 | - leveldb-library (~> 1.22) 19 | - FirebaseStorage (3.9.1): 20 | - FirebaseCore (~> 6.10) 21 | - GTMSessionFetcher/Core (~> 1.1) 22 | - GoogleDataTransport (7.5.1): 23 | - nanopb (~> 1.30906.0) 24 | - GoogleUtilities/AppDelegateSwizzler (6.7.2): 25 | - GoogleUtilities/Environment 26 | - GoogleUtilities/Logger 27 | - GoogleUtilities/Network 28 | - GoogleUtilities/Environment (6.7.2): 29 | - PromisesObjC (~> 1.2) 30 | - GoogleUtilities/Logger (6.7.2): 31 | - GoogleUtilities/Environment 32 | - GoogleUtilities/Network (6.7.2): 33 | - GoogleUtilities/Logger 34 | - "GoogleUtilities/NSData+zlib" 35 | - GoogleUtilities/Reachability 36 | - "GoogleUtilities/NSData+zlib (6.7.2)" 37 | - GoogleUtilities/Reachability (6.7.2): 38 | - GoogleUtilities/Logger 39 | - GTMSessionFetcher/Core (1.7.2) 40 | - leveldb-library (1.22.1) 41 | - nanopb (1.30906.0): 42 | - nanopb/decode (= 1.30906.0) 43 | - nanopb/encode (= 1.30906.0) 44 | - nanopb/decode (1.30906.0) 45 | - nanopb/encode (1.30906.0) 46 | - PromisesObjC (1.2.12) 47 | 48 | DEPENDENCIES: 49 | - FirebaseAuth 50 | - FirebaseDatabase 51 | - FirebaseStorage 52 | 53 | SPEC REPOS: 54 | trunk: 55 | - FirebaseAuth 56 | - FirebaseCore 57 | - FirebaseCoreDiagnostics 58 | - FirebaseDatabase 59 | - FirebaseStorage 60 | - GoogleDataTransport 61 | - GoogleUtilities 62 | - GTMSessionFetcher 63 | - leveldb-library 64 | - nanopb 65 | - PromisesObjC 66 | 67 | SPEC CHECKSUMS: 68 | FirebaseAuth: c92d49ada7948d1a23466e3db17bc4c2039dddc3 69 | FirebaseCore: d3a978a3cfa3240bf7e4ba7d137fdf5b22b628ec 70 | FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1 71 | FirebaseDatabase: 13a865a4b85897462b930eb683bda8f52583713f 72 | FirebaseStorage: 15e0f15ef3c7fec3d1899d68623e47d4447066b4 73 | GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833 74 | GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3 75 | GTMSessionFetcher: 5595ec75acf5be50814f81e9189490412bad82ba 76 | leveldb-library: 50c7b45cbd7bf543c81a468fe557a16ae3db8729 77 | nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc 78 | PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97 79 | 80 | PODFILE CHECKSUM: 355b6454c06c6378b6906c76c54835139abbf48c 81 | 82 | COCOAPODS: 1.15.2 83 | -------------------------------------------------------------------------------- /ios/swiftui/README.md: -------------------------------------------------------------------------------- 1 | # In Progress 2 | 3 | This folder is in progress. It will contain an update to the Swift version of this codelab for SwiftUI, better aligning with the Android version of this codelab: [Firebase Android Codelab - Build Friendly Chat](https://firebase.google.com/codelabs/firebase-android). 4 | 5 | So far it contains: 6 | 7 | 1. Basic UI elements and styling: 8 | 9 | 10 | 11 | 2. LogIn screen and a SignUp screen with Firebase Authentication. 12 | 3. Read/write messages to Firebase Realtime DB 13 | 4. Read/write images to Firebase Storage and references in Realtime DB 14 | 15 | Future PRs: 16 | 1. Fixing bugs (such as the color of message when Auth'd user's display name is nil and scroll to bottom on message send) 17 | 1. Re-writing codelab to include latest updates + emulators 18 | 1. Removing the current version of this codelab (currently in the swift folder) and replacing it with this version 19 | 20 | -------------------------------------------------------------------------------- /test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eo pipefail 4 | 5 | EXIT_STATUS=0 6 | 7 | (xcodebuild \ 8 | -workspace ${DIR}/FriendlyChat${LANGUAGE}.xcworkspace \ 9 | -scheme FriendlyChat${LANGUAGE} \ 10 | -sdk iphonesimulator \ 11 | -destination 'platform=iOS Simulator,name=iPhone XR' \ 12 | build \ 13 | #test \ 14 | ONLY_ACTIVE_ARCH=YES \ 15 | CODE_SIGNING_REQUIRED=NO \ 16 | | xcpretty) || EXIT_STATUS=$? 17 | 18 | exit $EXIT_STATUS 19 | --------------------------------------------------------------------------------