Skip to content

Commit

Permalink
Merge pull request #6 from glassfy/DEV-117-paywall
Browse files Browse the repository at this point in the history
Dev 117 paywall
  • Loading branch information
lgarbo committed Jun 14, 2023
2 parents 7437f54 + 3652aa5 commit c4dfeda
Show file tree
Hide file tree
Showing 13 changed files with 442 additions and 438 deletions.
4 changes: 2 additions & 2 deletions GlassfyGlue.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'GlassfyGlue'
s.version = '1.3.6'
s.version = '1.4.0'
s.summary = 'Glassfy Glue'

s.homepage = 'https://github.com/glassfy/glassfy-glue.git'
Expand All @@ -21,7 +21,7 @@ Pod::Spec.new do |s|

s.source_files = 'ios/Source/Public/*.h', 'ios/Source/*.{h,m}'
s.public_header_files = 'ios/Source/Public/*.h'
s.dependency 'Glassfy', '1.3.8'
s.dependency 'Glassfy', '1.4.0'

s.test_spec 'GlassfyGlueTests' do |test_spec|
test_spec.source_files = 'ios/Tests/*.{h,m,swift}'
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ GlassfyGlue is available through [CocoaPods](https://cocoapods.org) and [Maven C
Add the following line to your Podfile:

```ruby
pod 'GlassfyGlue', '~> 1.3.6'
pod 'GlassfyGlue', '~> 1.4.0'
```

### Install on android
Expand All @@ -26,7 +26,7 @@ Add the dependency to your module-level `build.gradle`:
```gradle
dependencies {
[...]
implementation 'io.glassfy:androidglue:1.3.11'
implementation 'io.glassfy:androidglue:1.4.0'
}
```

Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.library' version '7.1.2' apply false
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
id 'org.jetbrains.dokka' version '1.6.10' apply false
id 'org.jetbrains.kotlin.android' version '1.8.10' apply false
id 'org.jetbrains.dokka' version '1.8.10' apply false
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0' apply true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ object Configuration {
const val targetSdk = 28
const val minSdk = 21
private const val majorVersion = 1
private const val minorVersion = 3
private const val patchVersion = 11
private const val minorVersion = 4
private const val patchVersion = 0
const val versionName = "$majorVersion.$minorVersion.$patchVersion"
const val snapshotVersionName = "$versionName-SNAPSHOT"
const val artifactGroup = "io.glassfy"
Expand Down
2 changes: 1 addition & 1 deletion android/glue/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ android {
}

dependencies {
implementation("io.glassfy:androidsdk:1.3.11")
implementation("io.glassfy:androidsdk:1.4.0")
}

// Sources
Expand Down
28 changes: 4 additions & 24 deletions android/glue/src/main/kotlin/io/glassfy/glue/GlassfyEncoding.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,16 @@ package io.glassfy.glue
import io.glassfy.androidsdk.model.*
import org.json.JSONArray
import org.json.JSONObject
import java.text.DateFormat
import java.text.SimpleDateFormat

fun encodeArray(array:List<JSONObject>):JSONArray {
fun encodeArray(array:List<JSONObject>): JSONArray {
val all = JSONArray()
array.forEach {
all.put(it)
}
return all
}

fun encodeStringArray(array:List<String>):JSONArray {
fun encodeStringArray(array:List<String>): JSONArray {
val all = JSONArray()
array.forEach {
all.put(it)
Expand Down Expand Up @@ -146,13 +144,6 @@ fun Transaction.encodedJson(): JSONObject {
return jo
}

fun skuFromJsonObject(jo: JSONObject):Sku {
val skuId = jo.optString("skuId")
val productId = jo.optString("productId")

return Sku(skuId,productId, emptyMap<String, String>(), null)
}

fun attributionItemFromJsonObject(jo: JSONObject): AttributionItem? {
val joType = jo.optInt("type",-1)

Expand All @@ -162,17 +153,6 @@ fun attributionItemFromJsonObject(jo: JSONObject): AttributionItem? {
return if (type != null) AttributionItem(type, value) else null
}

fun attributionItemsFromJsonArray(ja: JSONArray): List<AttributionItem> {
val items = mutableListOf<AttributionItem>()
for (i in 0 until ja.length()) {
val jo = ja.getJSONObject(i)
attributionItemFromJsonObject(jo)?.let { item ->
items.add(item)
}
}
return items
}

fun attributionItemTypeFromValue(value: Int): AttributionItem.Type? =
when (value) {
1 -> AttributionItem.Type.AdjustID
Expand All @@ -184,7 +164,7 @@ fun attributionItemTypeFromValue(value: Int): AttributionItem.Type? =
else -> null
}

fun SkuDetails.encodedJson():JSONObject{
fun SkuDetails.encodedJson(): JSONObject{
val jo = JSONObject()

jo.put("identifier", this.sku)
Expand Down Expand Up @@ -218,7 +198,7 @@ fun SkuDetails.encodedJson():JSONObject{
return jo;
}

fun UserProperties.encodedJson():JSONObject {
fun UserProperties.encodedJson(): JSONObject {
val jo = JSONObject()
jo.put("email", this.email)
jo.put("token", this.token)
Expand Down

0 comments on commit c4dfeda

Please sign in to comment.