fechanique / cordova-plugin-fcm

Google FCM Push Notifications Cordova Plugin
623 stars 999 forks source link

1.1.5 crashes iOS 10 #142

Open rossi256 opened 8 years ago

rossi256 commented 8 years ago

Installed latest - iOS 10, Xcode 8,-

reproduce: start app, allow push notifications, switch app to background and send push notifications, tap the notification. for me it works 1-2 times times and then crashes the app

*\ Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'can't start iterating in the middle of an iteration' libc++abi.dylib: terminating with uncaught exception of type NSException

it marks this:

{
    NSString *JSONString = [[NSString alloc] initWithBytes:[payload bytes] length:[payload length] encoding:NSUTF8StringEncoding];
    NSString * notifyJS = [NSString stringWithFormat:@"%@(%@);", notificationCallback, JSONString];
    NSLog(@"stringByEvaluatingJavaScriptFromString %@", notifyJS);

    if ([self.webView respondsToSelector:@selector(stringByEvaluatingJavaScriptFromString:)]) {
        [(UIWebView *)self.webView stringByEvaluatingJavaScriptFromString:notifyJS];
    } else {
        [self.webViewEngine evaluateJavaScript:notifyJS completionHandler:nil];
    }
}
aswinramakrish commented 7 years ago

Our app got rejected because of this issue. Seems to work fine in Android.