Srcmkr.RevenueCat 0.1.2

dotnet add package Srcmkr.RevenueCat --version 0.1.2
NuGet\Install-Package Srcmkr.RevenueCat -Version 0.1.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Srcmkr.RevenueCat" Version="0.1.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Srcmkr.RevenueCat --version 0.1.2
#r "nuget: Srcmkr.RevenueCat, 0.1.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Srcmkr.RevenueCat as a Cake Addin
#addin nuget:?package=Srcmkr.RevenueCat&version=0.1.2

// Install Srcmkr.RevenueCat as a Cake Tool
#tool nuget:?package=Srcmkr.RevenueCat&version=0.1.2

GitHub Nuget Nuget Nuget CI/CD Pipeline

RevenueCat C# SDK

Inofficial C# Revenuecat SDK for your Backend (WebAPI, ...)
Nothing special (yet), but at least a navigatable response from the revenuecat API

Installation

Install via Nuget (Srcmkr.RevenueCat) or CLI

dotnet add package Srcmkr.RevenueCat

Usage

using Srcmkr.RevenueCat;

...

// Your secret API key
var client = RevenueCatClient.WithApiSecret("sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

// Any subscriber ID (auto-generated or alias)
var subscription = await client.GetSubscriber("$RCAnonymousID:71bae8c5044f4728a71c1781b5f59a87");

// Check if user has any subscriptions at all
var hasSubscription = subscription.Entitlements.ContainsKey("subscriptions");
if (!hasSubscription) 
{ 
    //handle no subscription 
}

// Check if user has any entitlement of the group "subscriptions" (<- change that)
// then checks if subscription is expired
var lastSubscription = subscription.Entitlements["subscriptions"];
if (lastSubscription.ExpiresDate < DateTime.UtcNow)
{
    return BadRequest(new ErrorResponse
    {
        Success = false,
        Message = "register.subscription_expired"
    });
}
 

Roadmap

  • Get subscriber
  • Native / preconfigured checkups
    • Expired subscription
    • Has specific (non-) subscription
  • Delete Subscriber
  • Add / Update User Attribution Data
  • Entitlements
    • Grant a promotional entitlement
    • Revoke a promotional entitlement
  • Support of API v2

See the open issues for a full list of proposed features (and known issues).

License

Distributed under the MIT License. See LICENSE for more information.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.2 178 9/28/2023
0.1.1 102 9/28/2023
0.1.0 72 9/27/2023