Please help!
My goal: Create a Cocoa Touch Framework that is a syncing framework for different Cloud API Storage Services (Azure, AWS, Filemaker API*)
Currently, I use FileMaker Pro with FileMaker Go IOS APP SDK the most. FileMaker Inc. has created a Cocoa Touch Framework bundle that is basically an entire application within it, I assume the AppDelegate and ViewController classes are within it, but I can't tell because they are compiled.
I would like to create a second Framework with Coca Touch that can run background tasks / downloads triggered by my custom framework.
I have been sucessfull at embedding my framework along side FileMaker Go's iOS App SDK and running commands, I can push JSON, get JSON, and download files but only in the main thread, once the app goes to sleep the download triggered from my framework stops. I am using NSURLSession to do all of this. But as soon as I try to attach a NSURLSession Background Config everything stops working and fails.
I do not have direct access to the App's AppDelegate or ViewController Classes. I cannot modify them direclty.
NSURLSessionConfiguration *backgroundConfiguration = [NSURLSessionConfiguration backgroundSessionConfiguration"com.captech.NSURLSample.BackgroundSession"]; NSURLSession *backgroundSession = [NSURLSession sessionWithConfiguration:backgroundConfiguration delegate:self delegateQueue:nil];
- (void)URLSessionNSURLSession *)session downloadTaskNSURLSessionDownloadTask *)downloadTask didWriteDataint64_t)bytesWritten totalBytesWrittenint64_t)totalBytesWritten totalBytesExpectedToWriteint64_t)totalBytesExpectedToWrite { if (downloadTask == self.downloadTask && self.progressAction){ self.progressAction((double)totalBytesWritten, (double)totalBytesExpectedToWrite); } }
My problem lies I think in the delegate:self identifier. This never resolves. I have tried removing it but nothing downloads. I have tried a PCH prefix header to identiy the appdelegate but not luck. I also trid the (MyAppdD *) UIApp SharedApp delegate to try to get a reference but since the Framework I'm building isnt embeded in the app yet I don't think it can resolve.
But if I can figure out how to reference the appdelegate or get around attaching new tasks to it so that I can run background downloads from my Cocoa Touch Framework that would be awesome.
Good Resources on NSURLSession Usage that I tried, but not luck with the delegate:self on the background stuff. If I don't need the background execution then everything works fine becuase I don't have to define delegate:self ever.
http://hayageek.com/ios-nsurlsession-example/#background-download
https://www.captechconsulting.com/blogs/ios-7-tutorial-series--nsurlsession
https://developer.apple.com/library.../BackgroundExecution/BackgroundExecution.html
https://code.tutsplus.com/tutorials/networking-with-nsurlsession-part-1--mobile-21394
http://corsarus.com/2015/background-fetching-using-nsurlsession/
https://www.infragistics.com/commun...ve-c-downloading-data-using-nsurlsession.aspx
Any thoughts or suggestions on this Framework to Framework communication for the AppDelegate Self and Viewcontroller would be awesome.
Please remember my coca touch framework that I am building must be able to compile before being added to the FileMaker SKD iOS APP Project.
Thanks,
Nate
My goal: Create a Cocoa Touch Framework that is a syncing framework for different Cloud API Storage Services (Azure, AWS, Filemaker API*)
Currently, I use FileMaker Pro with FileMaker Go IOS APP SDK the most. FileMaker Inc. has created a Cocoa Touch Framework bundle that is basically an entire application within it, I assume the AppDelegate and ViewController classes are within it, but I can't tell because they are compiled.
I would like to create a second Framework with Coca Touch that can run background tasks / downloads triggered by my custom framework.
I have been sucessfull at embedding my framework along side FileMaker Go's iOS App SDK and running commands, I can push JSON, get JSON, and download files but only in the main thread, once the app goes to sleep the download triggered from my framework stops. I am using NSURLSession to do all of this. But as soon as I try to attach a NSURLSession Background Config everything stops working and fails.
I do not have direct access to the App's AppDelegate or ViewController Classes. I cannot modify them direclty.
NSURLSessionConfiguration *backgroundConfiguration = [NSURLSessionConfiguration backgroundSessionConfiguration"com.captech.NSURLSample.BackgroundSession"]; NSURLSession *backgroundSession = [NSURLSession sessionWithConfiguration:backgroundConfiguration delegate:self delegateQueue:nil];
- (void)URLSessionNSURLSession *)session downloadTaskNSURLSessionDownloadTask *)downloadTask didWriteDataint64_t)bytesWritten totalBytesWrittenint64_t)totalBytesWritten totalBytesExpectedToWriteint64_t)totalBytesExpectedToWrite { if (downloadTask == self.downloadTask && self.progressAction){ self.progressAction((double)totalBytesWritten, (double)totalBytesExpectedToWrite); } }
My problem lies I think in the delegate:self identifier. This never resolves. I have tried removing it but nothing downloads. I have tried a PCH prefix header to identiy the appdelegate but not luck. I also trid the (MyAppdD *) UIApp SharedApp delegate to try to get a reference but since the Framework I'm building isnt embeded in the app yet I don't think it can resolve.
But if I can figure out how to reference the appdelegate or get around attaching new tasks to it so that I can run background downloads from my Cocoa Touch Framework that would be awesome.
Good Resources on NSURLSession Usage that I tried, but not luck with the delegate:self on the background stuff. If I don't need the background execution then everything works fine becuase I don't have to define delegate:self ever.
http://hayageek.com/ios-nsurlsession-example/#background-download
https://www.captechconsulting.com/blogs/ios-7-tutorial-series--nsurlsession
https://developer.apple.com/library.../BackgroundExecution/BackgroundExecution.html
https://code.tutsplus.com/tutorials/networking-with-nsurlsession-part-1--mobile-21394
http://corsarus.com/2015/background-fetching-using-nsurlsession/
https://www.infragistics.com/commun...ve-c-downloading-data-using-nsurlsession.aspx
Any thoughts or suggestions on this Framework to Framework communication for the AppDelegate Self and Viewcontroller would be awesome.
Please remember my coca touch framework that I am building must be able to compile before being added to the FileMaker SKD iOS APP Project.
Thanks,
Nate