Skip to content

Commit

Permalink
fix(ios): fix “handleurl” event when using scenes
Browse files Browse the repository at this point in the history
  • Loading branch information
hansemannn committed Apr 15, 2024
1 parent 76dc1db commit 01fca44
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion iphone/TitaniumKit/TitaniumKit/Sources/API/TiApp.m
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,20 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
return YES;
}

// Handle URL-schemes / iOS >= 9
- (void)scene:(UIScene *)scene openURLContexts:(NSSet<UIOpenURLContext *> *)URLContexts
{
UIOpenURLContext *primaryContext = URLContexts.allObjects.firstObject;

NSDictionary<UIApplicationOpenURLOptionsKey, id> *options = @{
UIApplicationOpenURLOptionsSourceApplicationKey : NULL_IF_NIL(primaryContext.options.sourceApplication)
};

[self application:[UIApplication sharedApplication] openURL:primaryContext.URL options:options];
}

// Handle URL-schemes. Note that this selector is not called automatically anymore in iOS 13+
// because of the scene management. Instead, the above "scene:openURLContexts:" selector is called
// that forwards the call for maximum backwards compatibility
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *, id> *)options
{
[self tryToInvokeSelector:@selector(application:openURL:options:)
Expand Down

0 comments on commit 01fca44

Please sign in to comment.