สวัสดีฉันทำแอป iOS โดยใช้ UniversalLink
ยูนิเวอร์แซเชื่อมโยงผลงานดี แต่วิธีการโทรกลับไม่ได้เรียกว่า
AppDelegate.swift ของฉันอยู่ด้านล่าง
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
    var window: UIWindow?
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        return true
    }
    func application(_ application: UIApplication,
                     willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
        return true
    }
    // this method not called!!
    func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
        print("called")
        return true
    }
}
วิธีการนี้เรียกว่าใน iOS 12 Simulator
ดังนั้นปัญหาจะเกิดขึ้นเฉพาะใน iOS 13
เฉพาะใน iOS13 ข้อผิดพลาดนี้จะถูกพิมพ์ในคอนโซล
ไม่สามารถจบ BackgroundTask: ไม่มีงานพื้นหลังที่มีตัวระบุ 1 (0x1) หรืออาจสิ้นสุดลงแล้ว แตกใน UIApplicationEndBackgroundTaskError () เพื่อดีบัก
ดังนั้นนี่อาจเป็นสาเหตุของปัญหา
ฉันขอขอบคุณที่มีคนช่วย