Thanx for reply.
About properties I remembered - it's not possible to add properties to existing class by normal way.
Ok, remains a question about methods.
I 'translated' OBJC-sample. NSURLSession works fine even in background and I receive messages that a task is finished.
But I don't see application:handleEventsForBackgroundURLSession: and can't understand way.
AppDelegate.m in OBJC-sample has
- (void)application:(UIApplication *)application handleEventsForBackgroundURLSession:(NSString *)identifier completionHandler:(void (^)(void))completionHandler
{
NSLog(@"Background URL session needs events handled: %@", identifier);
completionHandler();
}
I converted to
#if OBJC
@end
@implementation B4IAppDelegate (SM)
- (void)application:(UIApplication *)application handleEventsForBackgroundURLSession:(NSString *)identifier completionHandler:(void (^)(void))completionHandler
{
NSLog(@"Background URL session needs events handled: %@", identifier);
completionHandler();
B4I* bi = [b4i_main new].bi;
[bi raiseUIEvent:nil event:@"application_handleeventsforbackgroundurlsession:" params:@[identifier]];
}
#End If
NSLog works fine in background (I output a response from web server). Probably, a problem in application:handleEventsForBackgroundURLSession:completionHandler: as it is. But I can't access to it (I mean no.Initialize ("B4IAppDelegate").RunMethod ("application:handleEventsForBackgroundURLSession:completionHandler:", ...). And this confuses me. What I doing wrong ?