Skip to content

Commit

Permalink
Merge pull request #77 from qonversion/release/2.1.1
Browse files Browse the repository at this point in the history
Release/2.1.1
  • Loading branch information
Maria-Bordunova authored Dec 9, 2020
2 parents 99d17d6 + f70954c commit bdec36e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
3 changes: 2 additions & 1 deletion app/src/main/java/com/qonversion/android/app/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ public void onError(@NotNull QonversionError error) {
}
}
);
Qonversion.setProperty(QUserProperties.AppsFlyerUserId, AppsFlyerLib.getInstance().getAppsFlyerUID(this));

AppsFlyerConversionListener conversionListener = new AppsFlyerConversionListener() {

@Override
public void onConversionDataSuccess(final Map<String, Object> conversionData) {
Qonversion.setProperty(QUserProperties.AppsFlyerUserId, AppsFlyerLib.getInstance().getAppsFlyerUID(App.this));
Qonversion.attribution(conversionData, AttributionSource.AppsFlyer);
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official

libraryVersion = 2.1.0
libraryVersion = 2.1.1

10 changes: 5 additions & 5 deletions sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ android {

consumerProguardFiles 'consumer-rules.pro'
group = 'com.qonversion.android.sdk'
version = '2.1.0'
version = '2.1.1'
}

buildTypes {
Expand Down Expand Up @@ -56,10 +56,10 @@ bintray {
name = 'com.qonversion.android.sdk'

version {
name = '2.1.0'
name = '2.1.1'
desc = 'qonversion-android-sdk'
released = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZZ", Locale.ENGLISH).format(new Date())
vcsTag = '2.1.0'
vcsTag = '2.1.1'
}

licenses = ['MIT']
Expand All @@ -72,7 +72,7 @@ bintray {
MyPublication(MavenPublication) {
groupId 'com.qonversion.android.sdk'
artifactId 'sdk'
version '2.1.0'
version '2.1.1'
}
}
}
Expand Down Expand Up @@ -102,7 +102,7 @@ ext {

PUBLISH_GROUP_ID = 'com.qonversion.android.sdk'
PUBLISH_ARTIFACT_ID = 'sdk'
PUBLISH_VERSION = '2.1.0'
PUBLISH_VERSION = '2.1.1'

kotlinVersion = '1.3.61'
moshiVersion = '1.9.2'
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/main/java/com/qonversion/android/sdk/Qonversion.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import com.qonversion.android.sdk.validator.TokenValidator

object Qonversion : LifecycleDelegate {

private const val SDK_VERSION = "2.1.0"
private const val SDK_VERSION = "2.1.1"

private lateinit var repository: QonversionRepository
private var userPropertiesManager: QUserPropertiesManager? = null
Expand Down
17 changes: 11 additions & 6 deletions sdk/src/main/java/com/qonversion/android/sdk/errors.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,19 @@ fun Throwable.toQonversionError(): QonversionError {
fun <T> Response<T>.toQonversionError(): QonversionError {
val data = "data"
val message = "message"
var errorMessage = ""
var errorMessage = "failed to parse the backend response"


errorBody()?.let {
val jsonObjError = JSONObject(it.string())
if (jsonObjError.has(data)) {
val jsonObjData = jsonObjError.getJSONObject(data)
errorMessage += if (jsonObjData.has(message)) jsonObjData.getString(message) else ""
}
try {
val jsonObjError = JSONObject(it.string())
if (jsonObjError.has(data)) {
val jsonObjData = jsonObjError.getJSONObject(data)
if (jsonObjData.has(message)) {
errorMessage = jsonObjData.getString(message)
}
}
} catch (e: JSONException) { }
}

return QonversionError(QonversionErrorCode.BackendError, "HTTP status code=${this.code()}, errorMessage=$errorMessage")
Expand Down

0 comments on commit bdec36e

Please sign in to comment.