XCODE AppDelegate:self? Framework to Framework Communication for NSURLSession


please help!

goal: create cocoa touch framework syncing framework different cloud api storage services (azure, aws, filemaker api*)



currently, use filemaker pro filemaker go ios app sdk most. filemaker inc. has created cocoa touch framework bundle entire application within it, assume appdelegate , viewcontroller classes within it, can't tell because compiled.



create second framework coca touch can run background tasks / downloads triggered custom framework.

have been sucessfull @ embedding framework along side filemaker go's ios app sdk , running commands, can push json, json, , download files in main thread, once app goes sleep download triggered framework stops. using nsurlsession of this. try attach nsurlsession background config stops working , fails.



not have direct access app's appdelegate or viewcontroller classes. cannot modify them direclty.



nsurlsessionconfiguration *backgroundconfiguration = [nsurlsessionconfiguration backgroundsessionconfiguration:mad:"com.captech.nsurlsample.backgroundsession"]; nsurlsession *backgroundsession = [nsurlsession sessionwithconfiguration:backgroundconfiguration delegate:self delegatequeue:nil];



- (void)urlsession:(nsurlsession *)session downloadtask:(nsurlsessiondownloadtask *)downloadtask didwritedata:(int64_t)byteswritten totalbyteswritten:(int64_t)totalbyteswritten totalbytesexpectedtowrite:(int64_t)totalbytesexpectedtowrite { if (downloadtask == self.downloadtask && self.progressaction){ self.progressaction((double)totalbyteswritten, (double)totalbytesexpectedtowrite); } }


problem lies think in delegate:self identifier. never resolves. have tried removing nothing downloads. have tried pch prefix header identiy appdelegate not luck. trid (myappdd *) uiapp sharedapp delegate try reference since framework i'm building isnt embeded in app yet don't think can resolve.

if can figure out how reference appdelegate or around attaching new tasks can run background downloads cocoa touch framework awesome.

resources on nsurlsession usage tried, not luck delegate:self on background stuff. if don't need background execution works fine becuase don't have 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



thoughts or suggestions on framework framework communication appdelegate self , viewcontroller awesome.

please remember coca touch framework building must able compile before being added filemaker skd ios app project.



thanks,



nate
 

a few random comments:

background downloads complicated. if build separate app , background downloads working there before attempting integrate app you're building.

objective-c classdump tool. find names of classes in sdk. also, man nm.

can access app delegate directly uiapplication. can set own app delegate though sdk sets own. if did call through sdk app delegate delegate methods , should still work. there might other trickery add own callbacks background downloads.
 


Forums iPhone, iPad, and iPod Touch iOS Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

Comments

Popular posts from this blog

How would you like to be sentenced by a computer program?

MBP extremely slow, HDD cable replaced, what next?

How much is my cMP worth?