Quick Note does not show "Add Link" for iCloud documents even though persistentIdentifier is set

I'm trying to adopt Quick Note in a document-based app. Has anyone got the "Add Link" button to show up for documents located in iCloud?

For local documents, the button works but then userInfo dictionary is missing from the continued NSUserActivity...

I have prepared an Xcode project that demonstrates the issue, available here on GitHub with a README describing what I have tried and what's not working in more detail:

https://github.com/tomaskraina/feedbackassistant.apple.com/tree/master/QuickNote-UIDocumentVsUserActivity

  • I have filled a Feedback for this: FB9174122

  • I've just tried Pages and Numbers updated for iPadOS 15, Quick Note does NOT show "Add Link" button when local or iCloud document is opened. Seems even Apple does not support Quick Note for document-based apps.

Add a Comment

Replies

I have filled a Feedback for this: FB9174122

Have you been able to resolve this? Seeing the same thing where the userInfo dict is empty in sceneDelegate's continue activity method.

  • No. Didn't even get any feedback on my Feedback.

  • Regarding the empty userInfo dict, it seems there's an issue with restoring NSUserActivity when userInfo contain any URL type (which is the case for when using user activity provided by UIDocument). Using a string (url-encoded bookmark data) instead of URL seems to solve this issue. See the post down on: https://developer.apple.com/forums/thread/649578

Add a Comment

A few more findings after debugging this a couple of more times:

  1. Not using NSUserActivity provided by UIDocument (documents located in iCloud provide those) but creating our own with all the properties being set the same makes indeed QuickNote to show the “Add Link” button. Is this a bug or feature?
  2. Removing all URL types from userInfo dictionary of the NSUserActivity fixes the issue of missing userInfo dict (and other properties) on NSUserActivity in sceneDelegate's continue activity method after tapping the document link in QuickNote. But this breaks Handoff to other devices where we need the iCloud document URL.