Adriano Celentano
10/11/2019, 9:18 AMjanvladimirmostert
10/12/2019, 5:14 AMVinicius Araujo
10/12/2019, 11:26 PMcompanion object Feature : ApplicationFeature<ApplicationCallPipeline, Configuration, Permission> {
override val key = AttributeKey<Permission>("Permissions")
override fun install(pipeline: ApplicationCallPipeline, configure: Configuration.() -> Unit): Permission {
val configuration = Configuration().apply(configure)
val feature = Permission(configuration)
val permissionPhase = PipelinePhase("PermissionPhase")
pipeline.insertPhaseAfter(PipelinePhase("RequestAuthentication"), permissionPhase)
pipeline.intercept(permissionPhase) {
feature.intercept(this)
}
return feature
}
}
Jan Stoltman
10/13/2019, 6:56 PMSocketTimeoutException
, UnknownHostException
on Android) in my common code, but propagate any other exception. Is there a way to solve my problem ktor?cmgurba
10/14/2019, 9:05 PMThrowable
(also tried Exception
) and can't seem to get it hit my configured exception code still... currently on ktor 1.1.4
Santosh Astagi
10/15/2019, 1:06 AMribesg
10/15/2019, 1:36 PMadeln
10/16/2019, 11:40 AMjava.lang.IllegalArgumentException: You should set secure cookie only via secure transport (HTTPS)
I’m running ktor on http, and proxying it through http/2 nginx. Is there a way to solve this?jfburdet
10/16/2019, 4:15 PMShan
10/16/2019, 5:59 PM@Serialized
when it always generates a KSerializer every time? I am explicitly setting it with setMapper(KClass, KSerializer)
right now, but am wondering if there is a way to have it detect it as the KSerializer will always be there (to my knowledge).Scott Dillender
10/16/2019, 6:59 PMJorge R
10/17/2019, 3:45 PMShan
10/17/2019, 10:46 PMRequest of type HttpMethod(value=GET) couldn't send a body with the Android engine.
I see that specifically on the Android engine I cannot send a GET request with an empty body but am unsure of the reasoning for this.Santosh Astagi
10/17/2019, 11:34 PMShan
10/18/2019, 7:52 PMsetListMapper()
and registerList<>()
functions as part of the JsonFeature, but am unsure of how to use them, or if they are even applicable in the case of getting back an array response. Just trying to test it in a test project at the moment, this is what I have. Does my array need to be within the @Serializable
data class itself? The format of the response is:
[
{
id: 382910,
name: "name",
isEnabled: true
},
{
//etc..
}
]
I get this error: Can't locate argument-less serializer for interface java.util.List (Kotlin reflection is not available). For generic classes, such as lists, please provide serializer explicitly.
which makes sense but I also believe there is a way to do this without writing a custom serializer, I just can't find the info anywhere.lewis
10/19/2019, 11:04 AMNikky
10/19/2019, 5:03 PMstatic("/")
and access files from the root of the jar ?
it seems like when i do that the requests do not matchRuckus
10/21/2019, 2:26 PMSzymon Lipiński
10/21/2019, 6:50 PMcoder82
10/22/2019, 11:43 AMSteve Young
10/22/2019, 3:54 PMSantosh Astagi
10/22/2019, 8:41 PMmantono
10/23/2019, 9:50 PMRiccardo Montagnin
10/24/2019, 9:42 AMlewis
10/24/2019, 11:47 AMNikky
10/25/2019, 4:07 PMcatch
or any code past the websocket
https://gist.github.com/NikkyAI/91cd375a24bab6301c14e281cf2d4b93
could alos be that i misunderstood how to use coroutines on js ?
also it seems to work on fine on jvmNikky
10/27/2019, 2:06 PMinstall(WebSockets){
pingPeriod = Duration.ofSeconds(5)
timeout = Duration.ofSeconds(10)
}
Jake
10/28/2019, 6:57 PMHttpClient
and initialize that engine in the iOS project, I keep getting an “Unresolved Reference”. I have no issues creating the engine for Android. Here is my build.gradle
plugins {
id 'org.jetbrains.kotlin.multiplatform' version '1.3.50'
}
repositories {
google()
jcenter()
mavenCentral()
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
ext {
ktor_version = "1.2.5"
}
android {
compileSdkVersion 28
defaultConfig {
applicationId 'org.jetbrains.kotlin.mpp_app_android'
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName '1.0'
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
minifyEnabled false
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
}
kotlin {
android("android")
// This is for iPhone emulator
// Switch here to iosArm64 (or iosArm32) to build library for iPhone device
iosX64("ios") {
binaries {
framework()
}
}
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib-common')
implementation "io.ktor:ktor-client-core:$ktor_version"
}
}
commonTest {
dependencies {
implementation kotlin('test-common')
implementation kotlin('test-annotations-common')
}
}
androidMain {
dependencies {
implementation "io.ktor:ktor-client-core-jvm:$ktor_version"
implementation "io.ktor:ktor-client-apache:$ktor_version"
implementation kotlin('stdlib')
}
}
androidTest {
dependencies {
implementation kotlin('test')
implementation kotlin('test-junit')
}
}
iosMain {
dependencies {
implementation "io.ktor:ktor-client-core-native:$ktor_version"
implementation "io.ktor:ktor-client-ios:$ktor_version" // I saw in Maven that the last recorded version (that I could see) was 1.0.1 - I tried that too
}
}
iosTest {
}
}
}
// This task attaches native framework built from ios module to Xcode project
// (see iosApp directory). Don't run this task directly,
// Xcode runs this task itself during its build process.
// Before opening the project from iosApp directory in Xcode,
// make sure all Gradle infrastructure exists (gradle.wrapper, gradlew).
task copyFramework {
def buildType = project.findProperty('kotlin.build.type') ?: 'DEBUG'
def target = project.findProperty('kotlin.target') ?: 'ios'
dependsOn kotlin.targets."$target".binaries.getFramework(buildType).linkTask
doLast {
def srcFile = kotlin.targets."$target".binaries.getFramework(buildType).outputFile
def targetDir = getProperty('configuration.build.dir')
copy {
from srcFile.parent
into targetDir
include 'app.framework/**'
include 'app.framework.dSYM'
}
}
}
Tony
10/30/2019, 5:57 PMdispatch_async(dispatch_get_main_queue()) {
block.run()
}
Animesh Sahu
10/31/2019, 6:48 AM