Siri Shortcut Passes NSUserActivity Object Twice

In my app, when invoking a Shortcut via Siri, the application(_:continueUserActivity:restorationHandler:) method in AppDelegate is called twice.

When I debug, both NSUserActivity objects are identical.

However, when I run the same Shortcut by tapping it manually, the method is only called once as expected.

Has anyone experienced this issue? How can I prevent Siri Shortcuts from delivering the same NSUserActivity twice?

Do you get the same behavior when testing the same paths in the SiriKit sample code project?

The other thing to look at is whether this reproduces the same way when using the scene lifecycle instead of the application lifecycle, since the application lifecycle is deprecated. Note that the sample project above uses the scene-based lifecycle, so if you're seeing the same behavior with that sample, then please file a bug report and post the FB number here.

— Ed Ford,  DTS Engineer

Hi Ed,

Thanks for the detailed response. I’d like to clarify one point: my app is still using the UIApplicationDelegate lifecycle and not the scene-based lifecycle.

Could this duplication be related specifically to using the AppDelegate lifecycle rather than the scene lifecycle? If so, is there a recommended way to handle or prevent the duplicate delivery without migrating to the scene lifecycle?

Thanks in advance for your guidance.

I'd like you to run our sample code project (which is on the scene lifecycle) to see if you still get the duplicate delivery with a set up to your shortcut that is similar to your real app.

If this doesn't reproduce with the scene lifecycle, then please consider it a sign that you need to invest in the migration to the scene-based lifecycle, since the application based lifecycle is end of life.

— Ed Ford,  DTS Engineer

Siri Shortcut Passes NSUserActivity Object Twice
 
 
Q