- Root build.gradle at the end of repositories:
allprojects { repositories { ... maven { url 'https://jitpack.io' } } }
- Add the dependency
dependencies { implementation 'com.github.ingresse:android-sdk:<jitpack-version>' }
val service = ServiceManager.service.v2.search
fun getEvents() {
val request = SearchEvents(state = "sp")
viewModelScope.launch {
kotlin.runCatching {
service.getSearchedEventsPlain(request)
}.onSuccess { data ->
// TODO
}.onFailure { exception ->
// TODO
}
}
}
val service = ServiceManager.service.v2.search
fun getEvents() {
val request = SearchEvents(state = "sp")
viewModelScope.launch {
val result = service.getSearchedEvents(request = request)
result.onSuccess { data ->
// TODO
}.onError { code, throwable ->
// TODO
}.connectionError {
// TODO
}.onTokenExpired {
// TODO
}
}
}
ext {
ingresse_sdk_version = "feature~my-new-feature-SNAPSHOT"
}
dependencies {
implementation "com.github.ingresse:android-sdk:$ingresse_sdk_version"
}
-
Set local path in settings.gradle
include ':sdk' project(':sdk').projectDir = new File(settingsDir, '../android-sdk/sdk')
-
Add the dependency
dependencies { implementation project(':sdk') }