ios - App crashes while app is going into background and when iPad gets auto-locked -
i facing weird issue in application when app goes background mode , when ipad gets locked. till working fine while unlocking device , opening app background, crashing.
this crash log, getting device
exception type: 00000020 exception codes: 0x000000008badf00d exception note: simulated (this not crash) highlighted thread: 8 application specific information: <bknewprocess: 0x12cd18cb0; com.apps-factory; pid: 540; hostpid: -1> has active assertions beyond permitted time: {( <bkprocessassertion: 0x12cd1e3b0> id: 540-72c6af6c-f674-40e8-ba89-efe4bf52f8d6 name: called uikit, <redacted> process: <bknewprocess: 0x12cd18cb0; com.apps-factory; pid: 540; hostpid: -1> permittedbackgroundduration: 180.000000 reason: finishtask owner pid:540 preventsuspend preventidlesleep preventsuspendonsleep )} elapsed total cpu time (seconds): 82.430 (user 82.430, system 0.000), 23% cpu elapsed application cpu time (seconds): 77.475, 21% cpu filtered syslog: none found
my app has continuous dot animation on screen rainfall effect based on data db being synced server.
any highly appreciated. in advance!!
as looking crash log
sure reason behind crash due background fetch still in process after 3 mins (180 seconds)
.
so if not wrong after 3 mins kill app , while reopen in crash mode not run directly.
i facing same issue in app resolve issue have begin background task
in code through appdelegate
this:
[[uiapplication sharedapplication] beginbackgroundtaskwithexpirationhandler:nil];
and need end task in application delegate method
- (void)applicationdidenterbackground:(uiapplication *)application { __block uibackgroundtaskidentifier bgtask = [application beginbackgroundtaskwithexpirationhandler:^{ [application endbackgroundtask:bgtask]; bgtask = uibackgroundtaskinvalid; //save state or data while invalidating bgtask. }]; }
and thats why in crash report apple mention os allow task in background 3 mins only!
check crash
application specific information: <bknewprocess: 0x12cd18cb0; com.apps-factory; pid: 540; hostpid: -1> has active assertions beyond permitted time: {( <bkprocessassertion: 0x12cd1e3b0> id: 540-72c6af6c-f674-40e8-ba89-efe4bf52f8d6 name: called uikit, <redacted> process: <bknewprocess: 0x12cd18cb0; com.apps-factory; pid: 540; hostpid: -1> permittedbackgroundduration: 180.000000 reason: finishtask owner pid:540 preventsuspend preventidlesleep preventsuspendonsleep )}
permittedbackgroundduration: 180.000000 reason: finishtask owner
means have 180 seconds perform task in background mention here in apple documentation.
if still requires more time execute task need enable app background mode
specific reason otherwise apple may reject app.
hope resolve crash.
Comments
Post a Comment