Releases: mirzemehdi/KMPAuth
v2.5.0-alpha01
What's Changed
- Introduce dedicated Facebook auth modules (
kmpauth-firebase-facebookandkmpauth-facebook) by @mirzemehdi in #163 - Upgrade dependencies and add iosX64 target by @mirzemehdi in #164
- Fix(google-jvm): Use dynamically found port for redirect URI by @mirzemehdi in #165
⚠️ Breaking Change — Facebook Login Removed from kmpauth-firebase
Facebook login support is no longer bundled inside kmpauth-firebase.
If you want to continue using Facebook authentication with Firebase, you must now add the following dependency:
implementation("io.github.mirzemehdi:kmpauth-firebase-facebook:<version>")kmpauth-facebook: This new module encapsulates the platform-specific logic for handling Facebook login. It returns aFacebookUserobject containing the access token and nonce upon a successful login, but it does not perform any Firebase authentication itself.kmpauth-firebase-facebook: This module depends onkmpauth-facebookandkmpauth-firebase. It uses the token fromkmpauth-facebookto authenticate the user with Firebase. The composable is renamed toFacebookButtonUiContainerFirebasefor clarity.
This separation improves modularity by decoupling the core Facebook sign-in flow from the Firebase implementation, allowing for more flexible use of the authentication providers. Dependencies in kmpauth-firebase have been updated accordingly.
Additionally, this change:
- Adds the
iosX64target tokmpauth-firebase - Migrates from
compose.materialtocompose.material3inkmpauth-firebaseandsampleApp.
Full Changelog: v2.4.0-alpha05...v2.5.0-alpha01
v2.4.0-alpha05
What's Changed
- Fix android 2.4.0-alpha04 library variants are not published by @mirzemehdi in c8f98b8
Full Changelog: v2.4.0-alpha04...v2.4.0-alpha05
v2.4.0-alpha04
DON'T USE THIS VERSION. USE 2.4.0-alpha05 INSTEAD
Please use 2.4.0-alpha05 version instead, in 2.4.0-alpha04 android sources are not published correctly
What's Changed
- Release 2.4.0 by @mirzemehdi in #115
- Updated Gradle versions and dependencies versions by @MaTriXy in #139
- Implement non-legacy google sign in with scopes on Android. by @jonasbina in #132
- Fix compatibility with Firebase Android BoM 34.0.0. DROP
iosX64target by @ChristianKatzmann in #141 - Fix Icon and text alignment in FacebookSignInButton by @BattlefieldNoob in #142
- Add setting setAutoSelectEnabled(isAutoSelectEnabled) field by @LJOSS in #126
New Contributors
- @MaTriXy made their first contribution in #139
- @jonasbina made their first contribution in #132
- @LJOSS made their first contribution in #126
Full Changelog: v2.4.0-alpha03...v2.4.0-alpha04
v2.4.0-alpha03
What's Changed
- Feat: Facebook Login Integration by @BattlefieldNoob in #134
- Add missing dependency on
kmpauth-coretokmpauth-firebaseby @ChristianKatzmann in #127 - Bumping dependency versions by @mirzemehdi in #137
New Contributors
- @BattlefieldNoob made their first contribution in #134
- @ChristianKatzmann made their first contribution in #127
Full Changelog: v2.4.0-alpha02...v2.4.0-alpha03
Facebook Auth Support
This release adds support for Facebook Login with Firebase authentication in Android and iOS using KMPAuth.
Usage Example
//Facebook button with icon
FacebookButtonUiContainer(
onResult = { result -> /* handle FirebaseUser result or error */ },
linkAccount = false
) {
FacebookSignInButtonIconOnly(onClick = { this.onClick() })
}
//Icon Only Button
FacebookButtonUiContainer(
modifier = Modifier.fillMaxWidth().height(44.dp),
onResult = { result -> /* handle result */ },
linkAccount = false
) {
FacebookSignInButton(fontSize = 19.sp) { this.onClick() }
}
//Custom Button
FacebookButtonUiContainer(
modifier = Modifier.fillMaxWidth().height(44.dp),
onResult = { result -> /* handle result */ },
linkAccount = false
) {
//Your custom Button here
YourCustomButton(fontSize = 19.sp) { this.onClick() }
}
Android Setup
Add these to your res/values/strings.xml:
<string name="facebook_app_id">YOUR_FACEBOOK_APP_ID</string>
<string name="fb_login_protocol_scheme">fbYOUR_FACEBOOK_APP_ID</string>
<string name="facebook_client_token">YOUR_FACEBOOK_CLIENT_TOKEN</string>Add these metadata tags and Facebook Activity to your AndroidManifest.xml inside the <application> tag:
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id" />
<meta-data
android:name="com.facebook.sdk.ClientToken"
android:value="@string/facebook_client_token" />
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name" />For Facebook Login, on Your Main Activity's activity result call KMPAuth.handleFacebookActivityResult function:
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
KMPAuth.handleFacebookActivityResult(requestCode, resultCode, data)
super.onActivityResult(requestCode, resultCode, data)
}IOS Setup
Add Facebook Login SDK Swift Package, and add below to your Info.plist:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fbFACEBOOK_APP_ID</string> <!-- Your Facebook App ID with 'fb' prefix -->
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>FACEBOOK_APP_ID</string>
<key>FacebookClientToken</key>
<string>YOUR_FACEBOOK_CLIENT_TOKEN</string>
<key>FacebookDisplayName</key>
<string>YourAppDisplayName</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
Initialize Facebook SDK on Ios Swift side
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
FirebaseApp.configure()
// Initialize Facebook SDK.
FBSDKCoreKit.ApplicationDelegate.shared.application(
application,
didFinishLaunchingWithOptions: launchOptions
)
return true
}
func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:]
) -> Bool {
var handled: Bool
handled = FBSDKCoreKit.ApplicationDelegate.shared.application(
app,
open: url,
options: options
)
if handled {
return true
}
return false
}Notes
- You must configure your Facebook App in Facebook Developers Console properly and enable Firebase Facebook provider.
- This release currently supports Android and iOS only.
- Facebook Login for iOS - https://developers.facebook.com/docs/facebook-login/android
- Facebook Login for Android - https://developers.facebook.com/docs/facebook-login/ios
- Firebase Authentication with Facebook - https://firebase.google.com/docs/auth/android/facebook-login
- Firebase Authentication with Facebook iOS - https://firebase.google.com/docs/auth/ios/facebook-login
v2.4.0-alpha02
What's Changed
- Custom Logger implementation by @mirzemehdi in #118
- Web support (WASM and JS) for
kmpauth-google,kmpauth-coreandkmpauth-uihelpermodules by @mirzemehdi in #119 - Make
KMPAuthContextInitializerpublic by @mirzemehdi in #120 - Logger improvement by @mirzemehdi in #122
- Fix
Port Address already in use: bindin desktop target by @mirzemehdi in #121
Full Changelog: v2.4.0-alpha01...v2.4.0-alpha02
v2.4.0-alpha01
What's Changed
- Bump compose to 1.8.0 and kotlin to 2.1.20 by @mirzemehdi in #113
- Migrating maven publish by @mirzemehdi in #114
Full Changelog: v2.3.1...v2.4.0-alpha01
v2.3.1
What's Changed
- Adding scopes into GoogleButtonUiContainer and GoogleButtonUiCOntainerFirebase by @mirzemehdi in 65ab3e5
Full Changelog: v2.3.0...v2.3.1
v2.3.0
What's Changed
- Add email to GoogleUser by @doolle89 in #65
- Add filterByAuthorizedAccounts parameters to GoogleButtonUiContainer by @lopspower in #70
- Adding Google Sign In custom scopes by @mirzemehdi in #84
New Contributors
- @doolle89 made their first contribution in #65
- @lopspower made their first contribution in #70
Full Changelog: v2.2.0...v2.3.0
v2.3.0-beta03
What's Changed
- Adding Google Sign In custom scopes by @mirzemehdi in #84
Full Changelog: v2.3.0-beta02...v2.3.0-beta03
v2.3.0-beta02
What's Changed
- Add filterByAuthorizedAccounts parameters to GoogleButtonUiContainer by @lopspower in #70
New Contributors
- @lopspower made their first contribution in #70
Full Changelog: v2.3.0-beta01...v2.3.0-beta02