I am using RMStore library to work with auto-renewable subscriptions in my iOS app. It works well for purchasing, but I can't find any documentation how to check with RMStore that current subscription is still active?
Code for checking purchased products does not worked here:
if([persistence isPurchasedProductOfIdentifier:SUBSCRIPTION_1]) { ... }
This code is always show that Subscription was purchased (because it was) but does not check that this subscription already passed by date.
I see method "isActiveAutoRenewableSubscriptionForDate" in RMAppReceipe.h file, but I does not find any documentation how to retrive subscription receipe in my app with RMStore and how to check this receipe with isActiveAutoRenewableSubscriptionForDate method. Please help.
Summary: I just need to check that subscription @"com.fanfun.apptestsubscription1" is still active for TODAY (current date) or not. Please provide sample code for this simple check.
I think I found a solution and it work:
RMAppReceipt* appReceipt = [RMAppReceipt bundleReceipt];
NSLog(@"Is subscription 1 active: %d", [appReceipt containsActiveAutoRenewableSubscriptionOfProductIdentifier:SUBSCRIPTION_1 forDate:[NSDate date]]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With