App Clip Invocation and App Invocation.

We have an existing UIKit app which we want to setup an App Clip for.

I've gone ahead and successfully created an App Clip using the SwiftUI and tested it using the debug env variable 'XCAppClipURL', I've also witnessed it working with the card using Local Experience settings on my device through settings.

My question is how can I test the invocation on the App itself?

I want to test it because although the functionality of the app clip and the app are going to be the same, the implementations differ, with the App Clip using swiftUI and the App using UIKit.

In my app delegate I have setup the following method:

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

Any help greatly appreciated.
Hi  JayThyng,

you have to configure in the scene delegate the willConnectTo function:

Code Block swift
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {}

I was experiencing the same problem with the func continue userActivity, so I've search and found this, in fact this works with XCAppClipURL, Local Experiences and the launch from QR Code/iMessage

Hope that this could help.
Hey Fabio97, thanks for your offer of help, unfortunately the main App code is quite old, pre iOS13 and does not have a SceneDelegate. I've implemented 'continue userActivity' on the App Delegate though, is there something else?
you should have the sceneDelegate in your app clip target cause it's from iOS 14
Hey Fabio,

My App Clip is targeting iOS14, that's the only way that can work, but my App is targeting much earlier, iOS9 I think.

Thanks,

Jason

yes so you can configure the scene delegate, because it's handled from your app clip not from your main app target, try to add the function in the scene delegate and run the app wit an XCAppClipURL and you'll see that that function is called
Same issue here. "_XCAppClipURL" ist working fine for the App Clip scheme but not for the main app scheme. Testing with Test Flight version when app is installed also isn't possible, a dialog appears and the app gets deinstalled.
App Clip Invocation and App Invocation.
 
 
Q