You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I click on the "Preview Sample PDF" button, the app crashes with this message :
2017-07-18 18:53:51.432 Cobalt Catalog[8793:1621201] This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes.
- (void) onMessageWithCobaltController: (CobaltViewController *)viewController
andData: (NSDictionary *)data {
NSString * callback = [data objectForKey:kJSCallback];
NSString * action = [data objectForKey:kJSAction];
if (action != nil && [action isEqualToString:@"pdf"]) {
if (DEBUG_COBALT) NSLog(@"PdfPlugin received data %@", data.description);
// prepare data
_viewController = viewController;
// add defined tokens
_tokens = @[kAPITokenSource,
kAPITokenPath,
kAPITokenLocal,
kAPITokenRemote,
kAPITokenTitle,
kAPITokenDetail];
// parse dictionary
_filedata = [[NSDictionary alloc] initWithDictionary:[self parseDictionary:data]];
if (_filedata == NULL || _filedata.count == 0) {
NSLog(@"Error while parsing file datas, check your javascript.");
return;
}
if (DEBUG_COBALT) NSLog(@"PdfPlugin input parsing done: %@", _filedata.description);
// open Remote Pdf
NSString *source = [_filedata objectForKey:kAPITokenSource];
if ([source isEqualToString:kAPITokenRemote]) {
// get url
NSURL *url = [NSURL URLWithString:[_filedata objectForKey:kAPITokenPath]];
// check iOS version
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"9.0")) {
SFSafariViewController *svc = [[SFSafariViewController alloc] initWithURL:url];
svc.delegate = self;
HERE =======> [viewController presentViewController:svc animated:YES completion:nil];
} else if (SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(@"8.9")) { // version 0 to 8.9
[[UIApplication sharedApplication] openURL:url];
}
} else if ([source isEqualToString:kAPITokenLocal]) { // open Local Pdf
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"3.2")) {
[self previewDocument:[_filedata objectForKey:kAPITokenPath]];
}
// can't open pdf
}
// send callback
[viewController sendCallback: callback
withData: nil];
}
}
The text was updated successfully, but these errors were encountered:
When I click on the "Preview Sample PDF" button, the app crashes with this message :
2017-07-18 18:53:51.432 Cobalt Catalog[8793:1621201] This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes.
The text was updated successfully, but these errors were encountered: