Skip to content

Commit

Permalink
Rc v1.3.0 (#16)
Browse files Browse the repository at this point in the history
* Fixing firebase exception crash

* Res import fixing

* Updating api

* Koin version upgrade
  • Loading branch information
mirzemehdi committed Apr 10, 2024
1 parent 1e08756 commit 7477fab
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 57 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ kotlin.mpp.enableCInteropCommonization=true
#Development
development=true

kmpAuthVersion=1.2.0
kmpAuthVersion=1.3.0
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
compose = "1.6.1"
compose-plugin = "1.6.0-rc03"
compose-plugin = "1.6.1"
compose-compiler = "1.5.8"
agp = "8.1.3"
android-minSdk = "24"
Expand All @@ -14,14 +14,14 @@ androidx-constraintlayout = "2.1.4"
androidx-test-junit = "1.1.5"
androidx-espresso-core = "3.5.1"
androidx-startup-runtime = "1.1.1"
kotlin = "1.9.22"
kotlin = "1.9.23"
junit = "4.13.2"
koin = "3.5.0"
koin = "3.5.4"
kotlinx-binary-validator = "0.13.2"
dokka = "1.9.10"
androidxCredential = "1.3.0-alpha01"
googleIdIdentity="1.1.0"
koinCompose = "1.1.0"
koinCompose = "1.1.3-RC2"
googleServices = "4.4.0"
firebaseGitLiveAuth = "1.10.4"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import dev.gitlive.firebase.Firebase
import dev.gitlive.firebase.auth.FirebaseUser
import dev.gitlive.firebase.auth.GoogleAuthProvider
import dev.gitlive.firebase.auth.auth
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.launch

/**
Expand Down Expand Up @@ -48,9 +49,14 @@ public fun GoogleButtonUiContainerFirebase(
}
val authCredential = GoogleAuthProvider.credential(idToken, accessToken)
coroutineScope.launch {
val result = Firebase.auth.signInWithCredential(authCredential)
if (result.user == null) updatedOnResult(Result.failure(IllegalStateException("Firebase Null user")))
else updatedOnResult(Result.success(result.user))
try {
val result = Firebase.auth.signInWithCredential(authCredential)
if (result.user == null) updatedOnResult(Result.failure(IllegalStateException("Firebase Null user")))
else updatedOnResult(Result.success(result.user))
} catch (e: Exception) {
if (e is CancellationException) throw e
updatedOnResult(Result.failure(e))
}
}

}, content = content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,46 +99,6 @@ public actual fun AppleButtonUiContainer(

}


@OptIn(ExperimentalForeignApi::class)
@Composable
internal fun SignInWithAppleButton2(
modifier: Modifier,
onResult: (Result<FirebaseUser?>) -> Unit,
) {

val updatedOnResultFunc by rememberUpdatedState(onResult)

UIKitView(modifier = Modifier.sizeIn(maxHeight = 56.dp), factory = {
val presentationContextProvider = PresentationContextProvider()
val asAuthorizationControllerDelegate =
ASAuthorizationControllerDelegate(updatedOnResultFunc)
val uiStackView = object : UIStackView(CGRectMake(0.0, 0.0, 0.0, 0.0)) {
@ObjCAction
fun clicked() {
// signIn(
// withPasswordProvider = false,
// authorizationController = asAuthorizationControllerDelegate,
// presentationContextProvider = presentationContextProvider
// )
}
}

val button = ASAuthorizationAppleIDButton()
button.addTarget(
uiStackView,
NSSelectorFromString(uiStackView::clicked.name),
UIControlEventTouchUpInside
)
uiStackView.addArrangedSubview(button)

uiStackView

})

}


private fun signIn(
requestScopes: List<AppleSignInRequestScope>,
authorizationController: ASAuthorizationControllerDelegate,
Expand Down
2 changes: 1 addition & 1 deletion kmpauth-google/kmpauth_google.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'kmpauth_google'
spec.version = '1.2.0'
spec.version = '1.3.0'
spec.homepage = ''
spec.source = { :http=> ''}
spec.authors = ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.mmk.kmpauth.uihelper.google.GoogleButtonMode
import com.mmk.kmpauth.uihelper.theme.Fonts
import io.github.mirzemehdi.`kmpauth-uihelper`.generated.resources.Res
import io.github.mirzemehdi.`kmpauth-uihelper`.generated.resources.ic_apple_logo_black
import io.github.mirzemehdi.`kmpauth-uihelper`.generated.resources.ic_apple_logo_white
import io.github.mirzemehdi.kmpauth_uihelper.generated.resources.Res
import io.github.mirzemehdi.kmpauth_uihelper.generated.resources.ic_apple_logo_black
import io.github.mirzemehdi.kmpauth_uihelper.generated.resources.ic_apple_logo_white
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.painterResource
import kotlin.math.roundToInt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import androidx.compose.ui.unit.sp
import com.mmk.kmpauth.core.KMPAuthInternalApi
import com.mmk.kmpauth.core.di.isAndroidPlatform
import com.mmk.kmpauth.uihelper.theme.Fonts
import io.github.mirzemehdi.`kmpauth-uihelper`.generated.resources.Res
import io.github.mirzemehdi.`kmpauth-uihelper`.generated.resources.ic_google
import io.github.mirzemehdi.kmpauth_uihelper.generated.resources.Res
import io.github.mirzemehdi.kmpauth_uihelper.generated.resources.ic_google
import org.jetbrains.compose.resources.DrawableResource
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.painterResource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontStyle
import androidx.compose.ui.text.font.FontWeight
import io.github.mirzemehdi.`kmpauth-uihelper`.generated.resources.Res
import io.github.mirzemehdi.`kmpauth-uihelper`.generated.resources.roboto_medium
import io.github.mirzemehdi.kmpauth_uihelper.generated.resources.Res
import io.github.mirzemehdi.kmpauth_uihelper.generated.resources.roboto_medium
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.Font

Expand Down

0 comments on commit 7477fab

Please sign in to comment.