mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
fix call-id lookup from push notification.
This commit is contained in:
parent
ed626cac6f
commit
d7da75593b
2 changed files with 19 additions and 6 deletions
|
|
@ -33,8 +33,11 @@
|
|||
CTCallCenter* callCenter;
|
||||
BOOL started;
|
||||
int savedMaxCall;
|
||||
|
||||
}
|
||||
|
||||
- (void)processRemoteNotification:(NSDictionary*)userInfo;
|
||||
|
||||
@property (assign) BOOL started;
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -162,7 +162,11 @@
|
|||
}
|
||||
|
||||
[self startApplication];
|
||||
|
||||
NSDictionary *aps=[launchOptions objectForKey:@"aps"];
|
||||
if (aps){
|
||||
[LinphoneLogger log:LinphoneLoggerLog format:@"PushNotification from launch received."];
|
||||
[self processRemoteNotification:launchOptions];
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
|
@ -184,6 +188,7 @@
|
|||
|
||||
|
||||
- (void)applicationWillTerminate:(UIApplication *)application {
|
||||
|
||||
}
|
||||
|
||||
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
|
||||
|
|
@ -200,9 +205,8 @@
|
|||
return YES;
|
||||
}
|
||||
|
||||
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
|
||||
[LinphoneLogger log:LinphoneLoggerLog format:@"PushNotification: Receive %@", userInfo];
|
||||
NSDictionary *aps = [userInfo objectForKey:@"aps"];
|
||||
- (void)processRemoteNotification:(NSDictionary*)userInfo{
|
||||
NSDictionary *aps = [userInfo objectForKey:@"aps"];
|
||||
if(aps != nil) {
|
||||
NSDictionary *alert = [aps objectForKey:@"alert"];
|
||||
if(alert != nil) {
|
||||
|
|
@ -218,8 +222,9 @@
|
|||
[[PhoneMainView instance] changeCurrentView:[ChatViewController compositeViewDescription]];
|
||||
} else if([loc_key isEqualToString:@"IC_MSG"]) {
|
||||
//it's a call
|
||||
if ([alert objectForKey:@"call-id"])
|
||||
[[LinphoneManager instance] enableAutoAnswerForCallId:[alert objectForKey:@"call-id"]];
|
||||
NSString *callid=[userInfo objectForKey:@"call-id"];
|
||||
if (callid)
|
||||
[[LinphoneManager instance] enableAutoAnswerForCallId:callid];
|
||||
else
|
||||
[LinphoneLogger log:LinphoneLoggerError format:@"PushNotification: does not have call-id yet, fix it !"];
|
||||
}
|
||||
|
|
@ -228,6 +233,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
|
||||
[LinphoneLogger log:LinphoneLoggerLog format:@"PushNotification: Receive %@", userInfo];
|
||||
[self processRemoteNotification:userInfo];
|
||||
}
|
||||
|
||||
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
|
||||
if([notification.userInfo objectForKey:@"call"] != nil) {
|
||||
LinphoneCall* call;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue