From f83f2af529f9325a2d71cf4e8eadcd3def54f8b6 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Sun, 30 Apr 2017 18:45:08 -0400 Subject: [PATCH] Fix store product images and http URL links. --- .../Source/iOS/MPPreferencesViewController.m | 6 +- .../Source/iOS/MPStoreViewController.h | 1 + .../Source/iOS/MPStoreViewController.m | 19 +++++- .../Source/iOS/MPUsersViewController.m | 5 +- .../Source/iOS/MPWebViewController.m | 2 +- .../Source/iOS/Storyboard.storyboard | 66 ++++++++++--------- 6 files changed, 61 insertions(+), 38 deletions(-) diff --git a/platform-darwin/Source/iOS/MPPreferencesViewController.m b/platform-darwin/Source/iOS/MPPreferencesViewController.m index 9d19ddb8..ae83dd00 100644 --- a/platform-darwin/Source/iOS/MPPreferencesViewController.m +++ b/platform-darwin/Source/iOS/MPPreferencesViewController.m @@ -207,13 +207,13 @@ - (IBAction)homePageButton:(id)sender { [[self dismissPopup].navigationController performSegueWithIdentifier:@"web" sender: - [NSURL URLWithString:@"http://masterpasswordapp.com"]]; + [NSURL URLWithString:@"https://ssl.masterpasswordapp.com"]]; } - (IBAction)securityButton:(id)sender { [[self dismissPopup].navigationController performSegueWithIdentifier:@"web" sender: - [NSURL URLWithString:@"http://masterpasswordapp.com/security.html"]]; + [NSURL URLWithString:@"https://ssl.masterpasswordapp.com/security.html"]]; } - (IBAction)sourceButton:(id)sender { @@ -225,7 +225,7 @@ - (IBAction)thanksButton:(id)sender { [[self dismissPopup].navigationController performSegueWithIdentifier:@"web" sender: - [NSURL URLWithString:@"http://thanks.lhunath.com"]]; + [NSURL URLWithString:@"https://thanks.lhunath.com"]]; } #pragma mark - Private diff --git a/platform-darwin/Source/iOS/MPStoreViewController.h b/platform-darwin/Source/iOS/MPStoreViewController.h index ff772a07..0c3689a6 100644 --- a/platform-darwin/Source/iOS/MPStoreViewController.h +++ b/platform-darwin/Source/iOS/MPStoreViewController.h @@ -32,6 +32,7 @@ @property(nonatomic) IBOutlet UILabel *priceLabel; @property(nonatomic) IBOutlet UILabel *titleLabel; @property(nonatomic) IBOutlet UILabel *descriptionLabel; +@property(nonatomic) IBOutlet UIImageView *thumbnailView; @property(nonatomic) IBOutlet UIActivityIndicatorView *activityIndicator; @property(nonatomic) IBOutlet UIView *purchasedIndicator; diff --git a/platform-darwin/Source/iOS/MPStoreViewController.m b/platform-darwin/Source/iOS/MPStoreViewController.m index e712bb84..8e62674c 100644 --- a/platform-darwin/Source/iOS/MPStoreViewController.m +++ b/platform-darwin/Source/iOS/MPStoreViewController.m @@ -160,7 +160,7 @@ PearlEnum( MPDevelopmentFuelConsumption, - (IBAction)sendThanks:(id)sender { [[self dismissPopup].navigationController performSegueWithIdentifier:@"web" sender: - [NSURL URLWithString:@"http://thanks.lhunath.com"]]; + [NSURL URLWithString:@"https://thanks.lhunath.com"]]; } #pragma mark - MPInAppDelegate @@ -220,6 +220,7 @@ PearlEnum( MPDevelopmentFuelConsumption, self.priceLabel.text = purchased? @"": [self price]; self.titleLabel.text = product.localizedTitle; self.descriptionLabel.text = product.localizedDescription; + self.thumbnailView.image = [self productImage]; if (transaction && (transaction.transactionState == SKPaymentTransactionStateDeferred || transaction.transactionState == SKPaymentTransactionStatePurchasing)) @@ -228,6 +229,22 @@ PearlEnum( MPDevelopmentFuelConsumption, [self.activityIndicator stopAnimating]; } +- (UIImage *)productImage { + + if ([MPProductGenerateLogins isEqualToString:self.product.productIdentifier]) + return [UIImage imageNamed:@"thumb_generated_login"]; + if ([MPProductGenerateAnswers isEqualToString:self.product.productIdentifier]) + return [UIImage imageNamed:@"thumb_generated_answers"]; + if ([MPProductOSIntegration isEqualToString:self.product.productIdentifier]) + return [UIImage imageNamed:@"thumb_ios_integration"]; + if ([MPProductTouchID isEqualToString:self.product.productIdentifier]) + return [UIImage imageNamed:@"thumb_touch_id"]; + if ([MPProductFuel isEqualToString:self.product.productIdentifier]) + return [UIImage imageNamed:@"thumb_fuel"]; + + return nil; +} + - (NSString *)price { NSNumberFormatter *currencyFormatter = [NSNumberFormatter new]; diff --git a/platform-darwin/Source/iOS/MPUsersViewController.m b/platform-darwin/Source/iOS/MPUsersViewController.m index 6f141860..b359add4 100644 --- a/platform-darwin/Source/iOS/MPUsersViewController.m +++ b/platform-darwin/Source/iOS/MPUsersViewController.m @@ -119,8 +119,9 @@ typedef NS_ENUM( NSUInteger, MPActiveUserState ) { - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - if ([segue.identifier isEqualToString:@"web"]) - ((MPWebViewController *)segue.destinationViewController).initialURL = [NSURL URLWithString:@"http://thanks.lhunath.com"]; + if ([segue.identifier isEqualToString:@"thanks"]) + ((MPWebViewController *)segue.destinationViewController).initialURL = + [NSURL URLWithString:@"https://thanks.lhunath.com"]; } - (void)viewWillDisappear:(BOOL)animated { diff --git a/platform-darwin/Source/iOS/MPWebViewController.m b/platform-darwin/Source/iOS/MPWebViewController.m index 092f2068..14f2dcfe 100644 --- a/platform-darwin/Source/iOS/MPWebViewController.m +++ b/platform-darwin/Source/iOS/MPWebViewController.m @@ -32,7 +32,7 @@ [super viewWillAppear:animated]; if (!self.initialURL) - self.initialURL = [NSURL URLWithString:@"http://masterpasswordapp.com"]; + self.initialURL = [NSURL URLWithString:@"https://ssl.masterpasswordapp.com"]; self.webNavigationItem.title = self.initialURL.host; diff --git a/platform-darwin/Source/iOS/Storyboard.storyboard b/platform-darwin/Source/iOS/Storyboard.storyboard index 874beea1..ec956805 100644 --- a/platform-darwin/Source/iOS/Storyboard.storyboard +++ b/platform-darwin/Source/iOS/Storyboard.storyboard @@ -292,7 +292,7 @@ - + @@ -526,7 +526,7 @@ - + @@ -708,13 +708,13 @@ - + @@ -725,7 +725,7 @@ - + @@ -740,7 +740,7 @@ - + @@ -751,7 +751,7 @@