AppIntent is not notifying MainApp With NSUserActivity in UIKit

This is Siri Intent before iOS 16.

func handle(intent: CustomIntent, completion: @escaping (CustomIntentResponse) -> Void) {
        completion(CustomIntentResponse(code: .continueInApp, userActivity: nil))
 }

This flow working fine.

This is AppIntent after iOS 16. There are 2 ways to continue in app

  • openAppWhenRun = true
  • ForegroundContinuableIntent Protocol only works in SwiftUI

But both are not notifying the main app its just opening app without activity. In SiriIntent we can notifiy Main App with completion(CustomIntentResponse(code: .continueInApp, userActivity: nil))

application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool

else its start with didfinishlaunching and we can get useractivity.

Is there any solution for after iOS 16 In AppIntent we can notify app and get NSUserActivity?

Found a solution to this?

Yes, AppIntent is not separate target same as Siri Intent. App Intent is part of Main App so you can access your shared (singleton instance like app delegate from UIApplication.shared.delegate or other instance).

AppIntent is not notifying MainApp With NSUserActivity in UIKit
 
 
Q