This commit is contained in:
Paul Cartier 2020-03-20 16:58:08 +01:00
parent ca38aaa90a
commit 6921587447
4 changed files with 13 additions and 13 deletions

View file

@ -75,7 +75,7 @@ NSString *const kLinphoneFileTransferRecvUpdate = @"LinphoneFileTransferRecvUpda
NSString *const kLinphoneQRCodeFound = @"LinphoneQRCodeFound";
NSString *const kLinphoneChatCreateViewChange = @"LinphoneChatCreateViewChange";
NSString *const kLinphoneMsgNotificationGroupId = @"group.org.linphone.phone.msgNotification";
NSString *const kLinphoneMsgNotificationAppGroupId = @"group.org.linphone.phone.msgNotification";
const int kLinphoneAudioVbrCodecDefaultBitrate = 36; /*you can override this from linphonerc or linphonerc-factory*/
@ -1459,7 +1459,7 @@ void popup_link_account_cb(LinphoneAccountCreator *creator, LinphoneAccountCreat
linphone_core_cbs_set_qrcode_found(cbs, linphone_iphone_qr_code_found);
linphone_core_cbs_set_user_data(cbs, (__bridge void *)(self));
theLinphoneCore = linphone_factory_create_shared_core_with_config(factory, _configDb, NULL, [kLinphoneMsgNotificationGroupId UTF8String], true);
theLinphoneCore = linphone_factory_create_shared_core_with_config(factory, _configDb, NULL, [kLinphoneMsgNotificationAppGroupId UTF8String], true);
linphone_core_add_callbacks(theLinphoneCore, cbs);
[CallManager.instance setCoreWithCore:theLinphoneCore];
@ -1891,7 +1891,7 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
if (IPAD && [[NSFileManager defaultManager] fileExistsAtPath:factoryIpad]) {
factory = factoryIpad;
}
_configDb = linphone_config_new_for_shared_core(kLinphoneMsgNotificationGroupId.UTF8String, @"linphonerc".UTF8String, factory.UTF8String);
_configDb = linphone_config_new_for_shared_core(kLinphoneMsgNotificationAppGroupId.UTF8String, @"linphonerc".UTF8String, factory.UTF8String);
lp_config_clean_entry(_configDb, "misc", "max_calls");
}
#pragma mark - Audio route Functions
@ -2137,19 +2137,19 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
+ (NSString *)preferenceFile:(NSString *)file {
LinphoneFactory *factory = linphone_factory_get();
NSString *fullPath = [NSString stringWithUTF8String:linphone_factory_get_config_dir(factory, kLinphoneMsgNotificationGroupId.UTF8String)];
NSString *fullPath = [NSString stringWithUTF8String:linphone_factory_get_config_dir(factory, kLinphoneMsgNotificationAppGroupId.UTF8String)];
return [fullPath stringByAppendingPathComponent:file];
}
+ (NSString *)dataFile:(NSString *)file {
LinphoneFactory *factory = linphone_factory_get();
NSString *fullPath = [NSString stringWithUTF8String:linphone_factory_get_data_dir(factory, kLinphoneMsgNotificationGroupId.UTF8String)];
NSString *fullPath = [NSString stringWithUTF8String:linphone_factory_get_data_dir(factory, kLinphoneMsgNotificationAppGroupId.UTF8String)];
return [fullPath stringByAppendingPathComponent:file];
}
+ (NSString *)cacheDirectory {
LinphoneFactory *factory = linphone_factory_get();
NSString *cachePath = [NSString stringWithUTF8String:linphone_factory_get_download_dir(factory, kLinphoneMsgNotificationGroupId.UTF8String)];
NSString *cachePath = [NSString stringWithUTF8String:linphone_factory_get_download_dir(factory, kLinphoneMsgNotificationAppGroupId.UTF8String)];
BOOL isDir = NO;
NSError *error;
// cache directory must be created if not existing

View file

@ -32,7 +32,7 @@ class LinphoneLoggingServiceManager: LoggingServiceDelegate {
let debugEnabled = (debugLevel >= LogLevel.Debug.rawValue && debugLevel < LogLevel.Error.rawValue)
if (debugEnabled) {
Factory.Instance.logCollectionPath = Factory.Instance.getDownloadDir(context: UnsafeMutablePointer<Int8>(mutating: (GROUP_ID as NSString).utf8String))
Factory.Instance.logCollectionPath = Factory.Instance.getDownloadDir(context: UnsafeMutablePointer<Int8>(mutating: (APP_GROUP_ID as NSString).utf8String))
Factory.Instance.enableLogCollection(state: LogCollectionState.Enabled)
log.domain = domain
log.logLevel = LogLevel(rawValue: debugLevel)

View file

@ -23,7 +23,7 @@ import UserNotificationsUI
import linphonesw
var GROUP_ID = "group.org.linphone.phone.msgNotification"
var APP_GROUP_ID = "group.org.linphone.phone.msgNotification"
var isReplySent: Bool = false
var needToStop: Bool = false
var coreStopped: Bool = false
@ -132,10 +132,10 @@ class NotificationViewController: UIViewController, UNNotificationContentExtensi
}
func startCore() throws {
config = Config.newForSharedCore(groupId: GROUP_ID, configFilename: "linphonerc", factoryPath: "")
config = Config.newForSharedCore(appGroupId: APP_GROUP_ID, configFilename: "linphonerc", factoryPath: "")
log = LoggingService.Instance /*enable liblinphone logs.*/
logDelegate = try! LinphoneLoggingServiceManager(config: config, log: log, domain: "msgNotificationContent")
lc = try! Factory.Instance.createSharedCoreWithConfig(config: config, systemContext: nil, appGroup: GROUP_ID, mainCore: false)
lc = try! Factory.Instance.createSharedCoreWithConfig(config: config, systemContext: nil, appGroupId: APP_GROUP_ID, mainCore: false)
coreDelegate = LinphoneCoreManager()
lc!.addDelegate(delegate: coreDelegate)

View file

@ -20,7 +20,7 @@
import UserNotifications
import linphonesw
var GROUP_ID = "group.org.linphone.phone.msgNotification"
var APP_GROUP_ID = "group.org.linphone.phone.msgNotification"
var LINPHONE_DUMMY_SUBJECT = "dummy subject"
struct MsgData: Codable {
@ -153,13 +153,13 @@ class NotificationService: UNNotificationServiceExtension {
func createCore() {
NSLog("[msgNotificationService] create core")
let config = Config.newForSharedCore(groupId: GROUP_ID, configFilename: "linphonerc", factoryPath: "")
let config = Config.newForSharedCore(appGroupId: APP_GROUP_ID, configFilename: "linphonerc", factoryPath: "")
if (NotificationService.log == nil || NotificationService.log.getDelegate() == nil) {
NotificationService.log = LoggingService.Instance /*enable liblinphone logs.*/
NotificationService.logDelegate = try! LinphoneLoggingServiceManager(config: config!, log: NotificationService.log, domain: "msgNotificationService")
}
lc = try! Factory.Instance.createSharedCoreWithConfig(config: config!, systemContext: nil, appGroup: GROUP_ID, mainCore: false)
lc = try! Factory.Instance.createSharedCoreWithConfig(config: config!, systemContext: nil, appGroupId: APP_GROUP_ID, mainCore: false)
}
func stopCore() {