@@ -31,13 +31,11 @@ public class GoogleAuth: CAPPlugin {
3131 let defaultGrantedScopes = [ " email " , " profile " , " openid " ] ;
3232
3333 // 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 {
3535 return !defaultGrantedScopes. contains ( $0) ;
3636 } ;
3737
38- if let forceAuthCodeConfig = getConfigValue ( " forceCodeForRefreshToken " ) as? Bool {
39- forceAuthCode = forceAuthCodeConfig;
40- }
38+ forceAuthCode = getConfig ( ) . getBoolean ( " forceCodeForRefreshToken " , false )
4139
4240 NotificationCenter . default. addObserver ( self , selector: #selector( handleOpenUrl ( _ : ) ) , name: Notification . Name ( Notification . Name. capacitorOpenURL. rawValue) , object: nil ) ;
4341 }
@@ -118,10 +116,10 @@ public class GoogleAuth: CAPPlugin {
118116
119117
120118 func getClientIdValue( ) -> String ? {
121- if let clientId = getConfigValue ( " iosClientId " ) as? String {
119+ if let clientId = getConfig ( ) . getString ( " iosClientId " ) {
122120 return clientId;
123121 }
124- else if let clientId = getConfigValue ( " clientId " ) as? String {
122+ else if let clientId = getConfig ( ) . getString ( " clientId " ) {
125123 return clientId;
126124 }
127125 else if let path = Bundle . main. path ( forResource: " GoogleService-Info " , ofType: " plist " ) ,
@@ -133,7 +131,7 @@ public class GoogleAuth: CAPPlugin {
133131 }
134132
135133 func getServerClientIdValue( ) -> String ? {
136- if let serverClientId = getConfigValue ( " serverClientId " ) as? String {
134+ if let serverClientId = getConfig ( ) . getString ( " serverClientId " ) {
137135 return serverClientId;
138136 }
139137 return nil ;
0 commit comments