Search Unity

[Solved] How can I check if a subscription is active?

Discussion in 'Unity IAP' started by Deleted User, Jun 12, 2017.

Thread Status:
Not open for further replies.
  1. Deleted User

    Deleted User

    Guest

    I am trying to check if a subscription is active. I do not care if they cheat.

    The following snippet appears to work for Android:

    var products = storeController.products.all;
    bool subscribed = products.Where(p => p.hasReceipt).Count() > 0;

    (although I do not know if this takes the expiration date into account. Do receipts come through even after they expire?)

    But I cannot figure out how to do it for iOS. I have spent a couple days researching, but without success.

    I have several subscription lengths available, but they all do the same thing. So I do not care what product they have purchased - only that they have purchased one, and it is not expired.

    I was really looking for some copy and paste code, but I have not yet been able to find it. I will take any guidance I can get here. Thanks!
     
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
Thread Status:
Not open for further replies.