@@ -31,13 +31,11 @@ public class GoogleAuth: CAPPlugin {
31
31
let defaultGrantedScopes = [ " email " , " profile " , " openid " ] ;
32
32
33
33
// these are scopes we will need to request after sign in
34
- additionalScopes = ( getConfigValue ( " scopes " ) as? [ String ] ?? [ ] ) . filter {
34
+ additionalScopes = ( getConfig ( ) . getArray ( " scopes " ) as? [ String ] ?? [ ] ) . filter {
35
35
return !defaultGrantedScopes. contains ( $0) ;
36
36
} ;
37
37
38
- if let forceAuthCodeConfig = getConfigValue ( " forceCodeForRefreshToken " ) as? Bool {
39
- forceAuthCode = forceAuthCodeConfig;
40
- }
38
+ forceAuthCode = getConfig ( ) . getBoolean ( " forceCodeForRefreshToken " , false )
41
39
42
40
NotificationCenter . default. addObserver ( self , selector: #selector( handleOpenUrl ( _ : ) ) , name: Notification . Name ( Notification . Name. capacitorOpenURL. rawValue) , object: nil ) ;
43
41
}
@@ -118,10 +116,10 @@ public class GoogleAuth: CAPPlugin {
118
116
119
117
120
118
func getClientIdValue( ) -> String ? {
121
- if let clientId = getConfigValue ( " iosClientId " ) as? String {
119
+ if let clientId = getConfig ( ) . getString ( " iosClientId " ) {
122
120
return clientId;
123
121
}
124
- else if let clientId = getConfigValue ( " clientId " ) as? String {
122
+ else if let clientId = getConfig ( ) . getString ( " clientId " ) {
125
123
return clientId;
126
124
}
127
125
else if let path = Bundle . main. path ( forResource: " GoogleService-Info " , ofType: " plist " ) ,
@@ -133,7 +131,7 @@ public class GoogleAuth: CAPPlugin {
133
131
}
134
132
135
133
func getServerClientIdValue( ) -> String ? {
136
- if let serverClientId = getConfigValue ( " serverClientId " ) as? String {
134
+ if let serverClientId = getConfig ( ) . getString ( " serverClientId " ) {
137
135
return serverClientId;
138
136
}
139
137
return nil ;
0 commit comments