NSUserActivity

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

情到浓时终转凉″ 提交于 2021-01-29 11:07:18
问题 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 userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { // First attempt at handling a universal link print("Continue User Activity called: ") if userActivity.activityType ==

How to delete a specific NSUserActivity search index?

隐身守侯 提交于 2020-01-04 10:05:24
问题 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 = CSSearchableItemAttributeSet(itemContentType: kUTTypeContact as String) attributeSet.relatedUniqueIdentifier = objectId let activity = NSUserActivity(activityType: Employee.domainIdentifier) activity.title = name activity.userInfo = userActivityUserInfo activity.keywords =

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

我们两清 提交于 2019-12-24 03:01:33
问题 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: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool Delegate method called with intent type INStartVideoCallIntent But There is other case where the same delegate method called with INStartVideoCallIntent when

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

爷,独闯天下 提交于 2019-12-24 03:01:02
问题 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: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool Delegate method called with intent type INStartVideoCallIntent But There is other case where the same delegate method called with INStartVideoCallIntent when

Handoff not working from native app to website

a 夏天 提交于 2019-12-21 05:15:22
问题 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 my native app on the iPad. What I can't do yet is go from my native app on the iPad to my website in Safari on my Air. For the first view controller that loads in my native app, I have this: - (void)viewDidLoad { [super viewDidLoad]; NSUserActivity

Duplicate search results in spotlight

眉间皱痕 提交于 2019-12-12 03:53:08
问题 I have a requirement where I need to use NSUSerActivity and Corespotlight together. I see duplicate search results in spotlight even after I set relatedUniqueIdentifier =uniqueidentifer. Here is the steps I implemented in my project. 1) Create all CSSearchableItems in appdeleagte didFinishLaunchingWithOptions method. 2) Create NSUSerActivity in specific viewcontroller where relatedUniqueIdentifier = uniqueidentifer(CSSearchableItem) Appreciate your help. 回答1: The issue got resolved after

Usage of NSUserActivity and CoreSpotlight

梦想与她 提交于 2019-12-10 23:06:47
问题 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 supposed to work as per apple documentation,however it won't. let personName = "Jon Doe" let activity = NSUserActivity(activityType: "com.SearchAPIs.test”) activity.userInfo = ["name": "Jon Doe"] activity.title = person.name let keywords = personName

cannot trigger continueUserActivity in Swift 3 / iOS 10

女生的网名这么多〃 提交于 2019-12-10 11:25:13
问题 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 doc, the method is said to be: func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool This differs only slightly from what I see in the swift header interface.

NSUserActivity handoff not working for custom data

浪子不回头ぞ 提交于 2019-12-06 21:33:52
问题 I'm trying to test out the iOS 8.1 handoff feature with NSUserActivity between my iPhone and my iPad. For this, I tried both implementing my own solution, and to use Apple's PhotoHandoff project. However, it's not working. If I provide a webpageURL , the handover works fine, but when I try to use userData or addUserInfoEntriesFromDictionary nothing works, and I can't for the life of me figure out what the catch is to make the data work. Sample code: NSUserActivity *activity = [[NSUserActivity

How to create a Siri Intent that accepts input passed from user

二次信任 提交于 2019-12-04 10:47:36
问题 I created a custom Intent with parameters like so: I've donated it: let intent = PlayIntent() intent.color = color let interaction = INInteraction(intent: intent, response: nil) interaction.donate() and it shows up correctly: However, I'd like an Intent which accepts input from the user. Example, Messages.app: How do I configure my custom Intent to handle input? 回答1: As far as I can tell, this functionality is not available for third-party shortcuts - by which I mean, the shortcuts not