Skip to content

Issue with Retrieving Active Subscriptions Using getCurrentEntitlements() Method #14

@sinanverve7

Description

@sinanverve7

Hi @CraigRonald555

I hope this message finds you well. I am currently implementing the "capacitor-subscriptions" plugin in our iOS application to manage subscription services. However, I am encountering a recurring issue where the getCurrentEntitlements() method does not return active subscriptions, even though they exist.

implementation Details

Every time a user logs into our app, I call the getCurrentEntitlements() method to check for any active subscriptions. Below is the relevant segment of our implementation:

if (this._subService.firstOpen) {
  this._subService.firstOpen = false;
  setTimeout(async () => {
    const response: CurrentEntitlementsResponse = await Subscriptions.getCurrentEntitlements();
    console.log('new IAP RES ', response);
    const receipt = await this._inAppPurchase.getReceipt().catch((err) => {
      console.log('get receipt error==>', err);
    });
    console.log('GET RECEIPT RES==>', receipt);

    if (response.responseCode == 0) {
      return response.data;
    } else {
      return [];
    }
  }, 0);
}

Issue observed

Despite having active subscriptions, the getCurrentEntitlements() method consistently returns the following response:

[Log] new IAP RES – {responseCode: 1, responseMessage: "No entitlements were found"} (vendor.js, line 60364)

Verification and Additional Context

To verify the presence of an active subscription, I used another plugin ("cordova-plugin-inapppurchase") to fetch the receipt, which indeed shows a lengthy encrypted response indicating an active subscription.

Screenshot Attached:

I am also attaching a screenshot that clearly shows an active subscription for our app, which should normally be detected by this plugin.
subscriptions-screenshot

Request

Could you please investigate why getCurrentEntitlements() might not be detecting active subscriptions as expected?

Thank you for your assistance. I look forward to your prompt response and am hopeful for a resolution.

Best regards,
Sinan

NOTE : I haven't setup storekit configuration file

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions