Hopefully you've already figured this out, but in case it helps anybody else. The userActivity property of the scene seems to be nil, because the activity is actually provided in the userActivities array of the UIScene.ConnectionOptions.
So, you can use something like this to get it:
if let userActivity = scene.userActivity {
// Do something with the activity
handle(userActivity: userActivity)
} else if let userActivity = connectionOptions.userActivities.first {
// Do something with the activity
handle(userActivity: userActivity)
}
Topic:
App & System Services
SubTopic:
General
Tags: