12

I am developing a VoIP app for iPhone. To receive calls, Apple developed PushKit so developers can send VoIP notifications using APNS.

Everything was working fine on iOS 8. When I updated to iOS 9, the PKRegistryDelegate does not fire the method didUpdatePushCredentials after registration.

Any ideas/suggestions?

Pacemaker
  • 1,117
  • 2
  • 17
  • 36
  • Did you ever figure out what was happening? – stevel Apr 14 '16 at 22:58
  • 1
    I forgot what was the problem. But one problem I faced was that Apple uses two different APNS server types for pushing tokens: One for development environments, and one for production environments. So if you are testing from Xcode, then make sure in your server that you are using : gateway.sandbox.push.apple.com 2195 and not: gateway.push.apple.com 2195 – Pacemaker Apr 14 '16 at 23:12
  • Let me know if you need more help – Pacemaker Apr 14 '16 at 23:14
  • I'm experiencing the exact issue in your original post. I've set up the voip push registry object, but the pushRegistry:didUpdatePushCredentials:forType: delegate method is not called. – stevel Apr 15 '16 at 18:01
  • I still cannot remember. But a major change between iOS8 and iOS9 is the requirement for encryption. Maybe that was the problem. Good luck – Pacemaker Apr 15 '16 at 18:07
  • 2
    I got it to start working after creating a new provisioning profile after creating the VoIP push certificate. – stevel Apr 17 '16 at 02:52
  • As stevel said, create a separate provisioning profile after creating the VoIP push certificate. This is the only thing that worked for me. – Fmessina Jun 15 '16 at 12:30

4 Answers4

13

Enabling the "Push notification" flag from Project->Capabilities solved my issue. It's strange because it was working without it earlier. This reply maybe late but hopefully this helps someone. I had a hard time figuring this out.

vin25
  • 346
  • 3
  • 8
  • Do we need to configure the app for Push notification also to get VoIP Push ? Apple doc doesn't mention anything other than VoIP certificate.@vin25, @GameBegins – Kannan Prasad Nov 10 '16 at 11:50
  • Same work for me also, but any one know why PushNotificaiton need to ON. while we not using it.? – hpDev_iOS Nov 15 '16 at 15:00
  • This is my speculation, VoIP is just an enhancement of remote notifications. So, that we can tackle high priority pushes and works even when app is terminated. Since its just an enhancement of remote notifications so we need to switch on remote notifications too. – GameBegins Nov 16 '16 at 15:44
  • Yes enabling Project->Capabilities solved my issue too. Thanks! – Gopik Jul 07 '17 at 20:59
  • In my project voip was working earlier now not working – Vineesh TP Jul 06 '18 at 17:14
4

If you're running a newer xcode (I'm on xcode 9) then VOIP is not in the Background section on the Capabilities tab. This will prevent didUpdatePushCredentials from being called!

The trick is you have to go in your plist, and in Required Background Modes you need to add App provides Voice over IP services.

enter image description here

BigCheesy
  • 1,128
  • 8
  • 14
2

So I had this problem as well, and spent two days pulling my hair out. I did all of these:

  • clean project turn on / off background modes
  • turn on / off push notifications
  • restart x-code
  • restart computer
  • removed app from device
  • cleaned /Library/Developer/DerivedData
  • then i'd revoke all certificates, removed all provisioning profiles. Removed them even from my keychain. Created everything again and installed it again in keychain and xcode.

All of this did not help.

Then, for some reason i thought, what if i just turn my phone, which i was testing with, off and on again.

and then it worked...

morksinaanab
  • 682
  • 7
  • 20
0

For me It was the issue of Certificates. The development certificate was used by my app, did not configured push in that certificates. Hope this may help anybody..

Megha Parmar
  • 248
  • 2
  • 15