-
-
Notifications
You must be signed in to change notification settings - Fork 363
Open
Description
Platform
iOS
Environment
Production
Installed
CocoaPods
Version
8.53.2
Xcode Version
16.4
Did it work on previous versions?
No
Steps to Reproduce
If options.sessionReplay.sessionSampleRate = Float(1.0) or
options.sessionReplay.onErrorSampleRate = Float(1.0) is set when initializing sentry, the app will crash when the following code is used to start the camera in the app. This only happens in iOS 26. It is normal in earlier versions of iOS.
This problem exists whether it is initialized in OC or in Swift.
actual suspend fun FileKit.openCameraPicker(
type: FileKitCameraType
): PlatformFile? = withContext(Dispatchers.Main) {
suspendCoroutine { continuation ->
cameraControllerDelegate = CameraControllerDelegate(
onImagePicked = { image ->
if (image != null) {
// Convert UIImage to NSData (JPEG format with compression quality 1.0)
val imageData = UIImageJPEGRepresentation(image, 1.0)
// Get the path for the temporary directory
val tempDir = NSTemporaryDirectory()
val fileName = "image_${NSUUID().UUIDString}.jpg"
val filePath = tempDir + fileName
// Create an NSURL for the file path
val fileUrl = NSURL.fileURLWithPath(filePath)
// Write the NSData to the file
if (imageData?.writeToURL(fileUrl, true) == true) {
// Return the NSURL of the saved image file
continuation.resume(PlatformFile(fileUrl))
} else {
// If saving fails, return null
continuation.resume(null)
}
} else {
continuation.resume(null)
}
}
)
val pickerController = UIImagePickerController()
pickerController.sourceType =
UIImagePickerControllerSourceType.UIImagePickerControllerSourceTypeCamera
pickerController.delegate = cameraControllerDelegate
UIApplication.sharedApplication.firstKeyWindow?.rootViewController?.presentViewController(
pickerController,
animated = true,
completion = null
)
}
}
This is a screenshot of xcode:



This is a screenshot of Sentry:


Expected Result
Don't Crash
Actual Result
App Crash
Are you willing to submit a PR?
No response