1

I've followed this excellent tutorial to implement donating Siri Shortcuts from my app:

https://www.raywenderlich.com/6462-siri-shortcuts-tutorial-in-ios-12

but I am unable to receive any custom data set on my NSUserActivity's userInfo dictionary.

Using the sample app in the tutorial, I added:

    activity.userInfo = ["key": "value"]
    activity.requiredUserInfoKeys = ["key"]

to Article.newArticleShortcut(), but userActivity.userInfo is an empty dictionary in the AppDelegate's continueUserActivity.

I tried the suggestions mentioned here (which are solving the same problem with Handoff), but they didn't help: https://developer.apple.com/forums/thread/9690

Has anyone been able to get this to work? I'm not sure what else I'm missing.

carloshwa
  • 1,254
  • 2
  • 11
  • 12
  • Did you find a solution? – thisIsTheFoxe Mar 16 '21 at 10:43
  • 1
    I was using this obj-c method to create my dictionary, and didn't realize they are specified in value-key order (instead of key-value order), that was my mistake: https://developer.apple.com/documentation/foundation/nsdictionary/1574190-initwithobjectsandkeys – carloshwa Mar 16 '21 at 16:35

0 Answers0