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

Can't get siri shortcuts to work in iOS 14.6

I'm creating an app similar to THIS one I'm working on adding siri shortcuts into my app to get quotes by categories just like this app. So far I've succeeded in creating NSUserActivity and donating shortcuts. My shortcuts are showing up in…
araina1995
  • 21
  • 1
  • 3
1
vote
0 answers

Continuing userActivity while app I closed

I am trying to implement universal linking into my app using the AppDelegate class. It is working perfectly fine when the app is already open in the background, but it is acting strange while the app is NOT in the background, specifically it will…
Noah Iarrobino
  • 1,435
  • 1
  • 10
  • 31
1
vote
0 answers

continuing userActivity not working when app is closed

I am trying to implement universal linking in swift, but am having an issue when the app is not already opened. It works perfectly fine when the app has been previously opened, it will navigate to the proper view controller. When the app has not…
ShedSports
  • 541
  • 2
  • 7
  • 14
1
vote
2 answers

Intent summary not recognised/showing in ios shortcuts app -- only title

For my custom intent, I have provided a summary with one parameter in my intent definition file. On the simulator (and device) only the title of the intent shows up. The parameter can be selected from the "show more" dropdown menu. The preview in…
SimeonRumy
  • 363
  • 4
  • 9
1
vote
1 answer

Swift / iOS: How to pass data from AppDelegate to ViewController label?

I've got a (very) basic Universal Links test program that correctly launches from a link to the associated domain. It prints the received URL to the debug console. in AppDelegate.swift: func application(_ application: UIApplication, continue…
tuck1s
  • 1,002
  • 9
  • 28
1
vote
0 answers

userInfo is empty in continueUserActivity from Siri Shortcut

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…
carloshwa
  • 1,254
  • 2
  • 11
  • 12
1
vote
0 answers

INInteraction.delete not working in iOS13.7

Using iOS13.7, Swift5.2.4, XCode11.7, I try to delete an existing INInteraction in my iOS App. The INShortcut is created as follows: @available(iOS 12.0, *) func createSiriButton(documentID: String, invitationCode: String) ->…
iKK
  • 6,394
  • 10
  • 58
  • 131
1
vote
0 answers

How to delete Siri Shortcut Intents from your iOS App?

Using iOS13.6.1, Swift5.2.4, XCode11.6, Following Apple's documentation, I try to delete a particular Siri Shortcut from my app. The following code shows how I created the Siri Shortcut in the first place. The Code further below shows my trial to…
iKK
  • 6,394
  • 10
  • 58
  • 131
1
vote
0 answers

NSUserActivity for a newly requested scene has no user info

In my app I have a table view where each cell represents a file URL. The user can tap a cell and a new UIScene will open representing that file... // In some view controller override func tableView(_ tableView: UITableView, didSelectRowAt indexPath:…
DanubePM
  • 1,526
  • 1
  • 10
  • 24
1
vote
1 answer

How to force NSUserActivity to save?

NSUserActivity has a method setNeedsSave:. [userActivity setNeedsSave:YES]; Unfortunately it doesn't save at once, but just tells a user activity object that it should be saved in the future. In case of a crash the state may not be saved. As a…
Dmytro Skorokhod
  • 424
  • 8
  • 17
1
vote
0 answers

Duplicated display of NSUserActivity in Spotlight

I know there are several posts on this topic out there but they differed to much from my problem. I am trying to display my NSUserActivity in Spotlight Search. For my NSUserActivity I am using three APIs: .isEligibleForHandoff, .isEligibleForSearch…
Prydwen
  • 531
  • 4
  • 11
1
vote
1 answer

NSUserActivity: Which method will be called when user will tap (or will make call ) from recent log of my app?

I am implementing CallKit in swift and I'm facing a problem with NSUserActivity while making a call directly from the recent log. While tapping on my app entry in the recent log, my app is launching but any method of AppDelegate is not calling. I…
Afsar edrisy
  • 1,985
  • 12
  • 28
1
vote
1 answer

application:continueUserActivity:restorationHandler: is not getting called when using handoff

I am using the newest versions of Xcode, macOS, iOS on my test devices (not using the simulator) and SwiftUI My UI with SwiftUI and my UserActivity DelegateHandler: struct UserActivityDelegateObserver: UIViewRepresentable { @Binding var…
Prydwen
  • 531
  • 4
  • 11
1
vote
1 answer

When setting an userActivity do we have to override updateUserActivityState

Docs on updateUserActivityState are a bit vague to me. https://developer.apple.com/documentation/uikit/uiresponder/1621095-updateuseractivitystate Subclasses override this method to update the state of the given user activity. You should add state…
Tieme
  • 62,602
  • 20
  • 102
  • 156
1
vote
0 answers

Core Spotlight subtitle attribute

Is there a list of content types -> attribute fields in CSSearchableItemAttributeSet that describe which attribute fields are used for the Spotlight search result subtitle? Apple's example documents show multiple content attributes being used such…
ansonl
  • 786
  • 1
  • 13
  • 34