diff --git a/.changeset/hip-coins-talk.md b/.changeset/hip-coins-talk.md new file mode 100644 index 00000000..2e51a3d5 --- /dev/null +++ b/.changeset/hip-coins-talk.md @@ -0,0 +1,5 @@ +--- +"@capacitor-firebase/authentication": minor +--- + +feat: provide access tokens for Google and Facebook diff --git a/README.md b/README.md index e12015c5..0e87bb83 100644 --- a/README.md +++ b/README.md @@ -20,13 +20,13 @@ Click on the name of the desired plugin under the [`Plugins`](#plugins) section ## Plugins -| Name | Package | Version | Downloads | -| ----------------------------------------------------------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| [Analytics](./packages/analytics/README.md#installation) | `@capacitor-firebase/analytics` | [![npm badge](https://img.shields.io/npm/v/@capacitor-firebase/analytics?style=flat-square)](https://www.npmjs.com/package/@capacitor-firebase/analytics) | [![npm downloads](https://img.shields.io/npm/dw/@capacitor-firebase/analytics?style=flat-square)](https://www.npmjs.com/package/@capacitor-firebase/analytics) | -| [App](./packages/app/README.md#installation) | `@capacitor-firebase/app` | [![npm badge](https://img.shields.io/npm/v/@capacitor-firebase/app?style=flat-square)](https://www.npmjs.com/package/@capacitor-firebase/app) | [![npm downloads](https://img.shields.io/npm/dw/@capacitor-firebase/app?style=flat-square)](https://www.npmjs.com/package/@capacitor-firebase/app) | -| [Authentication](./packages/authentication/README.md#installation) | `@capacitor-firebase/authentication` | [![npm badge](https://img.shields.io/npm/v/@capacitor-firebase/authentication?style=flat-square)](https://www.npmjs.com/package/@capacitor-firebase/authentication) | [![npm downloads](https://img.shields.io/npm/dw/@capacitor-firebase/authentication?style=flat-square)](https://www.npmjs.com/package/@capacitor-firebase/authentication) | -| [Crashlytics](./packages/crashlytics/README.md#installation) | `@capacitor-firebase/crashlytics` | [![npm badge](https://img.shields.io/npm/v/@capacitor-firebase/crashlytics?style=flat-square)](https://www.npmjs.com/package/@capacitor-firebase/crashlytics) | [![npm downloads](https://img.shields.io/npm/dw/@capacitor-firebase/crashlytics?style=flat-square)](https://www.npmjs.com/package/@capacitor-firebase/crashlytics) | -| [Performance Monitoring](./packages/performance/README.md#installation) | `@capacitor-firebase/performance` | [![npm badge](https://img.shields.io/npm/v/@capacitor-firebase/performance?style=flat-square)](https://www.npmjs.com/package/@capacitor-firebase/performance) | [![npm downloads](https://img.shields.io/npm/dw/@capacitor-firebase/performance?style=flat-square)](https://www.npmjs.com/package/@capacitor-firebase/performance) | +| Name | Package | Version | Downloads | +| ---------------------------------------------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| [Analytics](./packages/analytics/README.md) | `@capacitor-firebase/analytics` | [![npm badge](https://img.shields.io/npm/v/@capacitor-firebase/analytics?style=flat-square)](https://www.npmjs.com/package/@capacitor-firebase/analytics) | [![npm downloads](https://img.shields.io/npm/dw/@capacitor-firebase/analytics?style=flat-square)](https://www.npmjs.com/package/@capacitor-firebase/analytics) | +| [App](./packages/app/README.md) | `@capacitor-firebase/app` | [![npm badge](https://img.shields.io/npm/v/@capacitor-firebase/app?style=flat-square)](https://www.npmjs.com/package/@capacitor-firebase/app) | [![npm downloads](https://img.shields.io/npm/dw/@capacitor-firebase/app?style=flat-square)](https://www.npmjs.com/package/@capacitor-firebase/app) | +| [Authentication](./packages/authentication/README.md) | `@capacitor-firebase/authentication` | [![npm badge](https://img.shields.io/npm/v/@capacitor-firebase/authentication?style=flat-square)](https://www.npmjs.com/package/@capacitor-firebase/authentication) | [![npm downloads](https://img.shields.io/npm/dw/@capacitor-firebase/authentication?style=flat-square)](https://www.npmjs.com/package/@capacitor-firebase/authentication) | +| [Crashlytics](./packages/crashlytics/README.md) | `@capacitor-firebase/crashlytics` | [![npm badge](https://img.shields.io/npm/v/@capacitor-firebase/crashlytics?style=flat-square)](https://www.npmjs.com/package/@capacitor-firebase/crashlytics) | [![npm downloads](https://img.shields.io/npm/dw/@capacitor-firebase/crashlytics?style=flat-square)](https://www.npmjs.com/package/@capacitor-firebase/crashlytics) | +| [Performance Monitoring](./packages/performance/README.md) | `@capacitor-firebase/performance` | [![npm badge](https://img.shields.io/npm/v/@capacitor-firebase/performance?style=flat-square)](https://www.npmjs.com/package/@capacitor-firebase/performance) | [![npm downloads](https://img.shields.io/npm/dw/@capacitor-firebase/performance?style=flat-square)](https://www.npmjs.com/package/@capacitor-firebase/performance) | ## License diff --git a/package-lock.json b/package-lock.json index b32bb434..0636e044 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7062,7 +7062,7 @@ }, "packages/analytics": { "name": "@capacitor-firebase/analytics", - "version": "0.1.1", + "version": "0.2.0", "license": "Apache-2.0", "devDependencies": { "@capacitor/android": "3.4.0", @@ -7089,7 +7089,7 @@ }, "packages/app": { "name": "@capacitor-firebase/app", - "version": "0.1.1", + "version": "0.2.0", "license": "Apache-2.0", "devDependencies": { "@capacitor/android": "3.4.0", @@ -7116,7 +7116,7 @@ }, "packages/authentication": { "name": "@capacitor-firebase/authentication", - "version": "0.1.1", + "version": "0.2.0", "license": "Apache-2.0", "devDependencies": { "@capacitor/android": "3.4.0", @@ -7143,7 +7143,7 @@ }, "packages/crashlytics": { "name": "@capacitor-firebase/crashlytics", - "version": "0.1.1", + "version": "0.2.0", "license": "Apache-2.0", "devDependencies": { "@capacitor/android": "3.4.0", @@ -7169,7 +7169,7 @@ }, "packages/performance": { "name": "@capacitor-firebase/performance", - "version": "0.1.1", + "version": "0.2.0", "license": "Apache-2.0", "devDependencies": { "@capacitor/android": "3.4.0", diff --git a/packages/authentication/android/src/main/java/dev/robingenz/capacitorjs/plugins/firebase/authentication/FirebaseAuthentication.java b/packages/authentication/android/src/main/java/dev/robingenz/capacitorjs/plugins/firebase/authentication/FirebaseAuthentication.java index 7ea5d240..4959983f 100644 --- a/packages/authentication/android/src/main/java/dev/robingenz/capacitorjs/plugins/firebase/authentication/FirebaseAuthentication.java +++ b/packages/authentication/android/src/main/java/dev/robingenz/capacitorjs/plugins/firebase/authentication/FirebaseAuthentication.java @@ -151,7 +151,7 @@ public void onComplete(@NonNull Task task) { if (task.isSuccessful()) { Log.d(FirebaseAuthenticationPlugin.TAG, "signInWithCustomToken succeeded."); FirebaseUser user = getCurrentUser(); - JSObject signInResult = FirebaseAuthenticationHelper.createSignInResult(user, null, null); + JSObject signInResult = FirebaseAuthenticationHelper.createSignInResult(user, null, null, null, null); call.resolve(signInResult); } else { Log.e(FirebaseAuthenticationPlugin.TAG, "signInWithCustomToken failed.", task.getException()); @@ -213,13 +213,19 @@ public void handleOnActivityResult(int requestCode, int resultCode, Intent data) } public void handleSuccessfulSignIn(final PluginCall call, AuthCredential credential, String idToken) { - handleSuccessfulSignIn(call, credential, idToken, null); + handleSuccessfulSignIn(call, credential, idToken, null, null); } - public void handleSuccessfulSignIn(final PluginCall call, AuthCredential credential, String idToken, String nonce) { + public void handleSuccessfulSignIn( + final PluginCall call, + @Nullable AuthCredential credential, + @Nullable String idToken, + @Nullable String nonce, + @Nullable String accessToken + ) { boolean skipNativeAuth = this.config.getSkipNativeAuth(); if (skipNativeAuth) { - JSObject signInResult = FirebaseAuthenticationHelper.createSignInResult(null, credential, idToken, nonce); + JSObject signInResult = FirebaseAuthenticationHelper.createSignInResult(null, credential, idToken, nonce, accessToken); call.resolve(signInResult); return; } @@ -233,7 +239,13 @@ public void onComplete(@NonNull Task task) { if (task.isSuccessful()) { Log.d(FirebaseAuthenticationPlugin.TAG, "signInWithCredential succeeded."); FirebaseUser user = getCurrentUser(); - JSObject signInResult = FirebaseAuthenticationHelper.createSignInResult(user, credential, idToken, nonce); + JSObject signInResult = FirebaseAuthenticationHelper.createSignInResult( + user, + credential, + idToken, + nonce, + accessToken + ); call.resolve(signInResult); } else { Log.e(FirebaseAuthenticationPlugin.TAG, "signInWithCredential failed.", task.getException()); diff --git a/packages/authentication/android/src/main/java/dev/robingenz/capacitorjs/plugins/firebase/authentication/FirebaseAuthenticationHelper.java b/packages/authentication/android/src/main/java/dev/robingenz/capacitorjs/plugins/firebase/authentication/FirebaseAuthenticationHelper.java index 5261f4a5..51a37cce 100644 --- a/packages/authentication/android/src/main/java/dev/robingenz/capacitorjs/plugins/firebase/authentication/FirebaseAuthenticationHelper.java +++ b/packages/authentication/android/src/main/java/dev/robingenz/capacitorjs/plugins/firebase/authentication/FirebaseAuthenticationHelper.java @@ -1,31 +1,29 @@ package dev.robingenz.capacitorjs.plugins.firebase.authentication; +import androidx.annotation.Nullable; import com.getcapacitor.JSObject; import com.google.firebase.auth.AuthCredential; import com.google.firebase.auth.FirebaseUser; -import com.google.firebase.auth.GetTokenResult; -import com.google.firebase.auth.GoogleAuthCredential; import com.google.firebase.auth.OAuthCredential; -import com.google.firebase.auth.PhoneAuthCredential; -import dev.robingenz.capacitorjs.plugins.firebase.authentication.handlers.GoogleAuthProviderHandler; -import dev.robingenz.capacitorjs.plugins.firebase.authentication.handlers.OAuthProviderHandler; public class FirebaseAuthenticationHelper { - public static JSObject createSignInResult(FirebaseUser user, AuthCredential credential, String idToken) { - return createSignInResult(user, credential, idToken, null); - } - - public static JSObject createSignInResult(FirebaseUser user, AuthCredential credential, String idToken, String nonce) { + public static JSObject createSignInResult( + @Nullable FirebaseUser user, + @Nullable AuthCredential credential, + @Nullable String idToken, + @Nullable String nonce, + @Nullable String accessToken + ) { JSObject userResult = FirebaseAuthenticationHelper.createUserResult(user); - JSObject credentialResult = FirebaseAuthenticationHelper.createCredentialResult(credential, idToken, nonce); + JSObject credentialResult = FirebaseAuthenticationHelper.createCredentialResult(credential, idToken, nonce, accessToken); JSObject result = new JSObject(); result.put("user", userResult); result.put("credential", credentialResult); return result; } - public static JSObject createUserResult(FirebaseUser user) { + public static JSObject createUserResult(@Nullable FirebaseUser user) { if (user == null) { return null; } @@ -42,8 +40,13 @@ public static JSObject createUserResult(FirebaseUser user) { return result; } - public static JSObject createCredentialResult(AuthCredential credential, String idToken, String nonce) { - if (credential == null && idToken == null) { + public static JSObject createCredentialResult( + @Nullable AuthCredential credential, + @Nullable String idToken, + @Nullable String nonce, + @Nullable String accessToken + ) { + if (credential == null && idToken == null && nonce == null && accessToken == null) { return null; } JSObject result = new JSObject(); @@ -70,6 +73,9 @@ public static JSObject createCredentialResult(AuthCredential credential, String if (nonce != null) { result.put("nonce", nonce); } + if (accessToken != null) { + result.put("accessToken", accessToken); + } return result; } } diff --git a/packages/authentication/android/src/main/java/dev/robingenz/capacitorjs/plugins/firebase/authentication/handlers/AppleAuthProviderHandler.java b/packages/authentication/android/src/main/java/dev/robingenz/capacitorjs/plugins/firebase/authentication/handlers/AppleAuthProviderHandler.java index bc7cc68d..529b6534 100644 --- a/packages/authentication/android/src/main/java/dev/robingenz/capacitorjs/plugins/firebase/authentication/handlers/AppleAuthProviderHandler.java +++ b/packages/authentication/android/src/main/java/dev/robingenz/capacitorjs/plugins/firebase/authentication/handlers/AppleAuthProviderHandler.java @@ -86,7 +86,7 @@ private void startActivityForSignIn(final PluginCall call, OAuthProvider.Builder .addOnSuccessListener( authResult -> { AuthCredential credential = authResult.getCredential(); - pluginImplementation.handleSuccessfulSignIn(call, credential, null, currentNonce); + pluginImplementation.handleSuccessfulSignIn(call, credential, null, currentNonce, null); } ) .addOnFailureListener(exception -> pluginImplementation.handleFailedSignIn(call, null, exception)); @@ -97,7 +97,7 @@ private void finishActivityForSignIn(final PluginCall call, Task pen .addOnSuccessListener( authResult -> { AuthCredential credential = authResult.getCredential(); - pluginImplementation.handleSuccessfulSignIn(call, credential, null, currentNonce); + pluginImplementation.handleSuccessfulSignIn(call, credential, null, currentNonce, null); } ) .addOnFailureListener(exception -> pluginImplementation.handleFailedSignIn(call, null, exception)); diff --git a/packages/authentication/android/src/main/java/dev/robingenz/capacitorjs/plugins/firebase/authentication/handlers/FacebookAuthProviderHandler.java b/packages/authentication/android/src/main/java/dev/robingenz/capacitorjs/plugins/firebase/authentication/handlers/FacebookAuthProviderHandler.java index af9646d6..374e348e 100644 --- a/packages/authentication/android/src/main/java/dev/robingenz/capacitorjs/plugins/firebase/authentication/handlers/FacebookAuthProviderHandler.java +++ b/packages/authentication/android/src/main/java/dev/robingenz/capacitorjs/plugins/firebase/authentication/handlers/FacebookAuthProviderHandler.java @@ -69,9 +69,9 @@ public void handleOnActivityResult(int requestCode, int resultCode, Intent data) private void handleSuccessCallback(LoginResult loginResult) { AccessToken accessToken = loginResult.getAccessToken(); - String token = accessToken.getToken(); - AuthCredential credential = FacebookAuthProvider.getCredential(token); - pluginImplementation.handleSuccessfulSignIn(savedCall, credential, token); + String accessTokenString = accessToken.getToken(); + AuthCredential credential = FacebookAuthProvider.getCredential(accessTokenString); + pluginImplementation.handleSuccessfulSignIn(savedCall, credential, accessTokenString, null, accessTokenString); } private void handleCancelCallback() { diff --git a/packages/authentication/android/src/main/java/dev/robingenz/capacitorjs/plugins/firebase/authentication/handlers/PhoneAuthProviderHandler.java b/packages/authentication/android/src/main/java/dev/robingenz/capacitorjs/plugins/firebase/authentication/handlers/PhoneAuthProviderHandler.java index 1ac1f04e..9303537d 100644 --- a/packages/authentication/android/src/main/java/dev/robingenz/capacitorjs/plugins/firebase/authentication/handlers/PhoneAuthProviderHandler.java +++ b/packages/authentication/android/src/main/java/dev/robingenz/capacitorjs/plugins/firebase/authentication/handlers/PhoneAuthProviderHandler.java @@ -61,7 +61,7 @@ public void onVerificationFailed(FirebaseException exception) { @Override public void onCodeSent(@NonNull String verificationId, @NonNull PhoneAuthProvider.ForceResendingToken token) { - JSObject result = FirebaseAuthenticationHelper.createSignInResult(null, null, null); + JSObject result = FirebaseAuthenticationHelper.createSignInResult(null, null, null, null, null); result.put("verificationId", verificationId); call.resolve(result); } diff --git a/packages/authentication/ios/Plugin/FirebaseAuthentication.swift b/packages/authentication/ios/Plugin/FirebaseAuthentication.swift index ea1e1615..294ac31a 100644 --- a/packages/authentication/ios/Plugin/FirebaseAuthentication.swift +++ b/packages/authentication/ios/Plugin/FirebaseAuthentication.swift @@ -108,7 +108,7 @@ public typealias AuthStateChangedObserver = () -> Void return } let user = self.getCurrentUser() - let result = FirebaseAuthenticationHelper.createSignInResult(credential: nil, user: user, idToken: nil, nonce: nil) + let result = FirebaseAuthenticationHelper.createSignInResult(credential: nil, user: user, idToken: nil, nonce: nil, accessToken: nil) savedCall.resolve(result) } } @@ -132,12 +132,12 @@ public typealias AuthStateChangedObserver = () -> Void Auth.auth().useEmulator(withHost: host, port: port) } - func handleSuccessfulSignIn(credential: AuthCredential, idToken: String?, nonce: String?) { + func handleSuccessfulSignIn(credential: AuthCredential, idToken: String?, nonce: String?, accessToken: String?) { if config.skipNativeAuth == true { guard let savedCall = self.savedCall else { return } - let result = FirebaseAuthenticationHelper.createSignInResult(credential: credential, user: nil, idToken: idToken, nonce: nonce) + let result = FirebaseAuthenticationHelper.createSignInResult(credential: credential, user: nil, idToken: idToken, nonce: nonce, accessToken: accessToken) savedCall.resolve(result) return } @@ -150,7 +150,7 @@ public typealias AuthStateChangedObserver = () -> Void return } let user = self.getCurrentUser() - let result = FirebaseAuthenticationHelper.createSignInResult(credential: credential, user: user, idToken: idToken, nonce: nonce) + let result = FirebaseAuthenticationHelper.createSignInResult(credential: credential, user: user, idToken: idToken, nonce: nonce, accessToken: accessToken) savedCall.resolve(result) } } diff --git a/packages/authentication/ios/Plugin/FirebaseAuthenticationHelper.swift b/packages/authentication/ios/Plugin/FirebaseAuthenticationHelper.swift index 7c8f9890..9ae432ee 100644 --- a/packages/authentication/ios/Plugin/FirebaseAuthenticationHelper.swift +++ b/packages/authentication/ios/Plugin/FirebaseAuthenticationHelper.swift @@ -4,9 +4,9 @@ import FirebaseCore import FirebaseAuth public class FirebaseAuthenticationHelper { - public static func createSignInResult(credential: AuthCredential?, user: User?, idToken: String?, nonce: String?) -> JSObject { + public static func createSignInResult(credential: AuthCredential?, user: User?, idToken: String?, nonce: String?, accessToken: String?) -> JSObject { let userResult = self.createUserResult(user) - let credentialResult = self.createCredentialResult(credential, idToken: idToken, nonce: nonce) + let credentialResult = self.createCredentialResult(credential, idToken: idToken, nonce: nonce, accessToken: accessToken) var result = JSObject() result["user"] = userResult result["credential"] = credentialResult @@ -30,8 +30,8 @@ public class FirebaseAuthenticationHelper { return result } - public static func createCredentialResult(_ credential: AuthCredential?, idToken: String?, nonce: String?) -> JSObject? { - if credential == nil && idToken == nil && nonce == nil { + public static func createCredentialResult(_ credential: AuthCredential?, idToken: String?, nonce: String?, accessToken: String?) -> JSObject? { + if credential == nil && idToken == nil && nonce == nil && accessToken == nil { return nil } var result = JSObject() @@ -58,6 +58,9 @@ public class FirebaseAuthenticationHelper { if let nonce = nonce { result["nonce"] = nonce } + if let accessToken = accessToken { + result["accessToken"] = accessToken + } return result } } diff --git a/packages/authentication/ios/Plugin/Handlers/AppleAuthProviderHandler.swift b/packages/authentication/ios/Plugin/Handlers/AppleAuthProviderHandler.swift index 7d45b773..332513a2 100644 --- a/packages/authentication/ios/Plugin/Handlers/AppleAuthProviderHandler.swift +++ b/packages/authentication/ios/Plugin/Handlers/AppleAuthProviderHandler.swift @@ -104,7 +104,7 @@ extension AppleAuthProviderHandler: ASAuthorizationControllerDelegate, ASAuthori return } let credential = OAuthProvider.credential(withProviderID: "apple.com", idToken: idTokenString, rawNonce: nonce) - self.pluginImplementation.handleSuccessfulSignIn(credential: credential, idToken: idTokenString, nonce: nonce) + self.pluginImplementation.handleSuccessfulSignIn(credential: credential, idToken: idTokenString, nonce: nonce, accessToken: nil) } func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) { diff --git a/packages/authentication/ios/Plugin/Handlers/FacebookAuthProviderHandler.swift b/packages/authentication/ios/Plugin/Handlers/FacebookAuthProviderHandler.swift index 764ff85c..0fc4a3d6 100644 --- a/packages/authentication/ios/Plugin/Handlers/FacebookAuthProviderHandler.swift +++ b/packages/authentication/ios/Plugin/Handlers/FacebookAuthProviderHandler.swift @@ -34,9 +34,9 @@ class FacebookAuthProviderHandler: NSObject { return } - let token = accessToken.tokenString - let credential = FacebookAuthProvider.credential(withAccessToken: token) - self.pluginImplementation.handleSuccessfulSignIn(credential: credential, idToken: token, nonce: nil) + let accessTokenString = accessToken.tokenString + let credential = FacebookAuthProvider.credential(withAccessToken: accessTokenString) + self.pluginImplementation.handleSuccessfulSignIn(credential: credential, idToken: accessTokenString, nonce: nil, accessToken: accessTokenString) } } #endif diff --git a/packages/authentication/ios/Plugin/Handlers/GoogleAuthProviderHandler.swift b/packages/authentication/ios/Plugin/Handlers/GoogleAuthProviderHandler.swift index d67590c8..7698f81a 100644 --- a/packages/authentication/ios/Plugin/Handlers/GoogleAuthProviderHandler.swift +++ b/packages/authentication/ios/Plugin/Handlers/GoogleAuthProviderHandler.swift @@ -29,9 +29,10 @@ class GoogleAuthProviderHandler: NSObject { guard let authentication = user?.authentication else { return } guard let idToken = authentication.idToken else { return } + let accessToken = authentication.accessToken let credential = GoogleAuthProvider.credential(withIDToken: idToken, accessToken: authentication.accessToken) - self.pluginImplementation.handleSuccessfulSignIn(credential: credential, idToken: idToken, nonce: nil) + self.pluginImplementation.handleSuccessfulSignIn(credential: credential, idToken: idToken, nonce: nil, accessToken: accessToken) } } #endif diff --git a/packages/authentication/ios/Plugin/Handlers/OAuthProviderHandler.swift b/packages/authentication/ios/Plugin/Handlers/OAuthProviderHandler.swift index 2e3ffbf2..d07ea828 100644 --- a/packages/authentication/ios/Plugin/Handlers/OAuthProviderHandler.swift +++ b/packages/authentication/ios/Plugin/Handlers/OAuthProviderHandler.swift @@ -42,7 +42,7 @@ class OAuthProviderHandler: NSObject { return } if let credential = credential { - self.pluginImplementation.handleSuccessfulSignIn(credential: credential, idToken: nil, nonce: nil) + self.pluginImplementation.handleSuccessfulSignIn(credential: credential, idToken: nil, nonce: nil, accessToken: nil) } } } diff --git a/packages/authentication/ios/Plugin/Handlers/PhoneAuthProviderHandler.swift b/packages/authentication/ios/Plugin/Handlers/PhoneAuthProviderHandler.swift index 45c13b7f..db12224c 100644 --- a/packages/authentication/ios/Plugin/Handlers/PhoneAuthProviderHandler.swift +++ b/packages/authentication/ios/Plugin/Handlers/PhoneAuthProviderHandler.swift @@ -34,7 +34,7 @@ class PhoneAuthProviderHandler: NSObject { return } - var result = FirebaseAuthenticationHelper.createSignInResult(credential: nil, user: nil, idToken: nil, nonce: nil) + var result = FirebaseAuthenticationHelper.createSignInResult(credential: nil, user: nil, idToken: nil, nonce: nil, accessToken: nil) result["verificationId"] = verificationID call.resolve(result) } @@ -48,6 +48,6 @@ class PhoneAuthProviderHandler: NSObject { withVerificationID: verificationID, verificationCode: verificationCode ) - self.pluginImplementation.handleSuccessfulSignIn(credential: credential, idToken: nil, nonce: nil) + self.pluginImplementation.handleSuccessfulSignIn(credential: credential, idToken: nil, nonce: nil, accessToken: nil) } }