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

NSUserActivity Not Getting Indexed by Spotlight

I'm trying to get my NSUserActivity to be indexed by the private index in Spotlight in iOS. I have followed all the steps in Apple's Index Activities and Navigation Points guide but my activity doesn't seem to be getting indexed by spotlight at…
Andy Ibanez
  • 12,104
  • 9
  • 65
  • 100
5
votes
1 answer

Handoff not working from native app to website

My devices: iPad Mini (latest), iOS 8 dp5. Macbook Air, Yosemite dp5. I have Handoff working between the two above devices. Safari, Mail, Messages, Calendar, etc. all handoff with no problems. I can even handoff between my website on the Air and…
djibouti33
  • 12,102
  • 9
  • 83
  • 116
4
votes
0 answers

How to get SwiftUI's .onContinueUserActivity working

I'm curious, has anyone managed to get SwiftUI's .onContinueUserActivity working? Looking at the sample code from Apple, it seems to be working in their app (note the testing instructions in the ReadMe file). But when I set up a new project for…
Curious Jorge
  • 354
  • 1
  • 9
4
votes
0 answers

continue userActivity: NSUserActivity - Identify it is from callkit or contacts

I have implemented callkit in my project. So when I report incoming call there is video button. so according to this answer user102008's Answer When user tap on video button func application(_ application: UIApplication, continue userActivity:…
Prashant Tukadiya
  • 15,838
  • 4
  • 62
  • 98
4
votes
0 answers

Duplicate item show up in spotlight and thumbnail not showing

I'm trying to using NSUserActivity, Core Spotlight APIs and web markup at the same time. So based on the suggestions given in App Search Programming Guide If you’re using all three APIs, it works well to use the URL of the relevant webpage as the…
xi.lin
  • 3,326
  • 2
  • 31
  • 57
3
votes
0 answers

What does the interactionActivityTrackingTag(_:) method do?

I recently came across the interactionActivityTrackingTag(_:) method. It was released on iOS 16, and I’m looking for information about it. The following doc's example tracks the scrolling activity of a List: List { Section("Today") { …
Vitya Shurapov
  • 2,200
  • 2
  • 27
  • 32
3
votes
1 answer

iOS .onContinueUserActivity Not Being Called

.onContinueUserActivity is never called in the state restoration example app provided by Apple. Inside of DetailView, this method is called: // The described activity for this view. .userActivity(DetailView.productUserActivityType, …
3
votes
1 answer

How to identify AppClips is launched by appclip card or by the user by searching the appclip in spotlight

I am working on an appclip, when I scan a QR code, appclip card gets shown and on click of open appclips gets launched and I performed a booking flow. Now next time if user comes to appclips using QR code, then I want to show an alert to user, that…
3
votes
0 answers

UserActivity ReferrerURL is nil

- (BOOL)application:(UIApplication *)application continueUserActivity:userActivity... method which handles deep link delegate has userActivity which one of its properties is referrerURL which always is nil My guess is it should contain the referrer…
user784625
  • 1,928
  • 5
  • 24
  • 38
3
votes
1 answer

How to predefine certain phrases that should be used to trigger certain actions by Siri

I am able to create a shortcut using NSUserActivity or Intent, and then let the user to record a certain phrase which will trigger certain shortcut, by presenting to him an appropriate view controller, or by sending hi to the…
Whirlwind
  • 14,286
  • 11
  • 68
  • 157
3
votes
1 answer

How to change year date in CSSearchableItem (content type — kUTTypeMovie)?

I have an app with video content and I track all viewed items with NSUserActivity to add it to Spotlight. The result looks perfect, except year date, it is always a year when NSUserActivity was added to the index. But I need to change this to…
ArtFeel
  • 11,701
  • 4
  • 29
  • 41
3
votes
1 answer

NSUserActivity for directions not working

I'm having some trouble implementing an NSUserActivity with a mapItem from my app. All I want is to be able to use the "Get Directions" suggestion in the app switcher, like Foursquare does: I'm using the following code in my viewDidLoad method, in…
Iain Mullan
  • 199
  • 1
  • 7
3
votes
0 answers

When to create and call NSUserActivity becomeCurrent?

When should I create and call becomeCurrent on NSUSerActivity for screen. On viewDidLoad, viewWillAppear or viewDidAppear? Does it matter?
Rusik
  • 239
  • 1
  • 11
3
votes
1 answer

Can't restore NSUserActivity's userInfo

I have an app where you can find employees at our university to contact them via e-mail. When you found someone and look at the detailed information, a NSUserActivity is created: if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"9.0")) { …
FelixSFD
  • 6,052
  • 10
  • 43
  • 117
2
votes
0 answers

How to Use Quick Notes Using SwiftUI

I am trying to implement Quick Notes through SwiftUI, rather than UIKit or AppKit. I am unsure if the behaviour below is due to a bug or if there is something I am missing. I have already successfully implemented NSUserActivity for Handoff,…
Belacqua2000
  • 301
  • 2
  • 6