2014-06-06 7 views
8

Ho integrato la versione più recente dell'SDK di Google Analytics. Uso le notifiche silenziose nella mia app. Quindi ho bisogno di un po 'di tempo per le attività in background (circa 30 secondi). Vedo molti arresti anomali connessi al tempo consentito.Arresto anomalo dell'app su push in remoto con BKProcessAssertion

My App[3114] has active assertions beyond permitted time: 
{(
    <BKProcessAssertion: 0x15699c00> identifier: Background Content Fetching (15) process: MyApp [3114] permittedBackgroundDuration: 30.000000 reason: backgroundContentFetching owner 
    pid:3101 preventSuspend preventThrottleDownUI preventIdleSleep preventSuspendOnSleep 
)} 

vedo tha applicazione si blocca con il seguente stack su [GAI threadMain]:

Thread 2: 
0 libsystem_kernel.dylib   0x3b47ca58 mach_msg_trap + 20 
1 libsystem_kernel.dylib   0x3b47c854 mach_msg + 44 
2 CoreFoundation     0x3074c896 __CFRunLoopServiceMachPort + 150 
3 CoreFoundation     0x3074afbc __CFRunLoopRun + 780 
4 CoreFoundation     0x306b5f0a CFRunLoopRunSpecific + 518 
5 CoreFoundation     0x306b5cee CFRunLoopRunInMode + 102 
6 Foundation      0x310a81e6 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 250 
7 Foundation      0x310f909c -[NSRunLoop(NSRunLoop) run] + 76 
8 MyApp       0x0016df5c +[GAI threadMain:] + 60 
9 Foundation      0x3116aa5a __NSThread__main__ + 1058 
10 libsystem_pthread.dylib   0x3b4f8916 _pthread_body + 138 
11 libsystem_pthread.dylib   0x3b4f8886 _pthread_start + 98 
12 libsystem_pthread.dylib   0x3b4f6aa0 thread_start + 4 

Penso che incidente sia collegato con Google Analytics, ho provato disattivare Google Analytics sulla spinta remota come this:

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo 
    fetchCompletionHandler:(BackgroundFetchResultBlock)completionHandler { 
    ... 
    [GAI sharedInstance].optOut = YES; 

ma non aiuta.

+0

Thread 2 sembra che stia solo aspettando di ricevere un evento da elaborare. C'è un "thread evidenziato" nel registro degli arresti anomali? –

+0

@ Romula Hai mai risolto questo? Lo stiamo vedendo ora, e abbiamo rifatto il nostro backgrounding, ma rimanendo comunque snakebitten di GA –

risposta

0

Vedere this SO answer. In breve, il problema è che l'attività in background è durata più del tempo consentito. Il tempo di sottofondo consentito è stato ridotto significativamente da iOS6; potrebbe essere necessario rivisitare il design e apportare modifiche.