feat(ios): add Share Extension startup diagnostic marker and API
Write shareExtensionLastStart on ShareViewController.viewDidLoad and expose getShareExtensionDiagnostics() through SharedImagePlugin with shareId, file path, and fileExists for debugging failed share flows.
This commit is contained in:
@@ -14,6 +14,7 @@ class ShareViewController: UIViewController {
|
||||
private let sharedPhotoFileNameKey = "sharedPhotoFileName"
|
||||
private let sharedPhotoFilePathKey = "sharedPhotoFilePath"
|
||||
private let sharedPhotoShareIdKey = "sharedPhotoShareId"
|
||||
private let shareExtensionLastStartKey = "shareExtensionLastStart"
|
||||
private let sharedImageFileName = "shared-image"
|
||||
|
||||
/// Get the App Group container URL for storing shared files
|
||||
@@ -22,6 +23,13 @@ class ShareViewController: UIViewController {
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
if let userDefaults = UserDefaults(suiteName: appGroupIdentifier) {
|
||||
let timestamp = ISO8601DateFormatter().string(from: Date())
|
||||
userDefaults.set(timestamp, forKey: shareExtensionLastStartKey)
|
||||
userDefaults.synchronize()
|
||||
print("[ShareTarget] shareExtensionLastStart=\(timestamp)")
|
||||
}
|
||||
|
||||
print("[ShareTarget] viewDidLoad started")
|
||||
super.viewDidLoad()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user