Limited
2
0

feat(ci): add supporter verification and auto-hide functionality
Some checks failed
Release / Verify Apple Build (push) Successful in 14s
Release / Build & Pack (push) Successful in 8h59m34s
Release / Publish (push) Failing after 16s

Implement BmcSupporterService to verify supporters via BMC API with configurable caching. Add SupporterEmail and HideIfSupporter properties to all controls to automatically hide donation prompts for existing supporters. Replace PNG logo with SVG for crisp rendering at all scales. Add BmcOptions and BmcConfiguration for library-wide settings. Bump version to 1.1.0.
This commit is contained in:
2026-03-04 00:35:05 -05:00
parent 7ec645b9a6
commit 66c8ec8ecf
12 changed files with 436 additions and 329 deletions

View File

@@ -1,3 +1,4 @@
using BuyMeCofee.Maui.Services;
using SkiaSharp.Views.Maui.Controls.Hosting;
namespace BuyMeCofee.Maui;
@@ -13,4 +14,32 @@ public static class BuyMeACoffeeExtensions
builder.UseSkiaSharp();
return builder;
}
/// <summary>
/// Registers Buy Me a Coffee controls with optional supporter verification.
/// When an AccessToken is provided, controls with HideIfSupporter=true
/// will auto-hide for verified supporters.
/// </summary>
/// <example>
/// builder.UseBuyMeACoffee(options =>
/// {
/// options.AccessToken = "your-bmc-api-token";
/// options.CacheDuration = TimeSpan.FromHours(2);
/// });
/// </example>
public static MauiAppBuilder UseBuyMeACoffee(this MauiAppBuilder builder, Action<BmcOptions> configure)
{
builder.UseSkiaSharp();
var options = new BmcOptions();
configure(options);
if (!string.IsNullOrWhiteSpace(options.AccessToken))
{
BmcConfiguration.SupporterService = new BmcSupporterService(
options.AccessToken, options.CacheDuration);
}
return builder;
}
}