我正在使用 MKStoreKit 来处理自动更新订阅。我目前正在测试 1 个月的订阅(在测试中订阅持续 5 分钟)。购买订阅后,我等待它过期。到期后,我会检查订阅是否仍然有效。
[[MKStoreManager sharedManager] isSubscriptionActive:kSubscriptionMonthlyIdentifier]
这会像我期望的那样返回 false。但是,由于它是自动续订的,我希望 MKStoreKit 届时会联系 Apple 以重新验证订阅。也许我使用 MKStoreKit 错误,但根据文档和博客文章,它应该很简单:
//App Delegate
[MKStoreManager sharedManager];
//lets me know when the subscription was purchased
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(subscriptionPurchased:) name:kSubscriptionsPurchasedNotification object:nil];
//lets me know when the subscription expires
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(subscriptionFailed:) name:kSubscriptionsInvalidNotification object:nil];
//In a view with subscription feature
if([[MKStoreManager sharedManager] isSubscriptionActive:kSubscriptionMonthlyIdentifier]){
//access to subscription feature
}
//Where the user would purchase the subscription
[[MKStoreManager sharedManager] buyFeature:subscriptionId onComplete:^(NSString* purchasedFeature, NSData* receiptData)
{
...
}
onCancelled:^
{
...
}
我的问题是,当订阅在 Apple 端仍然有效时,为什么 MKStoreKit 不让我知道?