2016-04-27 8 views
0

Ich habe ein Update für meine iOS-App veröffentlicht, die, AFAIK, ändert nicht die Art, wie wir mit Push-Benachrichtigungen umgehen.PFAddUniqueOperation - Systematische Absturz für eine Untergruppe von Benutzern

Allerdings meldet eine Untergruppe unserer Benutzer einen systematischen Absturz beim Start. Stoff sagt mir die App Absturz durch:

Fatal Exception: NSInternalInconsistencyException 
Operation is invalid after previous operation. 

und zeigt, dass es vorkommender ist, wenn ich Benutzer suscribe Push-Kanäle in Verfahren updateAgenciesChannels auf Standard:

NSArray *agencies = [NSArray arrayWithObjects:@"channelA",@"channelB", nil]; 
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 
PFInstallation *currentInstallation = [PFInstallation currentInstallation]; 

for(NSString *agency in agencies) 
{ 
    NSString *agencyString = [@"a-" stringByAppendingString:agency]; 
    BOOL agencyState = [defaults boolForKey:agencyString]; 
    if(agencyState) 
     [currentInstallation addUniqueObject:agencyString 
             forKey:@"channels"]; 
    else 
     [currentInstallation removeObject:agencyString 
             forKey:@"channels"]; 

    [currentInstallation saveInBackground]; 
} 
  • Es scheint nicht zu sein bezogen auf die iOS-Version (alle Abstürze ereignen sich unter 9.1.3, aber viele Benutzer unter 9.1.3 sind völlig in Ordnung), noch scheint es mit dem Gerätetyp verbunden zu sein.

  • Für diesen Teil des Benutzers, ist der Absturz systematischen, bei den Starts, auch nach nach dem Löschen/wieder die App zu installieren ist

Hier einer des vollständigen Crash-Protokolls:

Fatal Exception: NSInternalInconsistencyException 
0 CoreFoundation     0x180ffee38 __exceptionPreprocess 
1 libobjc.A.dylib    0x180663f80 objc_exception_throw 
2 CoreFoundation     0x180ffed80 -[NSException initWithCoder:] 
3 NextRide      0x1001c012c -[PFAddUniqueOperation mergeWithPrevious:] (PFFieldOperation.m:277) 
4 NextRide      0x1001e1240 -[PFObject(Private) performOperation:forKey:] (PFObject.m:1172) 
5 NextRide      0x1001e83dc -[PFObject addUniqueObjectsFromArray:forKey:] (PFObject.m:2170) 
6 NextRide      0x1001e8318 -[PFObject addUniqueObject:forKey:] (PFObject.m:2166) 
7 NextRide      0x1000ac4c8 +[NRNPush updateAgenciesChannels] (NRNPush.m:54) 
8 NextRide      0x1000ac2dc +[NRNPush updateDefaultChannels] (NRNPush.m:35) 
9 NextRide      0x100083b10 -[AppDelegate application:didFinishLaunchingWithOptions:] (AppDelegate.m:86) 
10 UIKit       0x1861be8a8 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] 
11 UIKit       0x1863ee094 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] 
12 UIKit       0x1863f2500 -[UIApplication _runWithMainScene:transitionContext:completion:] 
13 UIKit       0x1863ef674 -[UIApplication workspaceDidEndTransaction:] 
14 FrontBoardServices    0x18299f7ac __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ 
15 FrontBoardServices    0x18299f618 -[FBSSerialQueue _performNext] 
16 FrontBoardServices    0x18299f9c8 -[FBSSerialQueue _performNextFromRunLoopSource] 
17 CoreFoundation     0x180fb5124 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ 
18 CoreFoundation     0x180fb4bb8 __CFRunLoopDoSources0 
19 CoreFoundation     0x180fb28b8 __CFRunLoopRun 
20 CoreFoundation     0x180edcd10 CFRunLoopRunSpecific 
21 UIKit       0x1861b7834 -[UIApplication _run] 
22 UIKit       0x1861b1f70 UIApplicationMain 
23 NextRide      0x1000d054c main (main.m:28) 
24 libdispatch.dylib    0x180a7a8b8 (Missing) 

Antwort

0

Es stellte sich heraus, dass ich möglicherweise versuchte, wenn diese Methode mehrere Male aufgerufen wurde, den Benutzer zu einem Kanal zu abonnieren, wenn er bereits abonniert war ("unique object" bereits in Array), und versuchte, den Benutzer in einen Kanal zu versetzen er war schon nicht beschriftet (entferne ein Objekt nicht i n Array)

Verwandte Themen