I am using scenes and setting up Handoff between a Mac and iPad/iOS application. Whenever I receive the user activity on the iPad, targetContentIdentifier
is always nil. I've confirmed that things like userInfo and persistentIdentifier are coming through by outputting them in func scene(_ scene: UIScene, continue userActivity: NSUserActivity)
, but without the targetContentIdentifier is always empty. Without it, I can't use the activation condition's and proper scene isn't being selected by iOS... is there something beyond setting it and marking an activity as eligible for handoff that I am missing?
targetContentIdentifier on NSUserActivity nil on Handoff
I can observe the same effect when restoring scenes after app being closed (by user or through crash) on iPad simulator, iOS 15.5. Scenario is as follows:
- Start new scene with activity containing targetContentIdentifier
- Send scene to background -> stateRestorationActivity(for:) is called, where activity scene was started with is returned (targetContentIdentifier is still there).
- App crashes
- App is restarted, but activity received in scene(:willConnectTo:options:) does not have anymore targetContentIdentifier in session.stateRestorationActivity.
Can anyone comment on that - is this correct behaviour or is this a bug?