Forum Xamarin.Forms

Check if renewable subscription is active (Plugin.InAppBilling)

WorldOfBastiWorldOfBasti Member ✭✭✭

Hello, I am using the InAppBilling plugin to purchase different subscriptions. My problem is, I don't know how to check if a renewable subscription is active. I tried to get this information like this:

var purchases = await CrossInAppBilling.Current.GetPurchasesAsync(ItemType.Subscription);
if(purchases == null)
{
    return false;
}
{
    foreach(var subscription in purchases)
    {
        Console.WriteLine(subscription);
    }
    return true;
}

This is the console output:
ProductId:com.myapp.subscription1 | AutoRenewing:False | State:Purchased | Id:myProductId

I already tried to use the shared secret as payload and get the information with this code snippet:

Console.WriteLine(subscription.Payload);

but the output was always null.
Maybe someone can help me, thanks in advance.

Answers

Sign In or Register to comment.