Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions iphone/TitaniumKit/TitaniumKit/Sources/API/TiApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,10 @@
#import "TiRootViewController.h"
#import <JavaScriptCore/JavaScriptCore.h>

extern BOOL applicationInMemoryPanic; // TODO: Remove in SDK 9.0+

// TODO: Remove in SDK 9.0+
TI_INLINE void waitForMemoryPanicCleared() // WARNING: This must never be run on main thread, or else there is a risk of deadlock!
{
}

/**
TiApp represents an instance of an application. There is always only one instance per application which could be accessed through <app> class method.
*/
@interface TiApp : TiHost <UIApplicationDelegate, NSURLSessionDelegate, NSURLSessionTaskDelegate, NSURLSessionDownloadDelegate, UNUserNotificationCenterDelegate> {
@interface TiApp : TiHost <UIApplicationDelegate, NSURLSessionDelegate, NSURLSessionTaskDelegate, NSURLSessionDownloadDelegate, UNUserNotificationCenterDelegate, UIWindowSceneDelegate> {
UIWindow *window;
UIImageView *loadView;
UIView *splashScreenView;
Expand Down
27 changes: 16 additions & 11 deletions iphone/TitaniumKit/TitaniumKit/Sources/API/TiApp.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@

#define SHUTDOWN_TIMEOUT_IN_SEC 3

BOOL applicationInMemoryPanic = NO; // TODO: Remove in SDK 9.0+

// TODO: Remove in SDK 9.0+
TI_INLINE void waitForMemoryPanicCleared(void); // WARNING: This must never be run on main thread, or else there is a risk of deadlock!

@interface TiApp ()
- (void)checkBackgroundServices;
- (void)appBoot;
Expand Down Expand Up @@ -327,15 +322,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
[[TiLogServer defaultLogServer] start];
}

// Initialize the root-window
window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];

// Initialize the launch options to be used by the client
launchOptions = [[NSMutableDictionary alloc] initWithDictionary:launchOptions_];

// Initialize the root-controller
[self initController];

// If we have a APNS-UUID, assign it
NSString *apnsUUID = [[NSUserDefaults standardUserDefaults] stringForKey:@"APNSRemoteDeviceUUID"];
if (apnsUUID != nil) {
Expand Down Expand Up @@ -1235,6 +1224,22 @@ - (KrollBridge *)krollBridge
return kjsBridge;
}

#pragma mark UIWindowSceneDelegate

- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options
{
return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role];
}

- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions
{
// Initialize the root-window
window = [[UIWindow alloc] initWithWindowScene:(UIWindowScene *)scene];

// Initialize the root-controller
[self initController];
}

#pragma mark Background Tasks

- (void)beginBackgrounding
Expand Down
17 changes: 17 additions & 0 deletions iphone/iphone/Titanium.plist
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,22 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<true/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>TiApp</string>
</dict>
</array>
</dict>
</dict>
</dict>
</plist>
17 changes: 17 additions & 0 deletions support/iphone/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,22 @@
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>TiApp</string>
</dict>
</array>
</dict>
</dict>
</dict>
</plist>
Loading