mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Correctly showing premium expiration date.
This commit is contained in:
parent
f4142a498f
commit
bc78c54b1b
4 changed files with 12 additions and 9 deletions
|
@ -255,7 +255,7 @@ SFSafariViewControllerDelegate> {
|
|||
@property (nonatomic) NSDictionary *dictUserProfile;
|
||||
@property (nonatomic) NSDictionary *dictSocialServices;
|
||||
@property (nonatomic) BOOL isPremium;
|
||||
@property (nonatomic) NSString *premiumExpire;
|
||||
@property (nonatomic) NSInteger premiumExpire;
|
||||
@property (nonatomic, strong) NSMutableDictionary *dictUnreadCounts;
|
||||
@property (nonatomic, strong) NSMutableDictionary *dictTextFeeds;
|
||||
@property (nonatomic) NSArray *userInteractionsArray;
|
||||
|
|
|
@ -233,7 +233,7 @@
|
|||
cachedFavicons = [[PINCache alloc] initWithName:@"NBFavicons"];
|
||||
cachedStoryImages = [[PINCache alloc] initWithName:@"NBStoryImages"];
|
||||
isPremium = NO;
|
||||
premiumExpire = nil;
|
||||
premiumExpire = 0;
|
||||
|
||||
NBURLCache *urlCache = [[NBURLCache alloc] init];
|
||||
[NSURLCache setSharedURLCache:urlCache];
|
||||
|
|
|
@ -598,8 +598,8 @@ static UIFont *userLabelFont;
|
|||
|
||||
appDelegate.isPremium = [[appDelegate.dictUserProfile objectForKey:@"is_premium"] integerValue] == 1;
|
||||
id premiumExpire = [appDelegate.dictUserProfile objectForKey:@"premium_expire"];
|
||||
if (premiumExpire && ![premiumExpire isKindOfClass:[NSNull class]]) {
|
||||
appDelegate.premiumExpire = [premiumExpire stringValue];
|
||||
if (premiumExpire && ![premiumExpire isKindOfClass:[NSNull class]] && premiumExpire != 0) {
|
||||
appDelegate.premiumExpire = [premiumExpire integerValue];
|
||||
}
|
||||
|
||||
// Set up dictSocialFeeds
|
||||
|
|
|
@ -112,8 +112,11 @@
|
|||
[confettiView stopConfetti];
|
||||
[confettiView startConfetti];
|
||||
|
||||
if (appDelegate.premiumExpire != nil) {
|
||||
labelPremiumExpire.text = [NSString stringWithFormat:@"Your premium subscription will renew on %@", appDelegate.premiumExpire];
|
||||
if (appDelegate.premiumExpire != 0) {
|
||||
NSDate *date = [NSDate dateWithTimeIntervalSince1970:appDelegate.premiumExpire];
|
||||
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
|
||||
[dateFormatter setDateFormat:@"MMMM d, yyyy"];
|
||||
labelPremiumExpire.text = [NSString stringWithFormat:@"Your premium subscription will renew on %@", [dateFormatter stringFromDate:date]];
|
||||
} else {
|
||||
labelPremiumExpire.text = @"Your premium subscription is set to never expire. Whoa!";
|
||||
}
|
||||
|
@ -231,9 +234,9 @@
|
|||
spinner.hidden = YES;
|
||||
NSDictionary *results = (NSDictionary *)responseObject;
|
||||
appDelegate.isPremium = [[results objectForKey:@"is_premium"] integerValue] == 1;
|
||||
id premiumExpire = [appDelegate.dictUserProfile objectForKey:@"premium_expire"];
|
||||
if (![premiumExpire isKindOfClass:[NSNull class]]) {
|
||||
appDelegate.premiumExpire = [premiumExpire stringValue];
|
||||
id premiumExpire = [results objectForKey:@"premium_expire"];
|
||||
if (premiumExpire && ![premiumExpire isKindOfClass:[NSNull class]] && premiumExpire != 0) {
|
||||
appDelegate.premiumExpire = [premiumExpire integerValue];
|
||||
}
|
||||
|
||||
[self loadProducts];
|
||||
|
|
Loading…
Add table
Reference in a new issue