@@ -324,7 +324,20 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
324
324
return YES ;
325
325
}
326
326
327
- // Handle URL-schemes / iOS >= 9
327
+ - (void )scene : (UIScene *)scene openURLContexts : (NSSet <UIOpenURLContext *> *)URLContexts
328
+ {
329
+ UIOpenURLContext *primaryContext = URLContexts.allObjects .firstObject ;
330
+
331
+ NSDictionary <UIApplicationOpenURLOptionsKey, id > *options = @{
332
+ UIApplicationOpenURLOptionsSourceApplicationKey : NULL_IF_NIL (primaryContext.options .sourceApplication )
333
+ };
334
+
335
+ [self application: [UIApplication sharedApplication ] openURL: primaryContext.URL options: options];
336
+ }
337
+
338
+ // Handle URL-schemes. Note that this selector is not called automatically anymore in iOS 13+
339
+ // because of the scene management. Instead, the above "scene:openURLContexts:" selector is called
340
+ // that forwards the call for maximum backwards compatibility
328
341
- (BOOL )application : (UIApplication *)app openURL : (NSURL *)url options : (NSDictionary <NSString *, id> *)options
329
342
{
330
343
[self tryToInvokeSelector: @selector (application:openURL:options: )
@@ -1185,12 +1198,20 @@ - (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session op
1185
1198
[self tryToInvokeSelector: @selector (scene:willConnectToSession:options: )
1186
1199
withArguments: [NSOrderedSet orderedSetWithObjects: scene, connectionOptions, nil ]];
1187
1200
1188
- // If a "application-launch-url" is set, launch it directly
1189
- [self launchToUrl ];
1201
+ // Catch exceptions
1202
+ [TiExceptionHandler defaultExceptionHandler ];
1203
+
1204
+ // Enable device logs (e.g. for physical devices)
1205
+ if ([[TiSharedConfig defaultConfig ] logServerEnabled ]) {
1206
+ [[TiLogServer defaultLogServer ] start ];
1207
+ }
1190
1208
1191
1209
// Initialize the root-controller
1192
1210
[self initController ];
1193
1211
1212
+ // If a "application-launch-url" is set, launch it directly
1213
+ [self launchToUrl ];
1214
+
1194
1215
// Boot our kroll-core
1195
1216
[self boot ];
1196
1217
0 commit comments