/geoLocation_firebase

Primary LanguageObjective-CMIT LicenseMIT

Firebase iOS Location Demo

============= This is an example iOS app that will show you how to integrate the Firebase iOS SDK, Google Maps iOS SDK, and the Facebook iOS SDK.

Example #Setup ##Installing Frameworks

  1. Firebase SDK (Latest)
  • Add the Firebase SDK to the project's Frameworks
  1. Facebook SDK
  • Add the Facebook SDK to the project's Frameworks
  1. GMS SDK
  • Add the GMS SDK to the project's Frameworks and select 'Copy into destination group's folder'
  1. GoogleMaps bundle (found in the copied GoogleMaps.Framework. see documentation)

##Installing Dependencies

  1. GMS SDK
  2. AVFoundation.framework
  3. CoreData.framework
  4. CoreLocation.framework
  5. CoreText.framework
  6. GLKit.framework
  7. ImageIO.framework
  8. libc++.dylib
  9. libicucore.dylib
  10. libz.dylib
  11. OpenGLES.framework
  12. QuartzCore.framework
  13. SystemConfiguration.framework
  14. Firebase SDK
  15. libicucore.framework
  16. CFNetwork.framework
  17. Security.framework
  18. Accounts.framework
  19. Social.framework

##Configuring the Build

  1. Build Settings > (All, Combined) > Other Linker Flags = -ObjC

##Setup a new Facebook App Follow Facebook's Getting Started Guide to setup a new facebook app and obtain a Facebook App Id and App Secret

  1. Configure location-demo-Info.plist in Support Files to include FacebookAppID, FacebookDisplayName, and URL types per the values specified in the guide above
  2. Add a valid contact email under Settings in the "Apps" tab
  3. Make the app live to the general public under Stats & Review in the "Apps" tab

##Setup a new Google Maps App Follow Google's Getting Started Guide to setup an app and obtain an API key

  1. Obtain an API Key
  2. Add an entry to location-demo-Info.plist with the key GMSAPIKey and your API key as the value
  • This is used to render the map in AppDelegate.m in
    [GMSServices provideAPIKey:[plist objectForKey:@"GMSAPIKey"]]

##Setup Firebase Login with Facebook

  1. Enable Facebook Login in the Login tab on your Firebase Dashboard
  2. Add your Facebook App ID and Facebook App Secret
  3. Add Firebase as a Valid OAuth Redirect URI by adding the URL: https://auth.firebase.com/auth/facebook/callback in the Facebook Advanced tab under Settings in Facebook

#Code ##Login using Facebook

  • Use FBLoginView
    • Add Facebook Login to the View Controller (see loadFacebookView in ViewController.m)
    • Override the application:openURL:sourceApplication:annotation: function in AppDelegate.m

##Authenticate to Firebase

  • Use the Facebook auth token
    • NSString *fbAccessToken = [[[FBSession activeSession] accessTokenData] accessToken];
  • Create a FirebaseLogin object
  • Call loginWithFacebookWithAccessToken:withCompletetionBlock: in AppDelegate.m

##Add Google Maps to the View Controller

  • See loadMapsView in ViewController.m