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
2
votes
1 answer

Is there a way to know which app opened my iOS app?

Let's say I have a news iOS app with universal link support, and I need to know, for my stats, from where that interaction originates. If I were on the web I could know if the user came from e.g. Google, Facebook or any other website. Is there a way…
KPM
  • 10,558
  • 3
  • 45
  • 66
2
votes
0 answers

NSUserActivity deleteAllSavedUserActivities not working

My case is utterly simple: I use the next function private func launchActivity(_ id: String, title: String, invocPhrase: String) { userActivity = NSUserActivity(activityType: "Open_bank") userActivity?.title = title …
2
votes
1 answer

Launching app from Siri causes "NSUserActivity has an interaction attached but it is not handled"

I can successfully launch my app from Siri, but I get that NSUserActivity message in the debugger. I don't recall seeing that message in previous versions, but maybe I wasn't paying attention. What am I missing? Is there something I'm supposed to…
True Brue
  • 33
  • 7
2
votes
1 answer

Getting "Error Domain=NSCocoaErrorDomain Code=257" in a document based app while attempting state restoration

Full error message is: [main] *** Error from FPBookmarkableStringFromDocumentURL, file:///private/var/mobile/Library/Mobile%20Documents/com~apple~CloudDocs/MY_APP/hello.txt -> Error Domain=NSCocoaErrorDomain Code=257 "The file couldn’t be opened…
Jan Kriz
  • 21
  • 1
  • 2
2
votes
0 answers

Can't set separate Siri shortcut phrase through INUIAddVoiceShortcutButton if there are two buttons in a single view

I am unable to set separate Siri shortcut phrases through INUIAddVoiceShortcutButton if there are two buttons in a single view. As soon as I record phrase for one button the other button gets changed to edit mode along with first button. How can I…
Tarun Jain
  • 21
  • 3
2
votes
0 answers

How to add extra data with Universal Links iOS?

I am using Deep Linking/ Universal links in my app. So far everything working fine but I would like to know if you can add extra information to these links so when the user taps them I get back are data. I can load data to a server etc if…
user7097242
  • 1,034
  • 3
  • 16
  • 31
2
votes
2 answers

cannot trigger continueUserActivity in Swift 3 / iOS 10

Note: I figured most of this out - see the update at the end. Still some confusion. I'm trying to implement NSUserActivity handling in Xc8b6 under Swift 3 and having trouble with the method signature for the handler protocol method. In the current…
jeffro37
  • 696
  • 6
  • 16
2
votes
1 answer

Lowercase query parameters in URL using iOS universal links

I was just about to link an app to a domain using universal links (or also refered to as associated domains; available since iOS 9). So far everything worked out and while testing with Safari I was able to open my app correctly, also parse path and…
Funkybit
  • 359
  • 1
  • 2
  • 15
2
votes
0 answers

How do I disable Universal Links on iOS9?

I try to create a NSUserActivity category that it doesn't work, but is impracticable. Is there a way to disable other app's universal links on my app? When user click the link go to another app in my app, how can I to know the timing?
Joyce
  • 21
  • 1
2
votes
0 answers

Retrieve spotlight search text from ios device

I am working on core spotlight feature of ios 9. When type any search text on spotlight search, app contents display in below list and we can navigate to respective application when tap on it. Below delegate is call when tap on…
GuravS
  • 27
  • 1
  • 3
2
votes
1 answer

How to delete a specific NSUserActivity search index?

I use NSUserActivity to index a user activity for searching. I found a solution to delete a specific NSUserActivity, assign a CSSearchableItemAttributeSet with relatedUniqueIdentifier to NSUserActivity: let attributeSet =…
huynguyen
  • 7,616
  • 5
  • 35
  • 48
2
votes
1 answer

Core Spotlight, continueUserActivity in objective-c?

iOS 9.2, xCode 7.2, Objective-C I used this tutorial (Core Spotlight version) but translated it into Objective-C: http://code.tutsplus.com/tutorials/ios-9-introducing-search-apis--cms-24375 Everything works except one thing - I can't get callback…
2
votes
1 answer

Usage of NSUserActivity and CoreSpotlight

I have spent plenty of time to find benefit of NSUserActivity over CoreSpotlight, whether i couldn't find anything practically. Actually, it couldn't index our item, which we set through NSUserActivity. I have attached my snippet below, which…
virus
  • 1,203
  • 13
  • 21
1
vote
0 answers

Swift Detect if Url Handoff Successful

Is there a way to detect whether a user is: Able to handoff to another device / there is a device in the area with bluetooth on that can accept the handoff if the user clicked on their handoff browser button to load the page passed We have an in…
Ryan
  • 107
  • 7
  • 30
1
vote
0 answers

How to get what we says to Siri in our app

Is it possible to get what we says to Siri to get in a label in my app? I get the intent or activity type , but what I need is if we say "Hey Siri, show me my account balance" then I "show me my account balance" must printed on a label in my app. I…