Add object detection, tracking, mobile notifications, and search to any security camera.
check subscription
roryclear15f110b7ead9
diff --git a/ios/clearcam/SceneDelegate.m b/ios/clearcam/SceneDelegate.mindex 3d46540..a4a240f 100644--- a/ios/clearcam/SceneDelegate.m+++ b/ios/clearcam/SceneDelegate.m@@ -4,6 +4,7 @@#import "StoreManager.h"@interface SceneDelegate ()+@property (nonatomic, strong) UIActivityIndicatorView *activityIndicator;@end@implementation SceneDelegate@@ -11,21 +12,50 @@- (void)scene:(UIScene *)scenewillConnectToSession:(UISceneSession *)sessionoptions:(UISceneConnectionOptions *)connectionOptions {- [[StoreManager sharedInstance] clearSessionTokenFromKeychain]; // todo, for testing+ //[[StoreManager sharedInstance] clearSessionTokenFromKeychain]; // todo for testingself.window = [[UIWindow alloc] initWithWindowScene:(UIWindowScene *)scene];- NSString *sessionToken = [[StoreManager sharedInstance] retrieveSessionTokenFromKeychain];- UIViewController *rootVC;- if (sessionToken && sessionToken.length > 0) {- rootVC = [[GalleryViewController alloc] init];- } else {- rootVC = [[LoginViewController alloc] init];- }+ // Create temporary loading view+ UIViewController *loadingVC = [UIViewController new];+ loadingVC.view.backgroundColor = [UIColor systemBackgroundColor];+ self.activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleLarge];+ self.activityIndicator.center = loadingVC.view.center;+ [loadingVC.view addSubview:self.activityIndicator];+ [self.activityIndicator startAnimating];- UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:rootVC];- self.window.rootViewController = navigationController;+ self.window.rootViewController = loadingVC;[self.window makeKeyAndVisible];++ // Check authentication status properly+ [self verifyAuthentication];}-@end+- (void)verifyAuthentication {+ [[StoreManager sharedInstance] verifySubscriptionWithCompletionIfSubbed:^(BOOL isActive, NSDate *expiryDate) {+ dispatch_async(dispatch_get_main_queue(), ^{+ UIViewController *rootVC;++ if (isActive) {+ rootVC = [[GalleryViewController alloc] init];+ } else {+ rootVC = [[LoginViewController alloc] init];+ // Clear any invalid token+ [[StoreManager sharedInstance] clearSessionTokenFromKeychain];+ }++ UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:rootVC];++ // Animate the transition+ [UIView transitionWithView:self.window+ duration:0.3+ options:UIViewAnimationOptionTransitionCrossDissolve+ animations:^{+ self.window.rootViewController = navigationController;+ } completion:nil];++ [self.activityIndicator stopAnimating];+ });+ }];+}+@end