-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS] Immediate Crash #23
Comments
Also having this issue. |
Hey @roblav96 , @karan1149 did you guys still reproduce this with the latest version of the plugin and the tis-core-modules? |
@NickIliev I have not tried using this since the original post up top. I ended up wiping together something small using private static _downloadData(): Promise<NSURL> {
return new Promise(function(resolve, reject) {
let file: string = 'Archive'
let config: NSURLSessionConfiguration = NSURLSessionConfiguration.backgroundSessionConfigurationWithIdentifier('com.roblav96.sandbox')
let manager: AFURLSessionManager = AFURLSessionManager.new().initWithSessionConfiguration(config)
let url: NSURL = NSURL.URLWithString(IP + '/tessdata/' + file + '.zip')
let request: NSURLRequest = NSURLRequest.requestWithURL(url)
let downloadTask: NSURLSessionDownloadTask = manager.downloadTaskWithRequestProgressDestinationCompletionHandler(
request,
function downloadProgressBlock(progress: NSProgress) {
let value: number = Math.min(progress.completedUnitCount / progress.totalUnitCount, 99)
TesseractClass.emitter.emit('progress', value)
},
function destination(targetPath: NSURL, response: NSURLResponse): NSURL {
let tessdata: Folder = knownFolders.temp().getFolder('tessdata')
let nsurl: NSURL = NSURL.fileURLWithPath(tessdata.path + '/' + file + '.zip')
return nsurl
},
function completionHandler(response: NSURLResponse, filePath: NSURL, nserror: NSError) {
if (nserror) {
let error: any = (nserror.description) ? nserror.description : nserror
global.tnsconsole.error('downloadData > error', error)
reject(error)
} else {
resolve(filePath)
}
}
)
downloadTask.resume()
})
} I'll check this and see if it's working. I'm always deving on |
@NickIliev I can confirm that the latest version works flawless on android and ios :D |
@roblav96 can you help me if I want to download multiple files. Your code is allowing only single file download. |
My app crashes and I get this error when trying to upload a file on iOS 馃槩
Source
Error
package.json
Using the latest version with the example
server.js
backend supplied in this repository.The text was updated successfully, but these errors were encountered: