A SwiftUI component which handles logging in with Apple to Firebase

Overview

Login with Apple Firebase SwiftUI

I made this SwiftUI component to handle logging in with Apple to Firebase.

Demo Gif

Usage in SwiftUI

struct ContentView: View {
    var body: some View {
        SignInWithAppleToFirebase({ response in
            if response == .success {
                print("logged into Firebase through Apple!")
            } else if response == .error {
                print("error. Maybe the user cancelled or there's no internet")
            }
        })
    }
}

Setup

  1. Copy the entirety of the SignInWithAppleToFirebase folder to your repo. https://github.com/joehinkle11/Login-with-Apple-Firebase-SwiftUI/tree/master/LoginWithAppleFirebaseSwiftUI/SignInWithAppleToFirebase
  2. Add Firebase to your project https://firebase.google.com/docs/ios/setup?authuser=0
  3. Add sign in with Apple as a valid login method on your Firebase project at this link https://console.firebase.google.com/u/0/project/<YOUR_FIREBASE_PROJECT_ID>/authentication/providers

  1. Make sure you have Firebase properly in your Podfile and run pod install
...
 # Pods for LoginWithAppleFirebaseSwiftUI
 pod 'Firebase/Auth'
...
  1. Make sure you open the Xcode workspace generated by Cocopods (this is detailed in the Firebase tutorial in step 2)
  2. Add Sign In with Apple to your app's id configuration at https://developer.apple.com/account/resources/identifiers/list Remove

  1. Add Sign in with Apple to your project's capabilities

  1. Add the SignInWithAppleToFirebase button from this codebase to your view

  1. Now when users click on the button, it will sign them into Firebase using sign in with Apple

Gotchas

  • You need a GoogleService-Info.plist file to compile this codebase. Go through the setup process on Firebase
  • You also need to have Cocopods and run pod install

Tutorials/code used

You might also like...
BottomBar component for SwiftUI
BottomBar component for SwiftUI

BottomBar-SwiftUI BottomBar component for SwiftUI inspired by this concept Requirements Xcode 11 iOS 13 Installation In Xcode go to File - Swift Pack

Instagram clone with firebase and swift
Instagram clone with firebase and swift

Instagram clone with firebase and swift

 iOS Open-Source Telematics App with Firebase© integration
iOS Open-Source Telematics App with Firebase© integration

Open-source telematics app for iOS. The application is suitable for UBI (Usage-based insurance), shared mobility, transportation, safe driving, tracking, family trackers, drive-coach, and other driving mobile applications

A grocery list app for families written in Swift using Firebase Realtime Database

FamiList | Grocery list app in Swift FamiList is a grocery list app for families written in Swift using Firebase Realtime Database. You can add differ

The ToDoList application using FireBase allows you to register users
The ToDoList application using FireBase allows you to register users

ToDoFirebase Приложение ToDoList с использовавнием FireBase позволяет зарегистри

A detailed clone of the Instagram app built with Firebase
A detailed clone of the Instagram app built with Firebase

[This repository is no longer being maintained] InstagramClone A detailed clone

Learning App with Firebase Auth
Learning App with Firebase Auth

Learning App Displays how to make a learning app with Swift, iOS's programming l

Firebase Quickstart Samples for iOS

Firebase Quickstarts for iOS A collection of quickstart samples demonstrating the Firebase APIs on iOS. Each sample contains targets for both Objectiv

Warning pushNotification - Using push notification with Firebase Cloud Messaging

재난문자 푸시 알림 구현 1) 구현 기능 2) 기본 개념 (1) Remote Notification 불시에 발생한 업데이트 불특정 시간 예측 불

Comments
  • SharedWebCredential.swift - SecRequestSharedWebCredential Deprecated in < iOS 14.0

    SharedWebCredential.swift - SecRequestSharedWebCredential Deprecated in < iOS 14.0

    At line 58 of SharedWebCredential.swift 'SecRequestSharedWebCredential' was deprecated in iOS 14.0: Use ASAuthorizationController to make an ASAuthorizationPasswordRequest (AuthenticationServices framework).

    opened by jacoblukewood 1
  • Fetching User data - full name

    Fetching User data - full name

    Hi, I'm not able to implement the fetching of the name with your code, all the ways that I see online are with a different kind fo structure of the code. How can I do it?

    opened by laviniabordin 1
  • Sign in with Apple Label change?

    Sign in with Apple Label change?

    Hi Joe! Thank you for creating this repo!! It's been very helpful!

    However, I wonder if there is anyway to indicate to the users that they have successfully signed in? For instance, maybe changing the Sign in with Apple Label to "Logged in" or change it into a sign out button?

    Thank you so much!

    opened by Speakmanity 2
Owner
Joe Hinkle
App and game developer. Working on https://appmakerios.com and https://crate.as
Joe Hinkle
Firebase Analytics Firebase Notification Alamofire KingFisher Ombdb API

MovieOmdbApp Firebase Analytics Firebase Notification Alamofire KingFisher Ombdb

Kaya 0 Dec 20, 2021
Completed Project for Authentication in SwiftUI using Firebase Auth SDK & Sign in with Apple

Completed Project for Authentication in SwiftUI using Firebase Auth SDK & Sign in with Apple Follow the tutorial at alfianlosari.com Features Uses Fir

Alfian Losari 43 Dec 22, 2022
Social Media platform build with swiftUI and Firebase with google and apple account integration for Signing In Users

Social Media platform build with swiftUI and Firebase with google and apple account integration for Signing In Users . Providing Users availability to upload posts and images add caption allowing other users to comment , with Find section to explore new people , new stories , User Profile section to allow the user to take control of his account .

Devang Papinwar 2 Jul 11, 2022
Simple Todo Application using SwiftUI / Firebase / Redux.

Simple Todo Application using SwiftUI/Firebase/Redux/Combine. Light _ _ _ _ Dark _ _ _ Feature Use SwiftUI fully. Use Firebase. Authentication Cloud F

Suguru Kishimoto 337 Dec 25, 2022
SwiftUI, Firebase, Kingfisher, googleapis

SwiftUI-KokaiByWGO Xcode Version 12.0 SwiftUI, Firebase, Kingfisher, googleapis Learn Thai with pictures and sounds Note : This version have no CMS so

Waleerat S. 0 Oct 6, 2021
The app demonstrates how to use Firebase in a SwiftUI iOS app

Firebase SwiftUIDemo app This app demonstrates how to use Firebase in a SwiftUI iOS app. Firebase Setup Go to firebase.com Click new project. Copy app

Andrew Gholson 0 Nov 28, 2021
Aplikasi iOS Simulasi CRUD Stok Barang dengan SwiftUI, Firebase CLI & Firestore

iStockery Aplikasi iStockery adalah aplikasi stok inventory berbasis iOS yang dibuat menggunakan Firebase (Firestore) secara Local dengan fitur CRUD d

DK 7 Aug 1, 2022
SwiftUI + Firebase template

SwiftUI + Firebase template project This is a template project with SwiftUI and Firebase. You can create an iOS with SwiftUI and Firebase right away w

Shu 6 Oct 17, 2022
A Figma component preview for your SwiftUI views

FigmaPreviewSwiftUI A Figma component preview for your SwiftUI views. You can use Figma components instead of real views within your app until you imp

Danis Tazetdinov 50 Dec 23, 2022
SwiftUI component for QuickLook

GXQuickLookView SwiftUI + QuickLook. ?? Требования ✅ Xcode 12.0 ✅ Swift 5+ ✅ iOS

GARPIX iOS team 12 Sep 19, 2022