Questions tagged [nsuseractivity]

An NSUserActivity object provides a lightweight way to capture app state so that it can be restored later. NSUserActivity supports activity restoration from Handoff, which lets users begin an activity on one device and continue it on another, and from search results.

Using Handoff, for example, a user who is editing a document on a Mac can continue editing that document on an iPhone. A person watching a movie on an iPad can continue watching on a Mac. In both cases, the users resume the activity at the point at which they stopped on the original device. Your apps should work to make this experience as seamless as possible. In iOS 9 and later, an NSUserActivity object can be indexed and made available to users in search results when they perform on-device searches in Spotlight. To ensure that users get rich search results, you can provide metadata that fully describes the activity. When users select your activity from a list of search results, the system passes that activity and result to your app as it is launched, so that you can restore app state appropriately.

91 questions
1
vote
0 answers

Why is the NSUserActivity contentAttributeSet nil when opening via Spotlight?

I'm computing a NSUserActivity for when I view a specific screen in my app. (Doesn't matter what, imagine a Location) I set a lot of information about this activity/location using the contentAttributeSet. When I visit this screen over and over, I…
horseshoe7
  • 2,745
  • 2
  • 35
  • 49
1
vote
1 answer

Do NSUserActivity-based Siri shortcuts support custom UI?

Do NSUserActivity-based shortcuts support custom UI? I've created a custom Siri Shortcuts with the help of a custom Intent. I was able to create both a UI-less version (just Intent) and a version with the custom UI (IntentsUI) which is shown during…
Richard Topchii
  • 7,075
  • 8
  • 48
  • 115
1
vote
1 answer

How to create multiple shortcuts at application start

So what I am trying is to donate multiple shortcuts (like 20 types of activites) at app delegate...it is weird that it works if I donate in a specific view controller, but if I make a for loop in a app delegate it doesnt work...here is the…
Whirlwind
  • 14,286
  • 11
  • 68
  • 157
1
vote
1 answer

Siri Shortcut with NSUserActivity - activity deletion not working

I am using NSUserActivity and CoreSpotlight APIs following closely along with the NSUserActivity example code sections from the WWDC Introduction to Siri Shortcuts and Building for Voice with Siri Shortcuts videos, but I'm having problems deleting…
1
vote
1 answer

Universal link does not work. Link validator tool displays error:Error no apps associated with url

I followed all the steps for adding universal link support for an app. But the option to open the app is never displayed. The server hosts apple-app-site-association file with the following contents: { "applinks": { "apps": [], …
1
vote
1 answer

Ios10 swift 3 core spotlight search cant get title of nsuseractivity

im not getting anything on userActivity.title , it turns nil at appdelegate. check below, this used to work in ios9 , that i can remember. i need to get the Title set in attributeSet.title , but it is always nil. Code to index my item let…
lorenzo gonzalez
  • 1,894
  • 4
  • 14
  • 18
1
vote
0 answers

iOS Handoff - getContinuationStreams always fails

I'm trying to implement iOS Handoff with fetching bigger data via NSInputStream and NSOutputStream. When I successfully receive user activity in method application(_:continue:restorationHandler:) I call getContinuationStreams but it always fails…
jendan
  • 271
  • 4
  • 14
1
vote
0 answers

What state is a Cocoa app in when application(_:continueUserActivity:restorationHandler:) is called?

I'm going through hell trying to understand state in iOS apps :-( I'm implementing Universal Links and the basics are working. However, I'm confused about the state of the app when this method is called in the AppDelegate: func…
andy
  • 8,775
  • 13
  • 77
  • 122
1
vote
0 answers

Using NSUserActivity, CSSearchableItem with the same uniqueIdentifier and public indexing

I have a couple of hundred items in my app. I index every item with CSSearchableItem. Every time user open the screen with the item I create the NSUserActivity with the same data as in CSSearchableItem (CSSearchableItemAttributeSet for…
Rusik
  • 239
  • 1
  • 11
1
vote
1 answer

How to debug iOS Handoff?

I've added a small amount of code to my app which supposed to handle Handoff. Nothing fancy, just creating simple NSUserActivity, setting my -[UIViewController userActivity] property to it and make it current. And I did added proper…
Alexander Vasenin
  • 11,437
  • 4
  • 42
  • 70
0
votes
0 answers

Siri: NSUserActivity launches default iOS app instead of my app when specific keyword is used

My requirement is basically to launch a specific screen in my app when a user says "Add a new diary entry". Have done following configurations for it to work using NSUserAcitivity Enabled the Siri in the capabilites Added NSUserActivityTypes in the…
niks
  • 544
  • 11
  • 28
0
votes
2 answers

Tap action for new complications of watchOS 9

In earlier watchOS versions (ver>9) we can use complication descriptor to add complications and metadata like userActivity for handle tap action in the watch app delegate (according to AppleDocs): If you create a complication descriptor using the…
0
votes
0 answers

Restoring NSUserActivity

I am working with MacCatalyst and I would like to restore the previous content of windows after reopening the app. I found an example project (https://developer.apple.com/documentation/uikit/uiscenedelegate/restoring_your_app_s_state). I adopted the…
Nikodem
  • 89
  • 1
  • 8
0
votes
0 answers

How do I tell when Siri opened my WatchOS app without using Siri Intents?

Basically the title. It's possible to open apps by just telling Siri "Open " without giving your app an entitlement or adding intents, so I was wondering if it's possible to detect if the app can detect if it's been opened by Siri using something…
Caleb Bolton
  • 89
  • 1
  • 7
0
votes
0 answers

TVUserActivityTypeBrowsingChannelGuide activity does not work

I want to support Apple TV Remote for tvOS application at Control Center. https://support.apple.com/guide/tv/use-ios-or-ipados-control-center-atvb701cadc1/tvos There is problem with Guide button. I can not listen Guide button click event. There is …
Ünal Öztürk
  • 193
  • 2
  • 3
  • 12