IOS SDK Auto-renewable subscription with RMStore - how to check an active subscription or not?

I use the RMStore library to work with renewable subscriptions in my iOS application. It works well for a purchase, but I can’t find the documentation, how can I check with RMStore that the current subscription is still active?

The code for checking purchased products does not work here:

 if([persistence isPurchasedProductOfIdentifier:SUBSCRIPTION_1]) { ... }

This code always shows that the subscription was purchased (because it was), but does not verify that this subscription has already passed by date.

I see the method isActiveAutoRenewableSubscriptionForDate "file RMAppReceipe.h , but I can not find documentation on how to remove the recipient subscribe to my application using RMStore and how to test this technique using the method isActiveAutoRenewableSubscriptionForDate . Please help.

Summary . I just need to verify that the @ "com.fanfun.apptestsubscription1" subscription is still active for TODAY (current date) or not. Please provide sample code for this simple check.

+4
source share
2 answers

I think I found a solution and it works:

RMAppReceipt* appReceipt = [RMAppReceipt bundleReceipt];

NSLog(@"Is subscription 1 active: %d", [appReceipt containsActiveAutoRenewableSubscriptionOfProductIdentifier:SUBSCRIPTION_1 forDate:[NSDate date]]);
+6

All Articles