Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ This repo provide you with the complete setup of Firebase google sign in with Sw
## What will you be building

You will be building the functionality to login use Goole. Below is the screen.
<p>
<img src="./assets/image1.png" width="32%"/>
<img src="./assets/image2.png" width="32%"/>
<img src="./assets/image3.png" width="32%"/>
</p>

![image1]("./assets/image1.png")
![image1]("./assets/image2.png")
![image1]("./assets/image3.png")

#### Setup for Completed project
If you are planning to try out my <a href="https://github.com/WesCSK/SwiftUI-Google-Sign-In-with-Firebase/tree/main/Completed/FirebaseGoogleSigin">completed project</a>, do follow these additional steps before running it.
Expand Down
68 changes: 64 additions & 4 deletions SignInUsingGoogle/SignInUsingGoogle.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
203073DF282D0205006F7F26 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 203073DE282D0205006F7F26 /* Preview Assets.xcassets */; };
203073E7282D023E006F7F26 /* GoogleSiginBtn.swift in Sources */ = {isa = PBXBuildFile; fileRef = 203073E6282D023E006F7F26 /* GoogleSiginBtn.swift */; };
203073EA282D02C7006F7F26 /* Home.swift in Sources */ = {isa = PBXBuildFile; fileRef = 203073E9282D02C7006F7F26 /* Home.swift */; };
20CE7107282D052000817D34 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 20CE7106282D052000817D34 /* GoogleService-Info.plist */; };
20CE70FF282D047900817D34 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20CE70FE282D047900817D34 /* AppDelegate.swift */; };
20CE7102282D04D100817D34 /* FirebaseAuth in Frameworks */ = {isa = PBXBuildFile; productRef = 20CE7101282D04D100817D34 /* FirebaseAuth */; };
20CE7105282D04F100817D34 /* GoogleSignIn in Frameworks */ = {isa = PBXBuildFile; productRef = 20CE7104282D04F100817D34 /* GoogleSignIn */; };
20CE7109282D05A900817D34 /* +View.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20CE7108282D05A900817D34 /* +View.swift */; };
20CE710C282D072D00817D34 /* FirebAuth.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20CE710B282D072D00817D34 /* FirebAuth.swift */; };
FB1306932C9115D4005910E4 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = FB1306922C9115D4005910E4 /* GoogleService-Info.plist */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -30,15 +35,20 @@
203073DE282D0205006F7F26 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
203073E6282D023E006F7F26 /* GoogleSiginBtn.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoogleSiginBtn.swift; sourceTree = "<group>"; };
203073E9282D02C7006F7F26 /* Home.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Home.swift; sourceTree = "<group>"; };
20CE7106282D052000817D34 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
20CE70FE282D047900817D34 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
20CE7108282D05A900817D34 /* +View.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "+View.swift"; sourceTree = "<group>"; };
20CE710A282D05FE00817D34 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
20CE710B282D072D00817D34 /* FirebAuth.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirebAuth.swift; sourceTree = "<group>"; };
FB1306922C9115D4005910E4 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../../../Downloads/GoogleService-Info.plist"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
203073D1282D0204006F7F26 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
20CE7102282D04D100817D34 /* FirebaseAuth in Frameworks */,
20CE7105282D04F100817D34 /* GoogleSignIn in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -64,12 +74,13 @@
203073D6282D0204006F7F26 /* SignInUsingGoogle */ = {
isa = PBXGroup;
children = (
FB1306922C9115D4005910E4 /* GoogleService-Info.plist */,
20CE710A282D05FE00817D34 /* Info.plist */,
20CE70FD282D046200817D34 /* Helper */,
203073E8282D025F006F7F26 /* Screen */,
203073E5282D020E006F7F26 /* View */,
203073D7282D0204006F7F26 /* SignInUsingGoogleApp.swift */,
203073DB282D0205006F7F26 /* Assets.xcassets */,
20CE7106282D052000817D34 /* GoogleService-Info.plist */,
203073DD282D0205006F7F26 /* Preview Content */,
);
path = SignInUsingGoogle;
Expand Down Expand Up @@ -103,6 +114,16 @@
path = Screen;
sourceTree = "<group>";
};
20CE70FD282D046200817D34 /* Helper */ = {
isa = PBXGroup;
children = (
20CE70FE282D047900817D34 /* AppDelegate.swift */,
20CE7108282D05A900817D34 /* +View.swift */,
20CE710B282D072D00817D34 /* FirebAuth.swift */,
);
path = Helper;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand All @@ -120,6 +141,8 @@
);
name = SignInUsingGoogle;
packageProductDependencies = (
20CE7101282D04D100817D34 /* FirebaseAuth */,
20CE7104282D04F100817D34 /* GoogleSignIn */,
);
productName = SignInUsingGoogle;
productReference = 203073D4282D0204006F7F26 /* SignInUsingGoogle.app */;
Expand Down Expand Up @@ -150,6 +173,8 @@
);
mainGroup = 203073CB282D0204006F7F26;
packageReferences = (
20CE7100282D04D100817D34 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */,
20CE7103282D04F100817D34 /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */,
);
productRefGroup = 203073D5282D0204006F7F26 /* Products */;
projectDirPath = "";
Expand All @@ -166,8 +191,8 @@
buildActionMask = 2147483647;
files = (
203073DF282D0205006F7F26 /* Preview Assets.xcassets in Resources */,
FB1306932C9115D4005910E4 /* GoogleService-Info.plist in Resources */,
203073DC282D0205006F7F26 /* Assets.xcassets in Resources */,
20CE7107282D052000817D34 /* GoogleService-Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -178,7 +203,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
20CE710C282D072D00817D34 /* FirebAuth.swift in Sources */,
20CE70FF282D047900817D34 /* AppDelegate.swift in Sources */,
203073DA282D0204006F7F26 /* LoginScreen.swift in Sources */,
20CE7109282D05A900817D34 /* +View.swift in Sources */,
2000B6A028C4B83F0090697A /* CustomButton.swift in Sources */,
203073D8282D0204006F7F26 /* SignInUsingGoogleApp.swift in Sources */,
203073EA282D02C7006F7F26 /* Home.swift in Sources */,
Expand Down Expand Up @@ -387,6 +415,38 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
20CE7100282D04D100817D34 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/firebase/firebase-ios-sdk";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 9.0.0;
};
};
20CE7103282D04F100817D34 /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/google/GoogleSignIn-iOS";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 6.0.0;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
20CE7101282D04D100817D34 /* FirebaseAuth */ = {
isa = XCSwiftPackageProductDependency;
package = 20CE7100282D04D100817D34 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseAuth;
};
20CE7104282D04F100817D34 /* GoogleSignIn */ = {
isa = XCSwiftPackageProductDependency;
package = 20CE7103282D04F100817D34 /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */;
productName = GoogleSignIn;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 203073CC282D0204006F7F26 /* Project object */;
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Promises (Playground) 1.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>2</integer>
</dict>
<key>Promises (Playground) 2.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>3</integer>
</dict>
<key>Promises (Playground).xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>0</integer>
</dict>
<key>SignInUsingGoogle.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "LogoTec.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions SignInUsingGoogle/SignInUsingGoogle/Helper/+View.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// +View.swift
// SignInUsingGoogle
//
// Created by Alumno on 9/09/24.
//

import Foundation

import SwiftUI

extension View {
func getRootViewController() -> UIViewController {
guard let screen = UIApplication.shared.connectedScenes.first as? UIWindowScene else {
return .init()
}

guard let root = screen.windows.first?.rootViewController else {
return .init()
}


return root
}
}
Loading