我使用MKStoreKit处理autorenewable订阅。 我目前正在测试1个月的订阅(在测试订阅持续5分钟)。 我购买订阅后,我等它过期。 一旦到期我检查,如果订阅仍然有效。
[[MKStoreManager sharedManager] isSubscriptionActive:kSubscriptionMonthlyIdentifier]
像我希望这将返回错误。 但是,由于它是自动更新的,我希望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:^
{
...
}
我的问题是为什么,当订阅仍然活跃在苹果的结束并没有MKStoreKit让我知道?