Skip to content

Commit

Permalink
fix: replace deprecated usage of getConfig method on iOS (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-cz authored Feb 19, 2024
1 parent 110d7f7 commit 90ba960
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions ios/Plugin/Plugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@ public class GoogleAuth: CAPPlugin {
let defaultGrantedScopes = ["email", "profile", "openid"];

// these are scopes we will need to request after sign in
additionalScopes = (getConfigValue("scopes") as? [String] ?? []).filter {
additionalScopes = (getConfig().getArray("scopes") as? [String] ?? []).filter {
return !defaultGrantedScopes.contains($0);
};

if let forceAuthCodeConfig = getConfigValue("forceCodeForRefreshToken") as? Bool {
forceAuthCode = forceAuthCodeConfig;
}
forceAuthCode = getConfig().getBoolean("forceCodeForRefreshToken", false)

NotificationCenter.default.addObserver(self, selector: #selector(handleOpenUrl(_ :)), name: Notification.Name(Notification.Name.capacitorOpenURL.rawValue), object: nil);
}
Expand Down Expand Up @@ -118,10 +116,10 @@ public class GoogleAuth: CAPPlugin {


func getClientIdValue() -> String? {
if let clientId = getConfigValue("iosClientId") as? String {
if let clientId = getConfig().getString("iosClientId") {
return clientId;
}
else if let clientId = getConfigValue("clientId") as? String {
else if let clientId = getConfig().getString("clientId") {
return clientId;
}
else if let path = Bundle.main.path(forResource: "GoogleService-Info", ofType: "plist"),
Expand All @@ -133,7 +131,7 @@ public class GoogleAuth: CAPPlugin {
}

func getServerClientIdValue() -> String? {
if let serverClientId = getConfigValue("serverClientId") as? String {
if let serverClientId = getConfig().getString("serverClientId") {
return serverClientId;
}
return nil;
Expand Down

0 comments on commit 90ba960

Please sign in to comment.