Merge branch 'master'

This commit is contained in:
Benoit Martins 2024-10-22 14:24:26 +02:00
commit 349a290ec5
5 changed files with 33 additions and 11 deletions

View file

@ -1250,7 +1250,7 @@
CODE_SIGN_ENTITLEMENTS = msgNotificationService/msgNotificationService.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 53;
CURRENT_PROJECT_VERSION = 55;
DEVELOPMENT_TEAM = Z2V957B3D6;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = gnu17;
@ -1293,7 +1293,7 @@
CODE_SIGN_ENTITLEMENTS = msgNotificationService/msgNotificationService.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 53;
CURRENT_PROJECT_VERSION = 55;
DEVELOPMENT_TEAM = Z2V957B3D6;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = gnu17;
@ -1450,7 +1450,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
CODE_SIGN_ENTITLEMENTS = Linphone/Linphone.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 53;
CURRENT_PROJECT_VERSION = 55;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "\"Linphone/Preview Content\"";
@ -1507,7 +1507,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
CODE_SIGN_ENTITLEMENTS = Linphone/Linphone.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 53;
CURRENT_PROJECT_VERSION = 55;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"Linphone/Preview Content\"";
DEVELOPMENT_TEAM = Z2V957B3D6;

View file

@ -363,10 +363,6 @@ final class CoreContext: ObservableObject {
mCore.removeDelegate(delegate: delegate)
}
func getCorePublisher() -> CoreDelegatePublisher? {
return mCore.publisher
}
}
// swiftlint:enable line_length

View file

@ -22,6 +22,7 @@ import linphonesw
import UserNotifications
let accountTokenNotification = Notification.Name("AccountCreationTokenReceived")
var displayedChatroomPeerAddr: String?
class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCenterDelegate {
@ -81,6 +82,19 @@ class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCenterDele
completionHandler()
}
// Display notifications on foreground
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
let userInfo = notification.request.content.userInfo
Log.info("Received push notification in foreground, payload= \(userInfo)")
if let callId = userInfo["CallId"] as? String, let peerAddr = userInfo["peer_addr"] as? String, let localAddr = userInfo["local_addr"] as? String {
// Only display notification if we're not in the chatroom they come from
if displayedChatroomPeerAddr != peerAddr {
completionHandler([.banner, .sound])
}
}
}
func applicationWillTerminate(_ application: UIApplication) {
Log.info("IOS applicationWillTerminate")
CoreContext.shared.doOnCoreQueue(synchronous: true) { core in

View file

@ -1243,9 +1243,9 @@ struct ContentView: View {
}
class NavigationManager: ObservableObject {
@Published var selectedCallId: String? = nil
@Published var peerAddr: String? = nil
@Published var localAddr: String? = nil
@Published var selectedCallId: String?
@Published var peerAddr: String?
@Published var localAddr: String?
func openChatRoom(callId: String, peerAddr: String, localAddr: String) {
self.selectedCallId = callId

View file

@ -69,7 +69,13 @@ struct ConversationFragment: View {
.onRotate { newOrientation in
orientation = newOrientation
}
.onAppear() {
displayedChatroomPeerAddr = conversationViewModel.displayedConversation?.remoteSipUri
Log.info("debugtrace = onAppear: displayedChatroomPeerAddr = \(displayedChatroomPeerAddr)")
}
.onDisappear {
displayedChatroomPeerAddr = nil
Log.info("debugtrace = onDisappear: displayedChatroomPeerAddr = nil")
conversationViewModel.removeConversationDelegate()
}
.sheet(isPresented: $conversationViewModel.isShowSelectedMessageToDisplayDetails, onDismiss: {
@ -109,7 +115,13 @@ struct ConversationFragment: View {
.onRotate { newOrientation in
orientation = newOrientation
}
.onAppear() {
displayedChatroomPeerAddr = conversationViewModel.displayedConversation?.remoteSipUri
Log.info("debugtrace = onAppear: displayedChatroomPeerAddr = \(displayedChatroomPeerAddr)")
}
.onDisappear {
displayedChatroomPeerAddr = nil
Log.info("debugtrace = onDisappear: displayedChatroomPeerAddr = nil")
conversationViewModel.removeConversationDelegate()
}
.halfSheet(showSheet: $conversationViewModel.isShowSelectedMessageToDisplayDetails) {