-
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 #253 from qonversion/release/8.1.0
Release 8.1.0
- Loading branch information
Showing
18 changed files
with
361 additions
and
46 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:5.0.4" /> | ||
<androidPackage spec="io.qonversion.sandwich:sandwich:5.1.3" /> | ||
<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="5.0.4" /> | ||
<iosPod name="QonversionSandwich" version="5.1.3" /> | ||
</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
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.Collections.Generic; | ||
using System.Linq; | ||
using JetBrains.Annotations; | ||
|
||
namespace QonversionUnity | ||
{ | ||
public class PurchaseOptions | ||
{ | ||
[CanBeNull] public readonly string OfferId; | ||
|
||
public readonly bool ApplyOffer; | ||
|
||
[CanBeNull] public readonly Product OldProduct; | ||
|
||
[CanBeNull] public readonly PurchaseUpdatePolicy? UpdatePolicy; | ||
|
||
[CanBeNull] public readonly List<string> ContextKeys; | ||
|
||
public readonly int Quantity; | ||
|
||
public PurchaseOptions( | ||
[CanBeNull] string offerId, | ||
bool applyOffer, | ||
[CanBeNull] Product oldProduct, | ||
[CanBeNull] PurchaseUpdatePolicy? updatePolicy, | ||
[CanBeNull] List<string> contextKeys, | ||
int quantity) | ||
{ | ||
OfferId = offerId; | ||
ApplyOffer = applyOffer; | ||
OldProduct = oldProduct; | ||
UpdatePolicy = updatePolicy; | ||
ContextKeys = contextKeys; | ||
Quantity = quantity; | ||
} | ||
|
||
public override string ToString() { | ||
return $"{nameof(OfferId)}: {OfferId}, " + | ||
$"{nameof(ApplyOffer)}: {ApplyOffer}, " + | ||
$"{nameof(OldProduct)}: {OldProduct}, " + | ||
$"{nameof(UpdatePolicy)}: {UpdatePolicy}, " + | ||
$"{nameof(ContextKeys)}: {ContextKeys}"; | ||
} | ||
} | ||
} |
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,106 @@ | ||
using System.Collections.Generic; | ||
using JetBrains.Annotations; | ||
|
||
namespace QonversionUnity | ||
{ | ||
public class PurchaseOptionsBuilder { | ||
[CanBeNull] private string _offerId; | ||
private bool _applyOffer = true; | ||
[CanBeNull] private Product _oldProduct; | ||
[CanBeNull] private PurchaseUpdatePolicy? _updatePolicy; | ||
[CanBeNull] private List<string> _contextKeys; | ||
private int _quantity = 1; | ||
|
||
/// <summary> | ||
/// iOS only. | ||
/// Set quantity of product purchasing. Use for consumable in-app products. | ||
/// </summary> | ||
/// <param name="quantity">Quantity of product purchasing.</param> | ||
/// <returns>Builder instance for chain calls.</returns> | ||
public PurchaseOptionsBuilder SetQuantity(int quantity) | ||
{ | ||
this._quantity = quantity; | ||
return this; | ||
} | ||
|
||
/// <summary> | ||
/// Android only. | ||
/// Set offer for the purchase. | ||
/// </summary> | ||
/// <param name="offer">Concrete offer which you'd like to purchase.</param> | ||
/// <returns>Builder instance for chain calls.</returns> | ||
public PurchaseOptionsBuilder SetOffer(ProductOfferDetails offer) | ||
{ | ||
_offerId = offer.OfferId; | ||
return this; | ||
} | ||
|
||
/// <summary> | ||
/// Android only. | ||
/// Set the offer ID to the purchase. | ||
/// </summary> | ||
/// <param name="offerId">Concrete offer ID which you'd like to purchase.</param> | ||
/// <returns>Builder instance for chain calls.</returns> | ||
public PurchaseOptionsBuilder SetOfferId(string offerId) | ||
{ | ||
_offerId = offerId; | ||
return this; | ||
} | ||
|
||
/// <summary> | ||
/// Android only. | ||
/// Call this function to remove any intro/trial offer from the purchase (use only a bare base plan). | ||
/// </summary> | ||
/// <returns>Builder instance for chain calls.</returns> | ||
public PurchaseOptionsBuilder RemoveOffer() | ||
{ | ||
_applyOffer = false; | ||
return this; | ||
} | ||
|
||
/// <summary> | ||
/// Android only. | ||
/// Set Qonversion product from which the upgrade/downgrade will be initialized. | ||
/// </summary> | ||
/// <param name="oldProduct">Qonversion product from which the upgrade/downgrade will be initialized.</param> | ||
/// <returns>Builder instance for chain calls.</returns> | ||
public PurchaseOptionsBuilder SetOldProduct(Product oldProduct) | ||
{ | ||
_oldProduct = oldProduct; | ||
return this; | ||
} | ||
|
||
|
||
/// <summary> | ||
/// Android only. | ||
/// Set the update policy for the purchase. | ||
/// </summary> | ||
/// <param name="updatePolicy">Update policy for the purchase.</param> | ||
/// <returns>Builder instance for chain calls.</returns> | ||
public PurchaseOptionsBuilder SetUpdatePolicy(PurchaseUpdatePolicy updatePolicy) | ||
{ | ||
_updatePolicy = updatePolicy; | ||
return this; | ||
} | ||
|
||
/// <summary> | ||
/// Set the context keys associated with a purchase. | ||
/// </summary> | ||
/// <param name="contextKeys">Context keys for the purchase.</param> | ||
/// <returns>Builder instance for chain calls.</returns> | ||
public PurchaseOptionsBuilder SetContextKeys(List<string> contextKeys) | ||
{ | ||
_contextKeys = contextKeys; | ||
return this; | ||
} | ||
|
||
/// <summary> | ||
/// Generate a <see cref="PurchaseOptions"/> instance with all the provided options. | ||
/// </summary> | ||
/// <returns>The complete <see cref="PurchaseOptions"/> instance.</returns> | ||
public PurchaseOptions Build() | ||
{ | ||
return new PurchaseOptions(_offerId, _applyOffer, _oldProduct, _updatePolicy, _contextKeys, _quantity); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.