Skip to content

Instantly share code, notes, and snippets.

@erica
Created October 22, 2018 19:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erica/d2eae87a640cbb889ab7d733eddee7a6 to your computer and use it in GitHub Desktop.
Save erica/d2eae87a640cbb889ab7d733eddee7a6 to your computer and use it in GitHub Desktop.

Firebase for Dummies

Visit http://console.firebase.google.com to begin. Most tutorial projects can be simple JSON storage sinks accessed from iOS.

Create a new Firebase database

  1. Click Add Project
  2. Enter a project name.
  3. Disable "Use the default settings for sharing Google Analytics for Firebase data".
  4. Click Continue.
  5. Uncheck all boxes for "Customize data sharing for your new project".
  6. Click Create project.
  7. Wait and then click Continue.
  8. On the next screen locate Firebase > Develop on the left hand column. Click Database
  9. Do not click Beta > Cloud Firestore > Create database. Instead, scroll down to "Or choose Realtime Database" and click Create database.
  10. Select Start in test mode (and not "Start in locked mode"). Click Enable.
  11. If Firebase warns you about how very unsafe your test database is, dismiss that warning.

Use your new Firebase database

Locate the URL at the top of the Database > Data chart on the right two thirds of the screen. The endpoint URL appears just to the right of the link logo, for example "https://test-cc4bb.firebaseio.com/". Click the link logo to select and copy it.

Make sure to append a json path extension (including period) to your URL requests. Add a name to a particular store for codable arrays, e.g.

var targetURL = serviceEndpointURL
    .appendingPathComponent("devices")
if let record = record {
    targetURL = targetURL.appendingPathComponent(record)
}
targetURL = targetURL.appendingPathExtension("json")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment