Posts

Post marked as solved
5 Replies
592 Views
Hi, I'm working in a iOS app using the UIImagePickerController to get files and videos from the photo library and upload to Azure Blob storage. For images, everything is working fine, but for videos, it fails with the following error: Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted" UserInfo={_kCFStreamErrorCodeKey=1, _kCFStreamErrorDomainKey=1} Basically, what I'm doing is: 1.to get the file URL from the UIImagePickerController:                 if mediaType == "public.movie" {                     let mediaURL = info[UIImagePickerController.InfoKey.mediaURL] as! NSURL                                          uploadFileAsync(fileURL: mediaURL.filePathURL)                 } the upload to Azure method:  func uploadFileAsync(fileURL: URL) { ... do { let isSecureAccess = fileURL.startAccessingSecurityScopedResource() defer{fileURL.stopAccessingSecurityScopedResource()} let resourceValues = try fileURL.resourceValues(forKeys: [.fileSizeKey]) // Gets the Mime Type let extUTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, fileURL.pathExtension as CFString, nil)?.takeUnretainedValue() let mimeType:String = extUTI != nil ? (UTTypeCopyPreferredTagWithClass(extUTI!, kUTTagClassMIMEType)?.takeUnretainedValue() as String?) ?? defaultMimeType : defaultMimeType let fileSize: Int = resourceValues.fileSize! blockBlob?.properties.length = NSNumber(value: fileSize) blockBlob?.properties.contentType = mimeType blockBlob?.uploadFromFile(with: fileURL) } The error is generating from the blockBlob?.uploadFromFile(with: fileURL) Any help is really appreciated.
Posted
by hrobles55.
Last updated
.
Post not yet marked as solved
0 Replies
186 Views
Our iPhone app allows users to share files on a host computer display while in a meeting.  To keep files secure, once the meeting ends, or if the user decides to unshare their files we remove it from the screen and any delete any temporary copies.  To be secure and ensure the user has not closed the iPhone app or has left the meeting, the host computer  send a heartbeat signal to the iPhone app.  This works very well, except when the user locks the screen or moves to another app (like email).  When our app is put in the background it cannot respond to the host computer events and the host assumes the user has purposely left the meeting.  It will then close there files and delete them.  This is a very poor user experience, as a user might have simply been checking the email or maybe looking for another file.   We need for our app to stay active in the background so that is can respond to host computer messages.   We tried to use audio background app, but we have been rejected many times by the apple store.   Can you please give us advise on how we can keep our app active in the background that would be acceptable to the apple store?
Posted
by hrobles55.
Last updated
.