# Issue with VOIP notifications

**URL:** <https://community.sendbird.com/t/issue-with-voip-notifications/4153>\
**Category:** iOS\
**Tags:** sendbird-call, push-notification, ios\
**Created:** [March 11, 2022, 12:43pm UTC](https://community.sendbird.com/t/issue-with-voip-notifications/4153 "2022-03-11T12:43:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Android\_MR\_Firebase](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/android_mr_firebase/32/2076_2.png) [@Android\_MR\_Firebase](https://community.sendbird.com/u/Android_MR_Firebase)\
**Post date:** [March 11, 2022, 12:43pm UTC](https://community.sendbird.com/t/issue-with-voip-notifications/4153/1 "2022-03-11T12:43:09Z")

</div>

i m facing issue in one to one video call, i am using deauthenticate function and unregister VOIP tokens on logout in my application, and when i try to call that deauthenticated user i am still receiving VOIP notification.

 ![Screen Shot 2022-03-12 at 9.32.50 AM](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/4/48b2162283e764a6f5318a56a0a90679c25918d5.png)

---

<div class="post-metadata">

**Author:** ![Android\_MR\_Firebase](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/android_mr_firebase/32/2076_2.png) [@Android\_MR\_Firebase](https://community.sendbird.com/u/Android_MR_Firebase)\
**Post date:** [March 15, 2022, 4:12am UTC](https://community.sendbird.com/t/issue-with-voip-notifications/4153/4 "2022-03-15T04:12:32Z")

</div>

Hi @Ian ,  
i m implementing it in iOS, i am using VOIP notifications and unregistering VOIP Push tokens on logout, still i have to use SendBirdCall.unregisterRemotePush ?

```auto
 func deauthenticate() {
        
        print("deauthenticate appdelegate")
        SendBirdCall.deauthenticate { (error) in
            guard error == nil else { return }
            
            if let dataToken = UserDefaults.standard.voipPushToken as? Data {
                SendBirdCall.unregisterVoIPPush(token: UserDefaults.standard.voipPushToken, completionHandler: nil)
            }
            else {
                SendBirdCall.unregisterVoIPPush(token: tokenVoip, completionHandler: nil)
            }
            print("Successfully deauthenticated from SendBirdCalls")
        }
    }

```

---

<div class="post-metadata">

**Author:** ![mininny](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/mininny/32/305_2.png) [@mininny](https://community.sendbird.com/u/mininny)\
**Post date:** [March 18, 2022, 1:53am UTC](https://community.sendbird.com/t/issue-with-voip-notifications/4153/5 "2022-03-18T01:53:14Z")

</div>

Hi @Android_MR_Firebase , Sorry for the late response.

You should call `SendBirdCall.unregisterVoIPPush` before you call `SendBirdCall.deauthenticate`. Can you try this and see if the VoIP Push stops?

---

<div class="post-metadata">

**Author:** ![Android\_MR\_Firebase](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/android_mr_firebase/32/2076_2.png) [@Android\_MR\_Firebase](https://community.sendbird.com/u/Android_MR_Firebase)\
**Post date:** [March 21, 2022, 12:15pm UTC](https://community.sendbird.com/t/issue-with-voip-notifications/4153/6 "2022-03-21T12:15:41Z")

</div>

Hi @mininny

i tried the above, it fixed the issue, now i am not getting any VoIP push after logout, but i am getting another issue when i followed the above, When i logged in again now i am not getting any VoIP notification.

Here is the code snippet for both login(Authenticate) and logout(Deauthenticate)

For Login

```auto
//MARK: - Authenticate the user
    func authenticate(callerUserId: String) {
        
        let authenticateParams = AuthenticateParams(userId: callerUserId)
        SendBirdCall.authenticate(with: authenticateParams) { (user, error) in
            guard let user = user, error == nil else { return }
            
            SendBirdCall.registerVoIPPush(token: tokenVoip, unique: true) { error in
                guard error == nil else { return }
            }
            
            print("Successfully authenticated with userId: \(user.userId)")
        }
    }

```

For Logout

```auto
//MARK: - Deauthenticate User
     func deauthenticate() {

         if let dataToken = UserDefaults.standard.voipPushToken as? Data {
             SendBirdCall.unregisterVoIPPush(token: UserDefaults.standard.voipPushToken, 
             completionHandler: nil)
         }
         else {
             SendBirdCall.unregisterVoIPPush(token: tokenVoip, completionHandler: nil)
         }

        SendBirdCall.deauthenticate { (error) in
            guard error == nil else { return }
      
            print("Successfully deauthenticated from SendBirdCalls")
        }
    }

```

---

<div class="post-metadata">

**Author:** ![Dev\_iOS](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@Dev\_iOS](https://community.sendbird.com/u/Dev_iOS)\
**Post date:** [March 15, 2024, 6:11am UTC](https://community.sendbird.com/t/issue-with-voip-notifications/4153/7 "2024-03-15T06:11:37Z")

</div>

Hi @Android_MR_Firebase

try with below method

func deauthenticate() {  
if let dataToken = UserDefaults.standard.voipPushToken as? Data {  
SendBirdCall.unregisterVoIPPush(token: UserDefaults.standard.voipPushToken) { error in  
SendBirdCall.deauthenticate { (error) in  
guard error == nil else { return }  
print(“Successfully deauthenticated from SendBirdCalls”)  
}  
}  
}  
else {  
SendBirdCall.unregisterVoIPPush(token: tokenVoip) { error in  
SendBirdCall.deauthenticate { (error) in  
guard error == nil else { return }  
print(“Successfully deauthenticated from SendBirdCalls”)  
}  
}  
}  
}

after logout check Sendbird Dashboard user token is remove or not and after again login and check register new token
