An open API service indexing awesome lists of open source software.

https://github.com/dora4/dorachat-authsdk

DoraChat Auth SDK
https://github.com/dora4/dorachat-authsdk

Last synced: 2 months ago
JSON representation

DoraChat Auth SDK

Awesome Lists containing this project

README

          

dorachat-authsdk ![Release](https://jitpack.io/v/dora4/dorachat-authsdk.svg)
--------------------------------

#### Gradle Dependency Configuration

```groovy
// Add the following code to the build.gradle file in the project root directory
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
```
```kt
// Add data binding support
android {
buildFeatures {
dataBinding = true
}
}
// Add the following code to the build.gradle file in the app module
dependencies {
implementation("com.github.dora4:dorachat-authsdk:1.0.3")
implementation("com.github.dora4:dora:1.3.61")
implementation("com.github.dora4:dora-arouter-support:1.11")
kapt("com.alibaba:arouter-compiler:1.5.2")
implementation("com.github.dora4:dcache-android:3.6.3")
implementation("com.github.dora4:dview-loading-dialog:1.5")
implementation("com.github.dora4:dora-walletconnect-support:2.1.35") {
exclude(group = "com.madgag.spongycastle", module = "core")
}
}
```
#### Automatic Injection of Lifecycle Callback Functions
```xml

```
#### Initialize a series of components in the Application
```kt
private fun initHttp() {
RetrofitManager.initConfig {
okhttp {
// ...
flow(true) // Important
addInterceptor(AuthInterceptor())
build()
}
// ...
mappingBaseUrl(AuthService::class.java, AppConfig.AUTH_SDK_SERVER_URL)
}
}
```
```kt
private fun initAuth() {
val config = DoraChatConfig.Builder(
apiBaseUrl = AppConfig.AUTH_SDK_SERVER_URL,
partitionId = "petwords",
appName = "Pet Words",
themeColor = ContextCompat.getColor(this, R.color.primary)
)
.enableLog(true)
.autoRefreshToken(true)
.build()
DoraChatSDK.init(this, config)
}
```
```kt
private fun initPay() {
DoraFund.init(this, APP_NAME,
getString(R.string.app_desc), URL_DOMAIN,
arrayOf(EVMChains.ETHEREUM, EVMChains.POLYGON, EVMChains.AVALANCHE, EVMChains.BSC), themeColor,
object : DoraFund.PayListener {
override fun onPayFailure(orderId: String, msg: String) {
}

override fun onSendTransactionToBlockchain(
orderId: String,
transactionHash: String
) {
}
})
}
```