feat: prepare Pro licensing and Android API 36
This commit is contained in:
1 parent
b600412285
commit
11a91863a3
25 files changed
+2447
-62
No files matched your search
@@ -0,0 +1,24 @@
|
||||
namespace LMEMappeCatastaliApp.Services;
|
||||
|
||||
public interface IPlayBillingService
|
||||
{
|
||||
Task<PlayBillingResult> RestoreAsync(CancellationToken cancellationToken = default);
|
||||
Task<PlayBillingResult> PurchaseAsync(string basePlanId, CancellationToken cancellationToken = default);
|
||||
}
|
||||
|
||||
public sealed record PlayBillingResult(bool Completed, bool HasActiveSubscription, bool UserCancelled, string Message)
|
||||
{
|
||||
public static PlayBillingResult Active(string message) => new(true, true, false, message);
|
||||
public static PlayBillingResult Base(string message) => new(true, false, false, message);
|
||||
public static PlayBillingResult Cancelled(string message) => new(false, false, true, message);
|
||||
public static PlayBillingResult Failed(string message) => new(false, false, false, message);
|
||||
}
|
||||
|
||||
public sealed class UnavailablePlayBillingService : IPlayBillingService
|
||||
{
|
||||
public Task<PlayBillingResult> RestoreAsync(CancellationToken cancellationToken = default) =>
|
||||
Task.FromResult(PlayBillingResult.Failed("Google Play Billing è disponibile solo nell'app Android installata da Google Play."));
|
||||
|
||||
public Task<PlayBillingResult> PurchaseAsync(string basePlanId, CancellationToken cancellationToken = default) =>
|
||||
Task.FromResult(PlayBillingResult.Failed("Google Play Billing è disponibile solo nell'app Android installata da Google Play."));
|
||||
}
|
||||
Reference in new issue
Block a user