Skip to content

Commit

Permalink
Backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
mirzemehdi committed Oct 6, 2024
1 parent 0b631c3 commit 942259b
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kmpauth-firebase/api/kmpauth-firebase.api
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
public final class com/mmk/kmpauth/firebase/apple/AppleButtonUiContainerKt {
public static final fun AppleButtonUiContainer (Landroidx/compose/ui/Modifier;Ljava/util/List;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)V
public static final fun AppleButtonUiContainer (Landroidx/compose/ui/Modifier;Ljava/util/List;Lkotlin/jvm/functions/Function1;ZLkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)V
}

public abstract interface class com/mmk/kmpauth/firebase/apple/AppleSignInRequestScope {
Expand Down Expand Up @@ -31,5 +32,6 @@ public final class com/mmk/kmpauth/firebase/google/GoogleButtonUiContainerFireba

public final class com/mmk/kmpauth/firebase/oauth/OAuthContainer_androidKt {
public static final fun OAuthContainer (Landroidx/compose/ui/Modifier;Ldev/gitlive/firebase/auth/OAuthProvider;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)V
public static final fun OAuthContainer (Landroidx/compose/ui/Modifier;Ldev/gitlive/firebase/auth/OAuthProvider;Lkotlin/jvm/functions/Function1;ZLkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)V
}

Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,19 @@ public actual fun AppleButtonUiContainer(
linkAccount = linkAccount,
content = content
)
}

@Deprecated(
"Use AppleButtonUiContainer with linkAccount parameter",
ReplaceWith("AppleButtonUiContainer(modifier, requestScopes, onResult, false, content)"),
DeprecationLevel.WARNING
)
@Composable
public actual fun AppleButtonUiContainer(
modifier: Modifier,
requestScopes: List<AppleSignInRequestScope>,
onResult: (Result<FirebaseUser?>) -> Unit,
content: @Composable UiContainerScope.() -> Unit,
) {
AppleButtonUiContainer(modifier, requestScopes, onResult, false, content)
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,22 @@ public actual fun OAuthContainer(
Box(modifier = modifier) { uiContainerScope.content() }
}

@Deprecated(
"Use OAuthContainer with linkAccount parameter",
ReplaceWith("OAuthContainer(modifier, oAuthProvider, onResult, false, content)"),
DeprecationLevel.WARNING
)
@OptIn(KMPAuthInternalApi::class)
@Composable
public actual fun OAuthContainer(
modifier: Modifier,
oAuthProvider: OAuthProvider,
onResult: (Result<FirebaseUser?>) -> Unit,
content: @Composable UiContainerScope.() -> Unit,
) {
OAuthContainer(modifier, oAuthProvider, onResult, false, content)
}

private fun onClickSignIn(
activity: ComponentActivity?,
oAuthProvider: OAuthProvider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,20 @@ public expect fun AppleButtonUiContainer(
onResult: (Result<FirebaseUser?>) -> Unit,
linkAccount: Boolean = false,
content: @Composable UiContainerScope.() -> Unit,
)

@Deprecated(
"Use AppleButtonUiContainer with linkAccount parameter",
ReplaceWith("AppleButtonUiContainer(modifier, requestScopes, onResult, false, content)"),
DeprecationLevel.WARNING
)
@Composable
public expect fun AppleButtonUiContainer(
modifier: Modifier = Modifier,
requestScopes: List<AppleSignInRequestScope> = listOf(
AppleSignInRequestScope.FullName,
AppleSignInRequestScope.Email
),
onResult: (Result<FirebaseUser?>) -> Unit,
content: @Composable UiContainerScope.() -> Unit,
)
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,17 @@ public expect fun OAuthContainer(
onResult: (Result<FirebaseUser?>) -> Unit,
linkAccount: Boolean = false,
content: @Composable UiContainerScope.() -> Unit,
)

@Deprecated(
"Use OAuthContainer with linkAccount parameter",
ReplaceWith("OAuthContainer(modifier, oAuthProvider, onResult, false, content)"),
DeprecationLevel.WARNING
)
@Composable
public expect fun OAuthContainer(
modifier: Modifier = Modifier,
oAuthProvider: OAuthProvider,
onResult: (Result<FirebaseUser?>) -> Unit,
content: @Composable UiContainerScope.() -> Unit,
)
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,21 @@ public actual fun AppleButtonUiContainer(

}

@Deprecated(
"Use AppleButtonUiContainer with linkAccount parameter",
ReplaceWith("AppleButtonUiContainer(modifier, requestScopes, onResult, false, content)"),
DeprecationLevel.WARNING
)
@Composable
public actual fun AppleButtonUiContainer(
modifier: Modifier,
requestScopes: List<AppleSignInRequestScope>,
onResult: (Result<FirebaseUser?>) -> Unit,
content: @Composable UiContainerScope.() -> Unit,
) {
AppleButtonUiContainer(modifier, requestScopes, onResult, false, content)
}

private fun signIn(
requestScopes: List<AppleSignInRequestScope>,
authorizationController: ASAuthorizationControllerDelegate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ public actual fun OAuthContainer(
Box(modifier = modifier) { uiContainerScope.content() }
}

@Deprecated(
"Use OAuthContainer with linkAccount parameter",
ReplaceWith("OAuthContainer(modifier, oAuthProvider, onResult, false, content)"),
DeprecationLevel.WARNING
)
@Composable
public actual fun OAuthContainer(
modifier: Modifier,
oAuthProvider: OAuthProvider,
onResult: (Result<FirebaseUser?>) -> Unit,
content: @Composable UiContainerScope.() -> Unit,
) {
OAuthContainer(modifier, oAuthProvider, onResult, false, content)
}

@OptIn(ExperimentalForeignApi::class)
private suspend fun onClickSignIn(
oAuthProvider: OAuthProvider,
Expand Down

0 comments on commit 942259b

Please sign in to comment.