Update createAndInitializeAccount common function for easier push settings understanding

This commit is contained in:
QuentinArguillere
2021-07-29 11:28:46 +02:00
parent a63960ab0b
commit b2bc5b1b12
2 changed files with 9 additions and 10 deletions

View File

@@ -66,14 +66,8 @@ class CallKitExampleContext : ObservableObject
func createAccountAndRegister() {
if (!loggedIn) {
do {
account = try createAndInitializeAccount(core : mCore, identity: id, password: passwd)
// This is necessary to register to the server and handle push Notifications. Make sure you have a certificate to match your app's bundle ID.
let updatedPushParams = account.params?.clone()
updatedPushParams?.pushNotificationConfig?.provider = "apns.dev"
updatedPushParams?.pushNotificationAllowed = true
account.params = updatedPushParams
account = try createAndInitializeAccount(core : mCore, identity: id, password: passwd, withVoipPush: true)
try mCore.addAccount(account: account!)
if ( mCore.defaultAccount == nil) {
// IMPORTANT : default account setting MUST be done AFTER adding the config to the core !