forked from mirrors/linphone-iphone
start multitasking support
This commit is contained in:
parent
65d11ff32b
commit
de06385293
4 changed files with 34 additions and 3 deletions
|
|
@ -47,6 +47,8 @@
|
|||
|
||||
bool isDebug;
|
||||
bool isStarted;
|
||||
bool backgroundSupported;
|
||||
|
||||
LinphoneCore* myLinphoneCore;
|
||||
SCNetworkReachabilityContext proxyReachabilityContext;
|
||||
SCNetworkReachabilityRef proxyReachability;
|
||||
|
|
|
|||
|
|
@ -27,6 +27,10 @@
|
|||
#import "MoreViewController.h"
|
||||
|
||||
extern void ms_au_register_card();
|
||||
void linphone_iphone_keepAliveHandler () {
|
||||
ms_message("keepalive handler invoked");
|
||||
};
|
||||
|
||||
//generic log handler for debug version
|
||||
void linphone_iphone_log_handler(int lev, const char *fmt, va_list args){
|
||||
NSString* format = [[NSString alloc] initWithCString:fmt encoding:[NSString defaultCStringEncoding]];
|
||||
|
|
@ -91,6 +95,20 @@ LinphoneCoreVTable linphonec_vtable = {
|
|||
@synthesize myPeoplePickerController;
|
||||
@synthesize myPhoneViewController;
|
||||
|
||||
- (void)applicationDidEnterBackground:(UIApplication *)application {
|
||||
|
||||
|
||||
if (backgroundSupported) {
|
||||
if ([[UIApplication sharedApplication] setKeepAliveTimeout:(NSTimeInterval)300
|
||||
handler:^{ms_warning("Handler invoked");}]) {
|
||||
ms_warning("keepalive handler succesfully registered");
|
||||
} else {
|
||||
ms_warning("keepalive handler cannot be registered");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
- (void)applicationDidFinishLaunching:(UIApplication *)application {
|
||||
|
|
@ -101,6 +119,10 @@ LinphoneCoreVTable linphonec_vtable = {
|
|||
#define HISTORY_TAB_INDEX 0
|
||||
#define MORE_TAB_INDEX 3
|
||||
|
||||
UIDevice* device = [UIDevice currentDevice];
|
||||
backgroundSupported = false;
|
||||
if ([device respondsToSelector:@selector(isMultitaskingSupported)])
|
||||
backgroundSupported = device.multitaskingSupported;
|
||||
|
||||
myPhoneViewController = (PhoneViewController*) [myTabBarController.viewControllers objectAtIndex: DIALER_TAB_INDEX];
|
||||
|
||||
|
|
@ -314,6 +336,7 @@ extern void libmsilbc_init();
|
|||
proxyReachability=SCNetworkReachabilityCreateWithName(nil, linphone_address_get_domain(addr));
|
||||
|
||||
|
||||
|
||||
[self doRegister];
|
||||
} else if (configCheckDisable == false) {
|
||||
UIAlertView* error = [[UIAlertView alloc] initWithTitle:@"Warning"
|
||||
|
|
@ -475,4 +498,5 @@ bool networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
|
|||
SCNetworkReachabilityGetFlags (proxyReachability,&reachabilityFlags);
|
||||
networkReachabilityCallBack(proxyReachability,reachabilityFlags,self);
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -33,5 +33,10 @@
|
|||
<string>wifi</string>
|
||||
<string>microphone</string>
|
||||
</array>
|
||||
<key>UIBackgroundModes</key>
|
||||
<array>
|
||||
<string>audio</string>
|
||||
<string>voip</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
|
|||
|
|
@ -712,7 +712,7 @@
|
|||
LINK_WITH_STANDARD_LIBRARIES = YES;
|
||||
PREBINDING = NO;
|
||||
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "09801E17-63DB-47FD-A203-166EDD1E55A1";
|
||||
SDKROOT = iphoneos3.1;
|
||||
SDKROOT = iphoneos3.2;
|
||||
};
|
||||
name = Distribution;
|
||||
};
|
||||
|
|
@ -753,7 +753,7 @@
|
|||
LIBRARY_SEARCH_PATHS = "";
|
||||
LINK_WITH_STANDARD_LIBRARIES = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = iphoneos3.1;
|
||||
SDKROOT = iphoneos3.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
|
|
@ -766,7 +766,7 @@
|
|||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = iphoneos3.1;
|
||||
SDKROOT = iphoneos3.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue