'Spotlight results not working when the app is not running
I'm working on Spotlight integration for my mac app, I just indexed the data with CoreSpolight everything working fine when the app is running.
I'm using below mentioned NSApplicationDelegate method to open coresponding content when user taps the spotlight result.
func application(_ application: NSApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([NSUserActivityRestoring]) -> Void) -> Bool
This method is not triggering when the app is not running (Ensured using NSLog). And i'm expecting it has to open my application as well But both not working as i expected. What am i missing in this implementation?
Update:
After lots of debugging, I found the root cause of this issue which is the Provisioning profile and signing certificate I'm using. I'm using registered bundleId and provisioning profile with app group enabled.
I just enabled Xcode's Automatically manage signing with some random bundleId. All of a sudden above mentioned NSApplicationDelegate method called and app has launched as well. I just compared the Entitlements and Capabilities of two certificates that's looks same. I Still couldn't fix the issue.
Registered:
Xcode generated
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|


