-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #173 from qonversion/release/5.0.0
Release 5.0.0
- Loading branch information
Showing
18 changed files
with
348 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<dependencies> | ||
<androidPackages> | ||
<androidPackage spec="io.qonversion.sandwich:sandwich:1.5.2" /> | ||
<androidPackage spec="io.qonversion.sandwich:sandwich:2.0.0" /> | ||
<androidPackage spec="com.fasterxml.jackson.core:jackson-databind:2.11.1" /> | ||
<androidPackage spec="org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.61" /> | ||
</androidPackages> | ||
<iosPods> | ||
<iosPod name="QonversionSandwich" version="1.5.2" /> | ||
<iosPod name="QonversionSandwich" version="2.0.0" /> | ||
</iosPods> | ||
</dependencies> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace QonversionUnity | ||
{ | ||
public class Experiment | ||
{ | ||
public readonly string Id; | ||
public readonly string Name; | ||
public readonly ExperimentGroup Group; | ||
|
||
|
||
public Experiment(Dictionary<string, object> dict) | ||
{ | ||
if (dict.TryGetValue("id", out object value)) Id = value as string; | ||
if (dict.TryGetValue("name", out value)) Name = value as string; | ||
if (dict.TryGetValue("group", out value) && value is Dictionary<string, object> group) | ||
{ | ||
Group = new ExperimentGroup(group); | ||
} | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return $"{nameof(Id)}: {Id}, " + | ||
$"{nameof(Name)}: {Name}, " + | ||
$"{nameof(Group)}: {Group}"; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using JetBrains.Annotations; | ||
|
||
namespace QonversionUnity | ||
{ | ||
public class ExperimentGroup | ||
{ | ||
public readonly string Id; | ||
public readonly string Name; | ||
public readonly ExperimentGroupType Type; | ||
|
||
public ExperimentGroup(Dictionary<string, object> dict) | ||
{ | ||
if (dict.TryGetValue("id", out object value)) Id = value as string; | ||
if (dict.TryGetValue("name", out value)) Name = value as string; | ||
if (dict.TryGetValue("type", out value)) Type = FormatGroupType(value); | ||
} | ||
|
||
public ExperimentGroupType FormatGroupType(object typeValue) { | ||
string type = typeValue as string; | ||
if (type == "control") { | ||
return ExperimentGroupType.Control; | ||
} else if (type == "treatment") { | ||
return ExperimentGroupType.Treatment; | ||
} | ||
|
||
return ExperimentGroupType.Unknown; | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return $"{nameof(Id)}: {Id}, " + | ||
$"{nameof(Name)}: {Name}, " + | ||
$"{nameof(Type)}: {Type}"; | ||
} | ||
} | ||
|
||
public enum ExperimentGroupType | ||
{ | ||
Unknown = -1, | ||
Control = 0, | ||
Treatment = 1 | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using JetBrains.Annotations; | ||
using UnityEngine; | ||
|
||
namespace QonversionUnity | ||
{ | ||
public class RemoteConfig | ||
{ | ||
public readonly Dictionary<string, object> Payload; | ||
[CanBeNull] public readonly Experiment Experiment; | ||
|
||
public RemoteConfig(Dictionary<string, object> dict) | ||
{ | ||
if (dict.TryGetValue("payload", out object value) && value is Dictionary<string, object>) Payload = value as Dictionary<string, object>; | ||
if (dict.TryGetValue("experiment", out value) && value is Dictionary<string, object> experimentInfo) | ||
{ | ||
Experiment = new Experiment(experimentInfo); | ||
} | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return $"{nameof(Payload)}: {Payload}, " + | ||
$"{nameof(Experiment)}: {Experiment}"; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.