diff --git a/platform-darwin/Source/iOS/MPUsersViewController.h b/platform-darwin/Source/iOS/MPUsersViewController.h index 0a21877a..58e31501 100644 --- a/platform-darwin/Source/iOS/MPUsersViewController.h +++ b/platform-darwin/Source/iOS/MPUsersViewController.h @@ -35,10 +35,12 @@ @property(weak, nonatomic) IBOutlet UIButton *nextAvatarButton; @property(weak, nonatomic) IBOutlet UIButton *previousAvatarButton; @property(weak, nonatomic) IBOutlet NSLayoutConstraint *keyboardHeightConstraint; +@property(weak, nonatomic) IBOutlet UIView *spectreInstallAlert; @property(assign, nonatomic, readonly) BOOL active; - (void)setActive:(BOOL)active animated:(BOOL)animated; - (IBAction)changeAvatar:(UIButton *)sender; +- (IBAction)upgradeSpectre:(UIButton *)sender; @end diff --git a/platform-darwin/Source/iOS/MPUsersViewController.m b/platform-darwin/Source/iOS/MPUsersViewController.m index b0a31ad0..f3916937 100644 --- a/platform-darwin/Source/iOS/MPUsersViewController.m +++ b/platform-darwin/Source/iOS/MPUsersViewController.m @@ -100,6 +100,7 @@ typedef NS_ENUM( NSUInteger, MPActiveUserState ) { [self registerObservers]; [self reloadUsers]; + [self updateSpectreAlerts]; [self.marqueeTipTimer invalidate]; self.marqueeTipTimer = [NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector( firedMarqueeTimer: ) @@ -660,6 +661,7 @@ referenceSizeForFooterInSection:(NSInteger)section { PearlAddNotificationObserver( UIApplicationWillEnterForegroundNotification, nil, [NSOperationQueue mainQueue], ^(MPUsersViewController *self, NSNotification *note) { [self reloadUsers]; + [self updateSpectreAlerts]; } ); PearlAddNotificationObserver( UIApplicationDidBecomeActiveNotification, nil, [NSOperationQueue mainQueue], ^(MPUsersViewController *self, NSNotification *note) { @@ -726,6 +728,17 @@ referenceSizeForFooterInSection:(NSInteger)section { }]; } +- (void)updateSpectreAlerts { + + BOOL spectreInstalled = [UIApp canOpenURL:[[NSURL alloc] initWithString:@"spectre:"]]; + if (spectreInstalled) { + self.spectreInstallAlert.visible = NO; + } + else { + self.spectreInstallAlert.visible = [MPiOSAppDelegate get].spectreViewController != nil; + } +} + #pragma mark - NSFetchedResultsControllerDelegate - (void)controllerDidChangeContent:(NSFetchedResultsController *)controller { @@ -907,4 +920,9 @@ referenceSizeForFooterInSection:(NSInteger)section { ++[self selectedAvatar].avatar; } +- (IBAction)upgradeSpectre:(UIButton *)sender { + + [[MPiOSAppDelegate get] migrateFor:nil]; +} + @end diff --git a/platform-darwin/Source/iOS/MPiOSAppDelegate.m b/platform-darwin/Source/iOS/MPiOSAppDelegate.m index aab665f9..38e71335 100644 --- a/platform-darwin/Source/iOS/MPiOSAppDelegate.m +++ b/platform-darwin/Source/iOS/MPiOSAppDelegate.m @@ -189,7 +189,7 @@ MP_LIBS_END SKStoreProductParameterCampaignToken : @"app-masterpassword.ios", /* Campaign: From MasterPassword iOS */ SKStoreProductParameterProviderToken : @153897, /* Provider: Maarten Billemont */ // SKStoreProductParameterITunesItemIdentifier: @510296984, /* Application: MasterPassword iOS */ - SKStoreProductParameterITunesItemIdentifier: @1500430196, /* Application: Spectre iOS */ + SKStoreProductParameterITunesItemIdentifier: @1526402806, /* Application: Spectre iOS */ } completionBlock:^(BOOL result, NSError *error) { if (error) err( @"Failed loading Spectre product information: %@", error ); diff --git a/platform-darwin/Source/iOS/Storyboard.storyboard b/platform-darwin/Source/iOS/Storyboard.storyboard index abb822e2..6224fda7 100644 --- a/platform-darwin/Source/iOS/Storyboard.storyboard +++ b/platform-darwin/Source/iOS/Storyboard.storyboard @@ -1,9 +1,9 @@ - + - + @@ -69,7 +69,7 @@ - + @@ -384,6 +384,38 @@ + + + + + + + + + + + + + + + + + @@ -395,10 +427,12 @@ + + @@ -408,6 +442,7 @@ + @@ -624,20 +659,20 @@ - + - + - + - + - + @@ -772,7 +807,7 @@ - + @@ -847,25 +882,25 @@ - + - + - - + - + - - + - + - - + - + - - + - + - - + -