Skip to content

Commit 0b853f2

Browse files
authored
fix: add optional ? to fix build issue #57 (#79)
1 parent 85d1bd5 commit 0b853f2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ios/Plugin/Plugin.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ public class GoogleAuth: CAPPlugin {
1111
var signInCall: CAPPluginCall?
1212
let googleSignIn: GIDSignIn = GIDSignIn.sharedInstance();
1313
var forceAuthCode: Bool = false;
14-
14+
1515
public override func load() {
1616
guard let path = Bundle.main.path(forResource: "GoogleService-Info", ofType: "plist") else {return}
1717
guard let dict = NSDictionary(contentsOfFile: path) as? [String: AnyObject] else {return}
1818
guard let clientId = dict["CLIENT_ID"] as? String else {return}
1919
googleSignIn.clientID = clientId;
2020
googleSignIn.delegate = self;
21-
googleSignIn.presentingViewController = bridge.viewController;
21+
googleSignIn.presentingViewController = bridge?.viewController;
2222
if let serverClientId = getConfigValue("serverClientId") as? String {
2323
googleSignIn.serverClientID = serverClientId;
2424
}
@@ -30,7 +30,7 @@ public class GoogleAuth: CAPPlugin {
3030
}
3131
NotificationCenter.default.addObserver(self, selector: #selector(handleOpenUrl(_ :)), name: Notification.Name(CAPNotifications.URLOpen.name()), object: nil);
3232
}
33-
33+
3434
@objc
3535
func signIn(_ call: CAPPluginCall) {
3636
signInCall = call;
@@ -42,7 +42,7 @@ public class GoogleAuth: CAPPlugin {
4242
}
4343
}
4444
}
45-
45+
4646
@objc
4747
func refresh(_ call: CAPPluginCall) {
4848
DispatchQueue.main.async {
@@ -64,15 +64,15 @@ public class GoogleAuth: CAPPlugin {
6464
}
6565
}
6666
}
67-
67+
6868
@objc
6969
func signOut(_ call: CAPPluginCall) {
7070
DispatchQueue.main.async {
7171
self.googleSignIn.signOut();
7272
}
7373
call.success();
7474
}
75-
75+
7676
@objc
7777
func handleOpenUrl(_ notification: Notification) {
7878
guard let object = notification.object as? [String: Any] else {
@@ -85,7 +85,7 @@ public class GoogleAuth: CAPPlugin {
8585
}
8686
googleSignIn.handle(url);
8787
}
88-
88+
8989
func processCallback(user: GIDGoogleUser) {
9090
var userData: [String: Any] = [
9191
"authentication": [

0 commit comments

Comments
 (0)