robotmedia / RMStore

A lightweight iOS library for In-App Purchases
Apache License 2.0
2.43k stars 450 forks source link

TestFlight vs Sandbox for RMAppReceipt #227

Open dflateau opened 5 years ago

dflateau commented 5 years ago

In development (XCode 10, iOS12), I'm able to use RMAppReceipt to verify autorenewing subscriptions just fine, using:

RMAppReceipt *appReceipt = [RMAppReceipt bundleReceipt];  
    if (appReceipt) {
        isActive =  [appReceipt containsActiveAutoRenewableSubscriptionOfProductIdentifier:@"0001" 
        forDate:[NSDate date]];
    }
    if (isActive) {
        NSLog(@"PatronSignupViewController: Got a list of subscriptions, a subscription IS active! Restored!");
    } else { //if receipt does not contain an active subscription
        NSLog(@"PatronSignupViewController: Got a list of purchases, but Subscription NOT active!");

However, when I use TestFlight to beta test the app, the system can never find the autorenewing subscription (after I've purchased it in TestFlight - purchasing in TestFlight works fine in TestFlight too).

Is there something fundamentally different that I should be aware of when it comes to purchases, products, RMStore, and TestFlight and Sandbox behaviors? Thx