Skip to content

Commit

Permalink
feat(CameraPlugin/iOS): allow returning base64string
Browse files Browse the repository at this point in the history
  • Loading branch information
colenso committed Apr 22, 2024
1 parent 0464322 commit 7380bf1
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions camera/ios/Sources/CameraPlugin/CameraPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -373,13 +373,22 @@ private extension CameraPlugin {
call?.reject("Unable to get portable path to file")
return
}

photos.append([
var data = [
"path": fileURL.absoluteString,
"exif": processedImage.exifData,
"webPath": webURL.absoluteString,
"format": "jpeg"
])
] as [String : Any]

if settings.resultType == CameraResultType.base64 {
data["base64String"] = jpeg.base64EncodedString()
} else {
data["path"] = fileURL.absoluteString
data["webPath"] = webURL.absoluteString
}

photos.append(data)
}
call?.resolve([
"photos": photos
Expand Down

0 comments on commit 7380bf1

Please sign in to comment.