Skip to content

Commit

Permalink
feat(authentication): support scopes option for Google Sign-In on i…
Browse files Browse the repository at this point in the history
…OS (#440)
  • Loading branch information
robingenz authored Sep 27, 2023
1 parent 855cee2 commit 2ea241b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/early-plums-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@capacitor-firebase/authentication': minor
---

feat(ios): support `scopes` option for Google Sign-In
2 changes: 1 addition & 1 deletion packages/authentication/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1634,7 +1634,7 @@ Remove all listeners for this plugin.
| ---------------------- | ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----- |
| **`customParameters`** | <code>SignInCustomParameter[]</code> | Configures custom parameters to be passed to the identity provider during the OAuth sign-in flow. Supports Apple, Facebook, GitHub, Google, Microsoft, Twitter and Yahoo on Web. Supports Apple, GitHub, Microsoft, Twitter and Yahoo on Android. Supports Facebook, GitHub, Microsoft, Twitter and Yahoo on iOS. | | 1.1.0 |
| **`mode`** | <code>'popup' \| 'redirect'</code> | Whether to use the popup-based OAuth authentication flow or the full-page redirect flow. If you choose `redirect`, you will get the result of the call via the `authStateChange` listener after the redirect. | <code>'popup'</code> | 1.3.0 |
| **`scopes`** | <code>string[]</code> | Scopes to request from provider. Supports Apple, Facebook, GitHub, Google, Microsoft, Twitter and Yahoo on Web. Supports Apple, GitHub, Google, Microsoft, Twitter, Yahoo and Play Games on Android. Supports Facebook, GitHub, Microsoft, Twitter and Yahoo on iOS. | | 1.1.0 |
| **`scopes`** | <code>string[]</code> | Scopes to request from provider. Supports Apple, Facebook, GitHub, Google, Microsoft, Twitter and Yahoo on Web. Supports Apple, GitHub, Google, Microsoft, Twitter, Yahoo and Play Games on Android. Supports Facebook, GitHub, Google, Microsoft, Twitter and Yahoo on iOS. | | 1.1.0 |


#### SignInCustomParameter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class GoogleAuthProviderHandler: NSObject {
let scopes = call.getArray("scopes", String.self) ?? []

DispatchQueue.main.async {
GIDSignIn.sharedInstance.signIn(withPresenting: controller) { [unowned self] result, error in
GIDSignIn.sharedInstance.signIn(withPresenting: controller, scopes: scopes) { [unowned self] result, error in
if let error = error {
if isLink == true {
self.pluginImplementation.handleFailedLink(message: nil, error: error)
Expand Down
2 changes: 1 addition & 1 deletion packages/authentication/src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ export interface SignInWithOAuthOptions extends SignInOptions {
*
* Supports Apple, Facebook, GitHub, Google, Microsoft, Twitter and Yahoo on Web.
* Supports Apple, GitHub, Google, Microsoft, Twitter, Yahoo and Play Games on Android.
* Supports Facebook, GitHub, Microsoft, Twitter and Yahoo on iOS.
* Supports Facebook, GitHub, Google, Microsoft, Twitter and Yahoo on iOS.
*
* @since 1.1.0
*/
Expand Down

0 comments on commit 2ea241b

Please sign in to comment.