I need to present a phone number in one of the dynamic quick actions, if there is such a number in the clipboard.
I tried putting the code to do this in applicationDidBecomeActive(_ application: UIApplication)
method, but it doesn't get called in the right moment.It only gets called after user actually selects on of the methods and opens the app.
Where should I put the code to check the contents of the clipboard when user 3D touches my app's icon and invokes quick actions presentation?
This is not possible, dynamic does not mean you can execute code at display of quick action. Your app can only setup dynamic quick actions after launch.
https://developer.apple.com/documentation/uikit/uiapplicationshortcutitem
Dynamic vs. Static Quick Actions Although immutable, a UIApplicationShortcutItem instance is considered dynamic to distinguish it from a static quick action you specify at build time. Define Home screen dynamic quick actions using this class. Your code creates dynamic quick actions, and registers them with your app object, at runtime.