Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS prompts for Apple ID credentials when calling GetPurchasesAsync() #669

Open
Th3L0x opened this issue Feb 14, 2025 · 0 comments
Open

Comments

@Th3L0x
Copy link

Th3L0x commented Feb 14, 2025

When calling GetPurchasesAsync(ItemType.Subscription) on iOS, the system prompts for Apple ID credentials. This does not happen in other apps, and I would like to understand if this is expected behavior or if there is a way to avoid it.

var billing = CrossInAppBilling.Current;
try
{
    //You must connect
    var connected = await billing.ConnectAsync().ConfigureAwait(false);

    if (!connected)
    {
        //Couldn't connect
        return [];
    }

    var myPuschaes = await billing.GetPurchasesAsync(ItemType.Subscription).ConfigureAwait(false);
    var myProducts = await billing.GetProductInfoAsync(ItemType.Subscription, _productIds).ConfigureAwait(false);
    return myProducts.Select(x => new SubscriptionItem()
    {
        Product = x,
        IsSubscribed = myPuschaes.Where(y => y.ProductId == x.ProductId).Any(),
    });

Is this the correct way to check for active subscriptions?
Should I rely on my own database instead to avoid triggering this prompt?
Is there a way to prevent iOS from requesting credentials?

Would appreciate any insights on whether this is expected behavior or if there’s a workaround.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant