You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ma...@apache.org on 2026/05/18 17:38:30 UTC

(cordova-ios) branch master updated: fix: forward NSUserActivity to plugins via CDVSceneDelegate (#1655)

This is an automated email from the ASF dual-hosted git repository.

GitToTheHub pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-ios.git


The following commit(s) were added to refs/heads/master by this push:
     new 72fa9695 fix: forward NSUserActivity to plugins via CDVSceneDelegate (#1655)
72fa9695 is described below

commit 72fa9695259049daeedd48cf41fbdfd9424207b1
Author: Manuel Beck <ma...@outlook.de>
AuthorDate: Mon May 18 19:38:24 2026 +0200

    fix: forward NSUserActivity to plugins via CDVSceneDelegate (#1655)
    
    - Add scene:continueUserActivity: to CDVSceneDelegate so that
    NSUserActivity events (Universal Links, Handoff) received by the
    active UIWindowSceneDelegate are forwarded to Cordova plugins via
    CDVPluginContinueUserActivityNotification.
    - Previously, CDVSceneDelegate only handled URL-scheme opens
    (scene:openURLContexts:). When a Universal Link was tapped inside
    SFSafariViewController, iOS delivered an NSUserActivity to the scene
    delegate, which was silently dropped because no handler existed.
    Plugins such as cordova-plugin-universallinks therefore never received
    the event on cordova-ios 8.x, even though they worked on cordova-ios 7
    (where the activity was delivered to AppDelegate directly).
    - Fixes apache/cordova-ios#1654
    - Generated-By: Claude Sonnet 4.6
---
 CordovaLib/Classes/Public/CDVPlugin.m               | 1 +
 CordovaLib/Classes/Public/CDVSceneDelegate.m        | 5 +++++
 CordovaLib/include/Cordova/CDVPluginNotifications.h | 1 +
 3 files changed, 7 insertions(+)

diff --git a/CordovaLib/Classes/Public/CDVPlugin.m b/CordovaLib/Classes/Public/CDVPlugin.m
index ea099393..2ee30640 100644
--- a/CordovaLib/Classes/Public/CDVPlugin.m
+++ b/CordovaLib/Classes/Public/CDVPlugin.m
@@ -44,6 +44,7 @@
 
 const NSNotificationName CDVPageDidLoadNotification = @"CDVPageDidLoadNotification";
 const NSNotificationName CDVPluginHandleOpenURLNotification = @"CDVPluginHandleOpenURLNotification";
+const NSNotificationName CDVPluginContinueUserActivityNotification = @"CDVPluginContinueUserActivityNotification";
 const NSNotificationName CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification = @"CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification";
 const NSNotificationName CDVPluginResetNotification = @"CDVPluginResetNotification";
 const NSNotificationName CDVViewWillAppearNotification = @"CDVViewWillAppearNotification";
diff --git a/CordovaLib/Classes/Public/CDVSceneDelegate.m b/CordovaLib/Classes/Public/CDVSceneDelegate.m
index 09db4636..da3944bb 100644
--- a/CordovaLib/Classes/Public/CDVSceneDelegate.m
+++ b/CordovaLib/Classes/Public/CDVSceneDelegate.m
@@ -47,4 +47,9 @@
     }
 }
 
+- (void)scene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivity
+{
+    [[NSNotificationCenter defaultCenter] postNotificationName:CDVPluginContinueUserActivityNotification object:userActivity];
+}
+
 @end
diff --git a/CordovaLib/include/Cordova/CDVPluginNotifications.h b/CordovaLib/include/Cordova/CDVPluginNotifications.h
index 36245d7d..3eaa7a2b 100644
--- a/CordovaLib/include/Cordova/CDVPluginNotifications.h
+++ b/CordovaLib/include/Cordova/CDVPluginNotifications.h
@@ -22,6 +22,7 @@
 
 extern const NSNotificationName CDVPageDidLoadNotification;
 extern const NSNotificationName CDVPluginHandleOpenURLNotification;
+extern const NSNotificationName CDVPluginContinueUserActivityNotification;
 extern const NSNotificationName CDVPluginResetNotification;
 extern const NSNotificationName CDVViewWillAppearNotification;
 extern const NSNotificationName CDVViewDidAppearNotification;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org