0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-03-10 22:22:45 -05:00

docs: android sdk api reference (#707)

This commit is contained in:
Xiao Yijun 2022-05-05 18:24:58 +08:00 committed by GitHub
parent d78bbfe82c
commit 149900260f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 773 additions and 9 deletions

View file

@ -1,5 +1 @@
---
sidebar_position: 3
---
# @logto-io/kotlin

View file

@ -0,0 +1,24 @@
---
sidebar_position: 1.2
---
# Android
## Packages
| Name |
|---|
| [io.logto.sdk.android](io.logto.sdk.android/index.md) |
| [io.logto.sdk.android.auth.logto](io.logto.sdk.android.auth.logto/index.md) |
| [io.logto.sdk.android.auth.social](io.logto.sdk.android.auth.social/index.md) |
| [io.logto.sdk.android.auth.social.alipay](io.logto.sdk.android.auth.social.alipay/index.md) |
| [io.logto.sdk.android.auth.social.web](io.logto.sdk.android.auth.social.web/index.md) |
| [io.logto.sdk.android.auth.social.wechat](io.logto.sdk.android.auth.social.wechat/index.md) |
| [io.logto.sdk.android.completion](io.logto.sdk.android.completion/index.md) |
| [io.logto.sdk.android.constant](io.logto.sdk.android.constant/index.md) |
| [io.logto.sdk.android.exception](io.logto.sdk.android.exception/index.md) |
| [io.logto.sdk.android.extension](io.logto.sdk.android.extension/index.md) |
| [io.logto.sdk.android.storage](io.logto.sdk.android.storage/index.md) |
| [io.logto.sdk.android.type](io.logto.sdk.android.type/index.md) |
| [io.logto.sdk.android.util](io.logto.sdk.android.util/index.md) |

View file

@ -0,0 +1,27 @@
# LogtoAuthSession
class LogtoAuthSession(val context: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html), val logtoConfig: [LogtoConfig](../../io.logto.sdk.android.type/-logto-config/index.md), val oidcConfig: OidcConfigResponse, val redirectUri: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), completion: [Completion](../../io.logto.sdk.android.completion/-completion/index.md)<[LogtoException](../../io.logto.sdk.android.exception/-logto-exception/index.md), CodeTokenResponse>)
## Constructors
| Name | Summary |
|---|---|
| LogtoAuthSession | fun LogtoAuthSession(context: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html), logtoConfig: [LogtoConfig](../../io.logto.sdk.android.type/-logto-config/index.md), oidcConfig: OidcConfigResponse, redirectUri: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), completion: [Completion](../../io.logto.sdk.android.completion/-completion/index.md)<[LogtoException](../../io.logto.sdk.android.exception/-logto-exception/index.md), CodeTokenResponse>) |
## Functions
| Name | Summary |
|---|---|
| handleCallbackUri | fun handleCallbackUri(callbackUri: [Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html)) |
| handleUserCancel | fun handleUserCancel() |
| start | fun start() |
## Properties
| Name | Summary |
|---|---|
| context | val context: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html) |
| logtoConfig | val logtoConfig: [LogtoConfig](../../io.logto.sdk.android.type/-logto-config/index.md) |
| oidcConfig | val oidcConfig: OidcConfigResponse |
| redirectUri | val redirectUri: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |

View file

@ -0,0 +1,10 @@
# Companion
object Companion
## Functions
| Name | Summary |
|---|---|
| launch | fun launch(context: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html), uri: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)) |

View file

@ -0,0 +1,16 @@
# LogtoWebViewAuthActivity
class LogtoWebViewAuthActivity : [AppCompatActivity](https://developer.android.com/reference/kotlin/androidx/appcompat/app/AppCompatActivity.html)
## Constructors
| Name | Summary |
|---|---|
| LogtoWebViewAuthActivity | fun LogtoWebViewAuthActivity() |
## Types
| Name | Summary |
|---|---|
| [Companion](-companion/index.md) | object [Companion](-companion/index.md) |

View file

@ -0,0 +1,17 @@
# LogtoWebViewAuthClient
class LogtoWebViewAuthClient(hostActivity: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html), injectScript: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)) : [WebViewClient](https://developer.android.com/reference/kotlin/android/webkit/WebViewClient.html)
## Constructors
| Name | Summary |
|---|---|
| LogtoWebViewAuthClient | fun LogtoWebViewAuthClient(hostActivity: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html), injectScript: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)) |
## Functions
| Name | Summary |
|---|---|
| onPageStarted | open override fun onPageStarted(view: [WebView](https://developer.android.com/reference/kotlin/android/webkit/WebView.html)?, url: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?, favicon: [Bitmap](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.html)?) |
| shouldOverrideUrlLoading | open override fun shouldOverrideUrlLoading(view: [WebView](https://developer.android.com/reference/kotlin/android/webkit/WebView.html)?, request: [WebResourceRequest](https://developer.android.com/reference/kotlin/android/webkit/WebResourceRequest.html)?): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |

View file

@ -0,0 +1,10 @@
# Companion
object Companion
## Properties
| Name | Summary |
|---|---|
| NAME | const val NAME: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |

View file

@ -0,0 +1,23 @@
# LogtoWebViewSocialHandler
class LogtoWebViewSocialHandler(webView: [WebView](https://developer.android.com/reference/kotlin/android/webkit/WebView.html), hostActivity: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html))
## Constructors
| Name | Summary |
|---|---|
| LogtoWebViewSocialHandler | fun LogtoWebViewSocialHandler(webView: [WebView](https://developer.android.com/reference/kotlin/android/webkit/WebView.html), hostActivity: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html)) |
## Types
| Name | Summary |
|---|---|
| [Companion](-companion/index.md) | object [Companion](-companion/index.md) |
## Functions
| Name | Summary |
|---|---|
| getInjectSocialScript | fun getInjectSocialScript(): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
| postMessage | fun postMessage(jsonData: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)) |

View file

@ -0,0 +1,11 @@
# io.logto.sdk.android.auth.logto
## Types
| Name | Summary |
|---|---|
| [LogtoAuthSession](-logto-auth-session/index.md) | class [LogtoAuthSession](-logto-auth-session/index.md)(val context: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html), val logtoConfig: [LogtoConfig](../io.logto.sdk.android.type/-logto-config/index.md), val oidcConfig: OidcConfigResponse, val redirectUri: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), completion: [Completion](../io.logto.sdk.android.completion/-completion/index.md)<[LogtoException](../io.logto.sdk.android.exception/-logto-exception/index.md), CodeTokenResponse>) |
| [LogtoWebViewAuthActivity](-logto-web-view-auth-activity/index.md) | class [LogtoWebViewAuthActivity](-logto-web-view-auth-activity/index.md) : [AppCompatActivity](https://developer.android.com/reference/kotlin/androidx/appcompat/app/AppCompatActivity.html) |
| [LogtoWebViewAuthClient](-logto-web-view-auth-client/index.md) | class [LogtoWebViewAuthClient](-logto-web-view-auth-client/index.md)(hostActivity: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html), injectScript: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)) : [WebViewClient](https://developer.android.com/reference/kotlin/android/webkit/WebViewClient.html) |
| [LogtoWebViewSocialHandler](-logto-web-view-social-handler/index.md) | class [LogtoWebViewSocialHandler](-logto-web-view-social-handler/index.md)(webView: [WebView](https://developer.android.com/reference/kotlin/android/webkit/WebView.html), hostActivity: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html)) |

View file

@ -0,0 +1,11 @@
# Companion
object Companion
## Properties
| Name | Summary |
|---|---|
| CONNECTOR_ID | const val CONNECTOR_ID: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
| SDK_IDENTIFY_CLASS_NAME | const val SDK_IDENTIFY_CLASS_NAME: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |

View file

@ -0,0 +1,31 @@
# AlipaySocialSession
class AlipaySocialSession(val context: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html), val redirectTo: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), val callbackUri: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), val completion: [Completion](../../io.logto.sdk.android.completion/-completion/index.md)<[SocialException](../../io.logto.sdk.android.auth.social/-social-exception/index.md), [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)>) : [SocialSession](../../io.logto.sdk.android.auth.social/-social-session/index.md)
## Constructors
| Name | Summary |
|---|---|
| AlipaySocialSession | fun AlipaySocialSession(context: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html), redirectTo: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), callbackUri: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), completion: [Completion](../../io.logto.sdk.android.completion/-completion/index.md)<[SocialException](../../io.logto.sdk.android.auth.social/-social-exception/index.md), [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)>) |
## Types
| Name | Summary |
|---|---|
| [Companion](-companion/index.md) | object [Companion](-companion/index.md) |
## Functions
| Name | Summary |
|---|---|
| start | open override fun start() |
## Properties
| Name | Summary |
|---|---|
| callbackUri | open override val callbackUri: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
| completion | open override val completion: [Completion](../../io.logto.sdk.android.completion/-completion/index.md)<[SocialException](../../io.logto.sdk.android.auth.social/-social-exception/index.md), [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)> |
| context | open override val context: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html) |
| redirectTo | open override val redirectTo: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |

View file

@ -0,0 +1,8 @@
# io.logto.sdk.android.auth.social.alipay
## Types
| Name | Summary |
|---|---|
| [AlipaySocialSession](-alipay-social-session/index.md) | class [AlipaySocialSession](-alipay-social-session/index.md)(val context: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html), val redirectTo: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), val callbackUri: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), val completion: [Completion](../io.logto.sdk.android.completion/-completion/index.md)<[SocialException](../io.logto.sdk.android.auth.social/-social-exception/index.md), [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)>) : [SocialSession](../io.logto.sdk.android.auth.social/-social-session/index.md) |

View file

@ -0,0 +1,10 @@
# Companion
object Companion
## Functions
| Name | Summary |
|---|---|
| registerSession | fun registerSession(session: [WebSocialSession](../../-web-social-session/index.md)) |

View file

@ -0,0 +1,16 @@
# WebSocialResultActivity
class WebSocialResultActivity : [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html)
## Constructors
| Name | Summary |
|---|---|
| WebSocialResultActivity | fun WebSocialResultActivity() |
## Types
| Name | Summary |
|---|---|
| [Companion](-companion/index.md) | object [Companion](-companion/index.md) |

View file

@ -0,0 +1,26 @@
# WebSocialSession
class WebSocialSession(val context: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html), val redirectTo: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), val callbackUri: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), val completion: [Completion](../../io.logto.sdk.android.completion/-completion/index.md)<[SocialException](../../io.logto.sdk.android.auth.social/-social-exception/index.md), [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)>) : [SocialSession](../../io.logto.sdk.android.auth.social/-social-session/index.md)
## Constructors
| Name | Summary |
|---|---|
| WebSocialSession | fun WebSocialSession(context: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html), redirectTo: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), callbackUri: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), completion: [Completion](../../io.logto.sdk.android.completion/-completion/index.md)<[SocialException](../../io.logto.sdk.android.auth.social/-social-exception/index.md), [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)>) |
## Functions
| Name | Summary |
|---|---|
| handleResult | fun handleResult(data: [Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html)) |
| start | open override fun start() |
## Properties
| Name | Summary |
|---|---|
| callbackUri | open override val callbackUri: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
| completion | open override val completion: [Completion](../../io.logto.sdk.android.completion/-completion/index.md)<[SocialException](../../io.logto.sdk.android.auth.social/-social-exception/index.md), [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)> |
| context | open override val context: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html) |
| redirectTo | open override val redirectTo: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |

View file

@ -0,0 +1,9 @@
# io.logto.sdk.android.auth.social.web
## Types
| Name | Summary |
|---|---|
| [WebSocialResultActivity](-web-social-result-activity/index.md) | class [WebSocialResultActivity](-web-social-result-activity/index.md) : [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html) |
| [WebSocialSession](-web-social-session/index.md) | class [WebSocialSession](-web-social-session/index.md)(val context: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html), val redirectTo: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), val callbackUri: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), val completion: [Completion](../io.logto.sdk.android.completion/-completion/index.md)<[SocialException](../io.logto.sdk.android.auth.social/-social-exception/index.md), [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)>) : [SocialSession](../io.logto.sdk.android.auth.social/-social-session/index.md) |

View file

@ -0,0 +1,10 @@
# Companion
object Companion
## Functions
| Name | Summary |
|---|---|
| registerSession | fun registerSession(session: [WechatSocialSession](../../-wechat-social-session/index.md)) |

View file

@ -0,0 +1,23 @@
# WechatSocialResultActivity
open class WechatSocialResultActivity : [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html), IWXAPIEventHandler
## Constructors
| Name | Summary |
|---|---|
| WechatSocialResultActivity | fun WechatSocialResultActivity() |
## Types
| Name | Summary |
|---|---|
| [Companion](-companion/index.md) | object [Companion](-companion/index.md) |
## Functions
| Name | Summary |
|---|---|
| onReq | open override fun onReq(request: BaseReq?) |
| onResp | open override fun onResp(response: BaseResp?) |

View file

@ -0,0 +1,11 @@
# Companion
object Companion
## Properties
| Name | Summary |
|---|---|
| CONNECTOR_ID | const val CONNECTOR_ID: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
| SDK_IDENTIFY_CLASS_NAME | const val SDK_IDENTIFY_CLASS_NAME: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |

View file

@ -0,0 +1,33 @@
# WechatSocialSession
class WechatSocialSession(val context: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html), val redirectTo: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), val callbackUri: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), val completion: [Completion](../../io.logto.sdk.android.completion/-completion/index.md)<[SocialException](../../io.logto.sdk.android.auth.social/-social-exception/index.md), [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)>) : [SocialSession](../../io.logto.sdk.android.auth.social/-social-session/index.md)
## Constructors
| Name | Summary |
|---|---|
| WechatSocialSession | fun WechatSocialSession(context: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html), redirectTo: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), callbackUri: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), completion: [Completion](../../io.logto.sdk.android.completion/-completion/index.md)<[SocialException](../../io.logto.sdk.android.auth.social/-social-exception/index.md), [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)>) |
## Types
| Name | Summary |
|---|---|
| [Companion](-companion/index.md) | object [Companion](-companion/index.md) |
## Functions
| Name | Summary |
|---|---|
| handleMissingAppIdError | fun handleMissingAppIdError() |
| handleResult | fun handleResult(result: BaseResp?) |
| start | open override fun start() |
## Properties
| Name | Summary |
|---|---|
| callbackUri | open override val callbackUri: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
| completion | open override val completion: [Completion](../../io.logto.sdk.android.completion/-completion/index.md)<[SocialException](../../io.logto.sdk.android.auth.social/-social-exception/index.md), [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)> |
| context | open override val context: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html) |
| redirectTo | open override val redirectTo: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |

View file

@ -0,0 +1,9 @@
# io.logto.sdk.android.auth.social.wechat
## Types
| Name | Summary |
|---|---|
| [WechatSocialResultActivity](-wechat-social-result-activity/index.md) | open class [WechatSocialResultActivity](-wechat-social-result-activity/index.md) : [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html), IWXAPIEventHandler |
| [WechatSocialSession](-wechat-social-session/index.md) | class [WechatSocialSession](-wechat-social-session/index.md)(val context: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html), val redirectTo: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), val callbackUri: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), val completion: [Completion](../io.logto.sdk.android.completion/-completion/index.md)<[SocialException](../io.logto.sdk.android.auth.social/-social-exception/index.md), [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)>) : [SocialSession](../io.logto.sdk.android.auth.social/-social-session/index.md) |

View file

@ -0,0 +1,22 @@
# Type
enum Type : [Enum](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html)<SocialException.Type>
## Entries
| Name | Summary |
|---|---|
| AUTHENTICATION_FAILED | AUTHENTICATION_FAILED("authentication_failed") |
| INSUFFICIENT_INFORMATION | INSUFFICIENT_INFORMATION("insufficient_information") |
| UNKNOWN_SOCIAL_SCHEME | UNKNOWN_SOCIAL_SCHEME("unknown_social_scheme") |
| UNABLE_TO_CONSTRUCT_CALLBACK_URI | UNABLE_TO_CONSTRUCT_CALLBACK_URI("unable_to_construct_callback_uri") |
| INVALID_CALLBACK_URI | INVALID_CALLBACK_URI("invalid_callback_uri") |
| INVALID_REDIRECT_TO | INVALID_REDIRECT_TO("invalid_redirect_to") |
| INVALID_JSON | INVALID_JSON("invalid_json") |
## Properties
| Name | Summary |
|---|---|
| code | val code: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |

View file

@ -0,0 +1,24 @@
# SocialException
class SocialException(type: [SocialException.Type](-type/index.md)) : [RuntimeException](https://developer.android.com/reference/kotlin/java/lang/RuntimeException.html)
## Constructors
| Name | Summary |
|---|---|
| SocialException | fun SocialException(type: [SocialException.Type](-type/index.md)) |
## Types
| Name | Summary |
|---|---|
| [Type](-type/index.md) | enum [Type](-type/index.md) : [Enum](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html)<[SocialException.Type](-type/index.md)> |
## Properties
| Name | Summary |
|---|---|
| code | val code: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
| socialCode | var socialCode: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)? = null |
| socialMessage | var socialMessage: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)? = null |

View file

@ -0,0 +1,11 @@
# SocialSessionHelper
object SocialSessionHelper
## Functions
| Name | Summary |
|---|---|
| createSocialSession | fun createSocialSession(context: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html), redirectTo: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), callbackUri: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), completion: [Completion](../../io.logto.sdk.android.completion/-completion/index.md)<[SocialException](../-social-exception/index.md), [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)>): [SocialSession](../-social-session/index.md)? |
| getSupportedSocialConnectorIds | fun getSupportedSocialConnectorIds(): [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)> |

View file

@ -0,0 +1,27 @@
# SocialSession
interface SocialSession
## Functions
| Name | Summary |
|---|---|
| start | abstract fun start() |
## Properties
| Name | Summary |
|---|---|
| callbackUri | abstract val callbackUri: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
| completion | abstract val completion: [Completion](../../io.logto.sdk.android.completion/-completion/index.md)<[SocialException](../-social-exception/index.md), [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)> |
| context | abstract val context: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html) |
| redirectTo | abstract val redirectTo: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
## Inheritors
| Name |
|---|
| [AlipaySocialSession](../../io.logto.sdk.android.auth.social.alipay/-alipay-social-session/index.md) |
| [WebSocialSession](../../io.logto.sdk.android.auth.social.web/-web-social-session/index.md) |
| [WechatSocialSession](../../io.logto.sdk.android.auth.social.wechat/-wechat-social-session/index.md) |

View file

@ -0,0 +1,10 @@
# io.logto.sdk.android.auth.social
## Types
| Name | Summary |
|---|---|
| [SocialException](-social-exception/index.md) | class [SocialException](-social-exception/index.md)(type: [SocialException.Type](-social-exception/-type/index.md)) : [RuntimeException](https://developer.android.com/reference/kotlin/java/lang/RuntimeException.html) |
| [SocialSession](-social-session/index.md) | interface [SocialSession](-social-session/index.md) |
| [SocialSessionHelper](-social-session-helper/index.md) | object [SocialSessionHelper](-social-session-helper/index.md) |

View file

@ -0,0 +1,10 @@
# Completion
fun interface Completion<T : [RuntimeException](https://developer.android.com/reference/kotlin/java/lang/RuntimeException.html), U : [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)>
## Functions
| Name | Summary |
|---|---|
| onComplete | abstract fun onComplete(exception: T?, result: U?) |

View file

@ -0,0 +1,10 @@
# EmptyCompletion
fun interface EmptyCompletion<T : [RuntimeException](https://developer.android.com/reference/kotlin/java/lang/RuntimeException.html)>
## Functions
| Name | Summary |
|---|---|
| onComplete | abstract fun onComplete(exception: T?) |

View file

@ -0,0 +1,9 @@
# io.logto.sdk.android.completion
## Types
| Name | Summary |
|---|---|
| [Completion](-completion/index.md) | fun interface [Completion](-completion/index.md)<[T](-completion/index.md) : [RuntimeException](https://developer.android.com/reference/kotlin/java/lang/RuntimeException.html), [U](-completion/index.md) : [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)> |
| [EmptyCompletion](-empty-completion/index.md) | fun interface [EmptyCompletion](-empty-completion/index.md)<[T](-empty-completion/index.md) : [RuntimeException](https://developer.android.com/reference/kotlin/java/lang/RuntimeException.html)> |

View file

@ -0,0 +1,12 @@
# StorageKey
object StorageKey
## Properties
| Name | Summary |
|---|---|
| ID_TOKEN | const val ID_TOKEN: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
| REFRESH_TOKEN | const val REFRESH_TOKEN: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
| STORAGE_NAME_PREFIX | const val STORAGE_NAME_PREFIX: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |

View file

@ -0,0 +1,8 @@
# io.logto.sdk.android.constant
## Types
| Name | Summary |
|---|---|
| [StorageKey](-storage-key/index.md) | object [StorageKey](-storage-key/index.md) |

View file

@ -0,0 +1,26 @@
# Message
enum Message : [Enum](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html)<LogtoException.Message>
## Entries
* WECHAT_AUTH_FAILED
* WECHAT_APP_ID_NO_FOUND
* ALIPAY_AUTH_FAILED
* ALIPAY_APP_ID_NO_FOUND
* INVALID_ID_TOKEN
* UNABLE_TO_PARSE_JWKS
* UNABLE_TO_FETCH_JWKS_JSON
* UNABLE_TO_FETCH_USER_INFO
* UNABLE_TO_PARSE_ID_TOKEN_CLAIMS
* UNABLE_TO_REVOKE_TOKEN
* UNABLE_TO_FETCH_TOKEN_BY_REFRESH_TOKEN
* UNABLE_TO_FETCH_TOKEN_BY_AUTHORIZATION_CODE
* UNABLE_TO_FETCH_OIDC_CONFIG
* INVALID_CALLBACK_URI
* INVALID_REDIRECT_URI
* USER_CANCELED
* UNGRANTED_RESOURCE_FOUND
* NO_REFRESH_TOKEN_FOUND
* NOT_AUTHENTICATED

View file

@ -0,0 +1,22 @@
# LogtoException
class LogtoException(message: [Enum](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html)<[LogtoException.Message](-message/index.md)>, cause: [Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)? = null) : [RuntimeException](https://developer.android.com/reference/kotlin/java/lang/RuntimeException.html)
## Constructors
| Name | Summary |
|---|---|
| LogtoException | fun LogtoException(message: [Enum](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html)<[LogtoException.Message](-message/index.md)>, cause: [Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)? = null) |
## Types
| Name | Summary |
|---|---|
| [Message](-message/index.md) | enum [Message](-message/index.md) : [Enum](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html)<[LogtoException.Message](-message/index.md)> |
## Properties
| Name | Summary |
|---|---|
| detail | var detail: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)? = null |

View file

@ -0,0 +1,8 @@
# io.logto.sdk.android.exception
## Types
| Name | Summary |
|---|---|
| [LogtoException](-logto-exception/index.md) | class [LogtoException](-logto-exception/index.md)(message: [Enum](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html)<[LogtoException.Message](-logto-exception/-message/index.md)>, cause: [Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)? = null) : [RuntimeException](https://developer.android.com/reference/kotlin/java/lang/RuntimeException.html) |

View file

@ -0,0 +1,8 @@
# io.logto.sdk.android.extension
## Properties
| Name | Summary |
|---|---|
| oidcConfigEndpoint | val [LogtoConfig](../io.logto.sdk.android.type/-logto-config/index.md).oidcConfigEndpoint: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |

View file

@ -0,0 +1,17 @@
# PersistStorage
class PersistStorage(context: [Context](https://developer.android.com/reference/kotlin/android/content/Context.html), storageName: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html))
## Constructors
| Name | Summary |
|---|---|
| PersistStorage | fun PersistStorage(context: [Context](https://developer.android.com/reference/kotlin/android/content/Context.html), storageName: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)) |
## Functions
| Name | Summary |
|---|---|
| getItem | fun getItem(key: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)? |
| setItem | fun setItem(key: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), value: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?): [SharedPreferences.Editor](https://developer.android.com/reference/kotlin/android/content/SharedPreferences.Editor.html) |

View file

@ -0,0 +1,8 @@
# io.logto.sdk.android.storage
## Types
| Name | Summary |
|---|---|
| [PersistStorage](-persist-storage/index.md) | class [PersistStorage](-persist-storage/index.md)(context: [Context](https://developer.android.com/reference/kotlin/android/content/Context.html), storageName: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)) |

View file

@ -0,0 +1,18 @@
# AccessToken
data class AccessToken(val token: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), val scope: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), val expiresAt: [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html))
## Constructors
| Name | Summary |
|---|---|
| AccessToken | fun AccessToken(token: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), scope: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), expiresAt: [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)) |
## Properties
| Name | Summary |
|---|---|
| expiresAt | val expiresAt: [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) |
| scope | val scope: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
| token | val token: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |

View file

@ -0,0 +1,26 @@
# LogtoConfig
class LogtoConfig(val endpoint: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), val appId: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), scopes: [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)>? = null, val resources: [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)>? = null, val usingPersistStorage: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) = false)
## Constructors
| Name | Summary |
|---|---|
| LogtoConfig | fun LogtoConfig(endpoint: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), appId: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), scopes: [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)>? = null, resources: [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)>? = null, usingPersistStorage: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) = false) |
## Properties
| Name | Summary |
|---|---|
| appId | val appId: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
| endpoint | val endpoint: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
| resources | val resources: [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)>? = null |
| scopes | val scopes: [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)> |
| usingPersistStorage | val usingPersistStorage: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) = false |
## Extensions
| Name | Summary |
|---|---|
| oidcConfigEndpoint | val LogtoConfig.oidcConfigEndpoint: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |

View file

@ -0,0 +1,9 @@
# io.logto.sdk.android.type
## Types
| Name | Summary |
|---|---|
| [AccessToken](-access-token/index.md) | data class [AccessToken](-access-token/index.md)(val token: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), val scope: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), val expiresAt: [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)) |
| [LogtoConfig](-logto-config/index.md) | class [LogtoConfig](-logto-config/index.md)(val endpoint: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), val appId: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), scopes: [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)>? = null, val resources: [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)>? = null, val usingPersistStorage: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) = false) |

View file

@ -0,0 +1,12 @@
# LogtoUtils
object LogtoUtils
## Functions
| Name | Summary |
|---|---|
| expiresAtFrom | fun expiresAtFrom(startTime: [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html), lifetime: [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)): [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) |
| isDependencyInstalled | fun isDependencyInstalled(identifyClassName: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |
| nowRoundToSec | fun nowRoundToSec(): [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) |

View file

@ -0,0 +1,8 @@
# io.logto.sdk.android.util
## Types
| Name | Summary |
|---|---|
| [LogtoUtils](-logto-utils/index.md) | object [LogtoUtils](-logto-utils/index.md) |

View file

@ -0,0 +1,13 @@
# fetchUserInfo
fun fetchUserInfo(completion: [Completion](../../io.logto.sdk.android.completion/-completion/index.md)<[LogtoException](../../io.logto.sdk.android.exception/-logto-exception/index.md), UserInfoResponse>)
Fetch user info
## Parameters
| Name | Summary |
|---|---|
| completion | the completion which handles the retrieved result. |

View file

@ -0,0 +1,25 @@
# getAccessToken
fun getAccessToken(completion: [Completion](../../io.logto.sdk.android.completion/-completion/index.md)<[LogtoException](../../io.logto.sdk.android.exception/-logto-exception/index.md), [AccessToken](../../io.logto.sdk.android.type/-access-token/index.md)>)
Get access token
## Parameters
| Name | Summary |
|---|---|
| completion | the completion which handles the result. |
fun getAccessToken(resource: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?, completion: [Completion](../../io.logto.sdk.android.completion/-completion/index.md)<[LogtoException](../../io.logto.sdk.android.exception/-logto-exception/index.md), [AccessToken](../../io.logto.sdk.android.type/-access-token/index.md)>)
Get access token
## Parameters
| Name | Summary |
|---|---|
| resource | the related resource of the retrieving access token. |
| completion | the completion which handles the retrieved result. |

View file

@ -0,0 +1,13 @@
# getIdTokenClaims
fun getIdTokenClaims(completion: [Completion](../../io.logto.sdk.android.completion/-completion/index.md)<[LogtoException](../../io.logto.sdk.android.exception/-logto-exception/index.md), IdTokenClaims>)
Get ID token claims
## Parameters
| Name | Summary |
|---|---|
| completion | the completion which handles the retrieved result. |

View file

@ -0,0 +1,27 @@
# LogtoClient
open class LogtoClient(val logtoConfig: [LogtoConfig](../../io.logto.sdk.android.type/-logto-config/index.md), application: [Application](https://developer.android.com/reference/kotlin/android/app/Application.html))
## Constructors
| Name | Summary |
|---|---|
| LogtoClient | fun LogtoClient(logtoConfig: [LogtoConfig](../../io.logto.sdk.android.type/-logto-config/index.md), application: [Application](https://developer.android.com/reference/kotlin/android/app/Application.html)) |
## Functions
| Name | Summary |
|---|---|
| [fetchUserInfo](fetch-user-info.md) | fun [fetchUserInfo](fetch-user-info.md)(completion: [Completion](../../io.logto.sdk.android.completion/-completion/index.md)&lt;[LogtoException](../../io.logto.sdk.android.exception/-logto-exception/index.md), UserInfoResponse&gt;)<br/>Fetch user info |
| [getAccessToken](get-access-token-constructor) | fun [getAccessToken](get-access-token-constructor)(completion: [Completion](../../io.logto.sdk.android.completion/-completion/index.md)&lt;[LogtoException](../../io.logto.sdk.android.exception/-logto-exception/index.md), [AccessToken](../../io.logto.sdk.android.type/-access-token/index.md)&gt;)<br/>fun [getAccessToken](get-access-token-constructor)(resource: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?, completion: [Completion](../../io.logto.sdk.android.completion/-completion/index.md)&lt;[LogtoException](../../io.logto.sdk.android.exception/-logto-exception/index.md), [AccessToken](../../io.logto.sdk.android.type/-access-token/index.md)&gt;)<br/>Get access token |
| [getIdTokenClaims](get-id-token-claims.md) | fun [getIdTokenClaims](get-id-token-claims.md)(completion: [Completion](../../io.logto.sdk.android.completion/-completion/index.md)&lt;[LogtoException](../../io.logto.sdk.android.exception/-logto-exception/index.md), IdTokenClaims&gt;)<br/>Get ID token claims |
| [signIn](sign-in.md) | fun [signIn](sign-in.md)(context: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html), redirectUri: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), completion: [EmptyCompletion](../../io.logto.sdk.android.completion/-empty-completion/index.md)&lt;[LogtoException](../../io.logto.sdk.android.exception/-logto-exception/index.md)&gt;)<br/>Sign in |
| [signOut](sign-out.md) | fun [signOut](sign-out.md)(completion: [EmptyCompletion](../../io.logto.sdk.android.completion/-empty-completion/index.md)&lt;[LogtoException](../../io.logto.sdk.android.exception/-logto-exception/index.md)&gt;? = null)<br/>Sign out |
## Properties
| Name | Summary |
|---|---|
| [isAuthenticated](is-authenticated.md) | val [isAuthenticated](is-authenticated.md): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br/>Whether the user has been authenticated. |
| [logtoConfig](logto-config.md) | val [logtoConfig](logto-config.md): [LogtoConfig](../../io.logto.sdk.android.type/-logto-config/index.md)<br/>The Logto client config |

View file

@ -0,0 +1,6 @@
# isAuthenticated
val isAuthenticated: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
Whether the user has been authenticated.

View file

@ -0,0 +1,6 @@
# logtoConfig
val logtoConfig: [LogtoConfig](../../io.logto.sdk.android.type/-logto-config/index.md)
The Logto client config

View file

@ -0,0 +1,15 @@
# signIn
fun signIn(context: [Activity](https://developer.android.com/reference/kotlin/android/app/Activity.html), redirectUri: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), completion: [EmptyCompletion](../../io.logto.sdk.android.completion/-empty-completion/index.md)&lt;[LogtoException](../../io.logto.sdk.android.exception/-logto-exception/index.md)&gt;)
Sign in
## Parameters
| Name | Summary |
|---|---|
| context | the activity to perform a sign-in action. |
| redirectUri | one of the redirect URIs of this application. |
| completion | the completion which handles the result of signing in. |

View file

@ -0,0 +1,15 @@
# signOut
fun signOut(completion: [EmptyCompletion](../../io.logto.sdk.android.completion/-empty-completion/index.md)&lt;[LogtoException](../../io.logto.sdk.android.exception/-logto-exception/index.md)&gt;? = null)
Sign out
Local credentials will be cleared even though there are errors occurred when signing out.
## Parameters
| Name | Summary |
|---|---|
| completion | the completion which handles the error occurred when signing out. |

View file

@ -0,0 +1,8 @@
# io.logto.sdk.android
## Types
| Name | Summary |
|---|---|
| [LogtoClient](-logto-client/index.md) | open class [LogtoClient](-logto-client/index.md)(val logtoConfig: [LogtoConfig](../io.logto.sdk.android.type/-logto-config/index.md), application: [Application](https://developer.android.com/reference/kotlin/android/app/Application.html)) |

View file

@ -1,3 +1,7 @@
---
sidebar_position: 1.1
---
# Core

View file

@ -1,5 +1 @@
---
sidebar_position: 2
---
# @logto-io/swift

View file

@ -14,7 +14,7 @@
--ifm-color-primary-lighter: #359962;
--ifm-color-primary-lightest: #3cad6e;
--ifm-code-font-size: 95%;
--doc-sidebar-width: 400px !important;
--doc-sidebar-width: 450px !important;
}
/* For readability concerns, you should choose a lighter palette in dark mode. */