Fix badge and no video issue

This commit is contained in:
Yann Diorcet 2013-01-28 16:13:46 +01:00
parent 6113992183
commit c9d0d86721
4 changed files with 19 additions and 22 deletions

View file

@ -129,9 +129,6 @@
[takeCallButton makeRoundWithCorner:(UIRectCornerBottomLeft|UIRectCornerTopLeft) radius:(takeCallButton.bounds.size.height/2.0)];
}
linphone_core_set_native_video_window_id([LinphoneManager getLc], (unsigned long)videoView);
linphone_core_set_native_preview_window_id([LinphoneManager getLc], 0);
videoZoomHandler = [[VideoZoomHandler alloc] init];
[videoZoomHandler setup:videoView];
@ -192,6 +189,8 @@
}
// Update on show
linphone_core_set_native_video_window_id([LinphoneManager getLc], (unsigned long)videoView);
linphone_core_set_native_preview_window_id([LinphoneManager getLc], 0);
LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]);
LinphoneCallState state = (call != NULL)?linphone_call_get_state(call): 0;
[self callUpdate:call state:state animated:FALSE];

View file

@ -2,13 +2,13 @@
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1536</int>
<string key="IBDocument.SystemVersion">12C60</string>
<string key="IBDocument.InterfaceBuilderVersion">2844</string>
<string key="IBDocument.AppKitVersion">1187.34</string>
<string key="IBDocument.HIToolboxVersion">625.00</string>
<string key="IBDocument.SystemVersion">11G63</string>
<string key="IBDocument.InterfaceBuilderVersion">2840</string>
<string key="IBDocument.AppKitVersion">1138.51</string>
<string key="IBDocument.HIToolboxVersion">569.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">1930</string>
<string key="NS.object.0">1926</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBProxyObject</string>
@ -585,6 +585,6 @@
<string key="icon5.png">{16, 16}</string>
<string key="snapshot.png">{44, 34}</string>
</dictionary>
<string key="IBCocoaTouchPluginVersion">1930</string>
<string key="IBCocoaTouchPluginVersion">1926</string>
</data>
</archive>

View file

@ -224,11 +224,9 @@ static BuschJaegerMainView* mainViewInstance=nil;
[historyQueue addOperationWithBlock:^(void) {
if([[LinphoneManager instance] configuration].valid) {
NSMutableSet *set = [[[LinphoneManager instance] configuration] getHistory];
if(set != nil) {
int missed = [set count] - [[[LinphoneManager instance] configuration].history count];
if(missed < 0) missed = 0;
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:missed];
}
int missed = [set count] - [[[LinphoneManager instance] configuration].history count];
if(missed < 0) missed = 0;
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:missed];
}
}];
}
@ -300,13 +298,6 @@ static BuschJaegerMainView* mainViewInstance=nil;
[self dismissIncomingCall:call];
if ((linphone_core_get_calls([LinphoneManager getLc]) == NULL)) {
[navigationController popToViewController:welcomeView animated:FALSE]; // No animation... Come back when Apple have learned how to create a good framework
}
LinphoneCallLog *log = linphone_call_get_call_log(call);
if(log != NULL && log->status == LinphoneCallMissed) {
// We can't use the comparison method, we can be in background mode and the application
// will no send/update the http request
int missed = [[UIApplication sharedApplication] applicationIconBadgeNumber];
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:++missed];
}
break;
}

View file

@ -490,6 +490,13 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char
// Disable speaker when no more call
if ((state == LinphoneCallEnd || state == LinphoneCallError)) {
LinphoneCallLog *log = linphone_call_get_call_log(call);
if(log != NULL && log->status == LinphoneCallMissed) {
// We can't use the comparison method, we can be in background mode and the application
// will no send/update the http request
int missed = [[UIApplication sharedApplication] applicationIconBadgeNumber];
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:++missed];
}
if(linphone_core_get_calls_nb(theLinphoneCore) == 0) {
[self setSpeakerEnabled:FALSE];
[self removeCTCallCenterCb];
@ -596,7 +603,7 @@ static void linphone_iphone_registration_state(LinphoneCore *lc, LinphoneProxyCo
&& [UIApplication sharedApplication].applicationState != UIApplicationStateActive) {
NSString *ringtone = [NSString stringWithFormat:@"%@_loop.wav", [[NSUserDefaults standardUserDefaults] stringForKey:@"level_ringtone_preference"], nil];
NSString *ringtone = [NSString stringWithFormat:@"%@.wav", [[NSUserDefaults standardUserDefaults] stringForKey:@"level_ringtone_preference"], nil];
// Create a new notification
UILocalNotification* notif = [[[UILocalNotification alloc] init] autorelease];