Git Product home page Git Product logo

fbauthentication's Introduction

FBAuthentication

A Swift Pakage for adding a turnkey sign up/sign in to Firebase workflow for your SwiftUI apps. After configuring your app for Firebase/Firestore connectivity, a single line of code will create the workflow for signing up and signing in to a Firebase account.

Features

  • Sign up and sign in in with email
  • Sign up and sign in with Apple
  • Password reset option sign in with email
  • Firebase account deletion functionality included.
  • Custom colors and project image

Setup and Installation

For detailed instructions and link to video see the documentation page: https://stewartlynch.github.io/FBAuthentication/

TLDR

  1. Create your XCode project and copy the Bundle ID.
  2. Log in to the Firebase Console and create a new project.
  3. Add a new iOS App and enter your Bundle ID for the app.
  4. Download the GoogleServices-Info.plist and drop it into your Xcode project.
  5. Add Authentication by choosing Email/Password and Apple.
  6. Add Firestore Database service to your project.
  7. Log into your Apple Developer account and in the Certificates, IDs and profiles section, enable Email Sources for the firebase project.
  8. Add Sign in with Apple capability to your Xcode app.
  9. Add the FBAuthentication package to your Xcode project using the URL from this page https://github.com/StewartLynch/FBAuthentication/
  10. Import Firebase and FBAuthentication in your @main file and configure Firebase then inject an instance of UserInfo() into the environment.
  11. Design your HomeView view in your app which will be the first page that you app goes to after a successfull authentication.
  12. Update ContentView by importing FBAuthentication, add an instance of userInfo as an @EnvironmentObject then replace the body with a call to LoadingView passing in your HomeView as the startView
import SwiftUI
import FBAuthentication

struct ContentView: View {
    @EnvironmentObject var userInfo: UserInfo
    var body: some View {
        LoadingView(startView: HomeView())
    }
}

Test

Test your app by signing in via email and Apple

Logging out

Implement logging out using

    FBAuth.logout { (result) in
        print("Logged out")
    }

Account Profile

To access the profile where you will be able to update the user name or delete the account and all related data, present a sheet to the ProfileView

.sheet(isPresented: $showProfile {
    ProfileView()
}

fbauthentication's People

Contributors

stewartlynch avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.