Enabling Deep Links via AppDelegate

Hello!

I‘m picking up this thread here

– I‘d like to implement deep links for my Cocos Creator 2.4.5 app.

I‘m trying to add this code


func application(_ application: UIApplication,
                 open url: URL,
                 options: [UIApplicationOpenURLOptionsKey : Any] = [:] ) -> Bool {

    // Determine who sent the URL.
    let sendingAppID = options[.sourceApplication]
    print("source application = \(sendingAppID ?? "Unknown")")

    // Process the URL.
    guard let components = NSURLComponents(url: url, resolvingAgainstBaseURL: true),
        let albumPath = components.path,
        let params = components.queryItems else {
            print("Invalid URL or album path missing")
            return false
    }

    if let photoIndex = params.first(where: { $0.name == "index" })?.value {
        print("albumPath = \(albumPath)")
        print("photoIndex = \(photoIndex)")
        return true
    } else {
        print("Photo index missing")
        return false
    }
}

to my AppDelegate, but I think that I have a problem with Swift vs. Objective C here.

Is the AppDelegate for Cocos Creator apps written in Objective C?

Is there a code example of handling deep links in Cocos Creator I could look at?

I‘m a bit lost here, thank you for your help.